Skip to content

Commit

Permalink
chore: update aca-helloworld revisions
Browse files Browse the repository at this point in the history
Signed-off-by: Kristina Devochko <kristina.devochko@tietoevry.com>
  • Loading branch information
guidemetothemoon committed Apr 3, 2024
1 parent 4e25827 commit 3b10948
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aca-revision-and-traffic-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Implementation includes following modules:
1. Deploy code as-is first (after adjusting parameters as per your use case) - initially in [aca-public-apps.bicep](modules/aca-public-apps.bicep) it's defined that application will be deployed in multi-revision mode, but when we start from nothing only one, first, revision will be deployed. Due to that in ```*.bicepparam``` file traffic distribution is configured to send 100% traffic to the latest revision, which will be the app's very first revision.

2. Let's make a change to the application to create a new revision - in [aca-public-apps.bicep](modules/aca-public-apps.bicep) update ```TITLE``` environment variable with a new value that can identify new app revision. Next, let's update traffic distribution:
2.1. Get name of the currently active, first app revision by running following Azure CLI command (update ```resource-group``` parameter with the one defined in the respective ```.bicepparam``` file): ```az containerapp revision list --name aca-helloworld --resource-group <acaResourceGroupName_parameter_value> --query [0].name -o tsv```
2.1. Get name of the currently active, first app revision by running following Azure CLI command (update ```resource-group``` parameter with the one defined in the respective ```.bicepparam``` file): ```az containerapp revision list --name aca-hello-world --resource-group <acaResourceGroupName_parameter_value> --query [0].name -o tsv```
2.2. In the respective ```.bicepparam``` file update ```trafficDistribution``` array: update weight number for ```latestRevision``` object - this object represents every new revision that's being provisioned. Uncomment second object and update ```revisionName``` value with the one retrieved in step 2.1. Then update ```weight``` value with the amount of traffic you want to send to the previous/initial revision. **Please note that weight for all revisions combined must be 100.**
3. Re-provision resources with the new changes. Go to the public URL of the app and do a bunch of refreshes to verify that traffic is now routed to both versions/revisions of the application.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource helloworld 'Microsoft.App/containerApps@2023-05-02-preview' = {
env: [
{
name: 'TITLE'
value: 'Hello World from Azure Container Apps (ACA)!'
value: 'Hello World from Azure Container Apps (ACA) V2!'
}
]
probes: [
Expand Down
10 changes: 5 additions & 5 deletions aca-revision-and-traffic-management/parameters/dev.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ param tags = {
param trafficDistribution = [
{
latestRevision: true
weight: 100
weight: 50
}
/*{
revisionName: ''
{
revisionName: 'aca-hello-world--oca537w'
weight: 50
}*/
}
]

// Command to get revision names: az containerapp revision list --name aca-helloworld --resource-group rg-aca-helloworld-neu-dev --query [].name -o tsv
// Command to get revision names: az containerapp revision list --name aca-hello-world --resource-group rg-aca-helloworld-neu-dev --query [].name -o tsv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ param trafficDistribution = [
}*/
]

// Command to get revision names: az containerapp revision list --name aca-helloworld --resource-group rg-aca-helloworld-neu-dev --query [].name -o tsv
// Command to get revision names: az containerapp revision list --name aca-hello-world --resource-group rg-aca-helloworld-neu-dev --query [].name -o tsv

0 comments on commit 3b10948

Please sign in to comment.