diff --git a/aca-revision-and-traffic-management/README.md b/aca-revision-and-traffic-management/README.md index de50baa..13e4a90 100644 --- a/aca-revision-and-traffic-management/README.md +++ b/aca-revision-and-traffic-management/README.md @@ -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 --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 --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. diff --git a/aca-revision-and-traffic-management/modules/aca-public-apps.bicep b/aca-revision-and-traffic-management/modules/aca-public-apps.bicep index b158121..1d25314 100644 --- a/aca-revision-and-traffic-management/modules/aca-public-apps.bicep +++ b/aca-revision-and-traffic-management/modules/aca-public-apps.bicep @@ -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: [ diff --git a/aca-revision-and-traffic-management/parameters/dev.bicepparam b/aca-revision-and-traffic-management/parameters/dev.bicepparam index 78f9f7e..bba7906 100644 --- a/aca-revision-and-traffic-management/parameters/dev.bicepparam +++ b/aca-revision-and-traffic-management/parameters/dev.bicepparam @@ -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 diff --git a/aca-revision-and-traffic-management/parameters/prod.bicepparam b/aca-revision-and-traffic-management/parameters/prod.bicepparam index 32d50de..e5ed2bc 100644 --- a/aca-revision-and-traffic-management/parameters/prod.bicepparam +++ b/aca-revision-and-traffic-management/parameters/prod.bicepparam @@ -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