azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

containerapp revision copy --from-revision does not work, always takes latest revision

Open tomaxsas opened this issue 2 years ago • 8 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Trying to create new revisions based on old revisions. Even when --from-revison parameter is passed, all container env variables are taken from latest revision, same as just using containerapp update command.

Command Name az containerapp revision copy Extension Name: containerapp. Version: 0.3.20.

Errors:


To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az containerapp revision copy -o {} --from-revision {} -n {} -g {} --set-env-vars {} --revision-suffix {}

Expected Behavior

environemnt variables are taken from revision which is specified via --from-revision option

Environment Summary

Linux-5.15.79.1-microsoft-standard-WSL2-x86_64-with-glibc2.34, CentOS Stream 9
Python 3.9.16
Installer: RPM

azure-cli 2.44.1

Extensions:
containerapp 0.3.20

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

tomaxsas avatar Jan 27 '23 12:01 tomaxsas

route to CXP team

yonzhan avatar Jan 28 '23 09:01 yonzhan

@tomaxsas Thank you for reaching out, we are looking into it.

RakeshMohanMSFT avatar Jan 30 '23 07:01 RakeshMohanMSFT

@tomaxsas We are unable to reproduce this issue. Here is how we tried reproducing the issue

  1. Created a revision as below. az containerapp revision copy -n "issue5802app" -g "Issue5802" --cpu 0.25 --memory 0.5Gi --revision-suffix "issue5802revision3"
  2. Copied the same as below az containerapp revision copy -o table --from-revision "issue5802app--issue5802revision3" -n "issue5802app" -g "Issue5802" --revision-suffix "issue5802revision4" --debug If you look at the debug trace for the same its copying the right revision. look at the cpu and memory details highlighted here image

RakeshMohanMSFT avatar Jan 30 '23 09:01 RakeshMohanMSFT

here is output of my script with all commands. its clear that while copying revision allll2 the fairgame=test3 env var value changed to fairgame=test5 it came from revision qr8x10j which is latest

+ APP_NAME=test
+ APP_TAG=tttttt
+ RESOURCEGROUP=MYRG-rg
++ az containerapp revision list -n test-dev1 -g MYRG-rg
+ REVISION_LIST='[
  {
    "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",
    "name": "test-dev1--allll2",
    "properties": {
      "active": true,
      "createdTime": "2023-01-31T07:33:52+00:00",
      "fqdn": "test-dev1--allll2.some.dns.name",
      "healthState": "Healthy",
      "provisioningState": "Provisioned",
      "replicas": 0,
      "template": {
        "containers": [
          {
            "env": [
              {
                "name": "Backend__Url",
                "value": "url3"
              },
              {
                "name": "Backend__Username",
                "value": "user3"
              },
              {
                "name": "Backend__Password",
                "secretRef": "Backend-password-3",
                "value": ""
              },
              {
                "name": "neww",
                "value": "test3"
              },
              {
                "name": "newrev2",
                "value": "test3"
              },
              {
                "name": "test3",
                "value": "test3"
              },
              {
                "name": "fairgame",
                "value": "test3"
              },
              {
                "name": "onemore",
                "value": "tes3"
              },
              {
                "name": "test",
                "value": "test-dev1--atrynewk"
              },
              {
                "name": "lab",
                "value": "lab"
              }
            ],
            "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
            "name": "simple-hello-world-container",
            "probes": [],
            "resources": {
              "cpu": 0.25,
              "memory": "0.5Gi"
            }
          }
        ],
        "initContainers": null,
        "revisionSuffix": null,
        "scale": {
          "maxReplicas": 10,
          "minReplicas": 0,
          "rules": null
        },
        "volumes": null
      },
      "trafficWeight": 24
    },
    "resourceGroup": "MYRG-rg",
    "type": "Microsoft.App/containerapps/revisions"
  },
  {
    "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",
    "name": "test-dev1--allll3",
    "properties": {
      "active": true,
      "createdTime": "2023-01-31T07:34:31+00:00",
      "fqdn": "test-dev1--allll3.some.dns.name",
      "healthState": "Healthy",
      "provisioningState": "Provisioned",
      "replicas": 1,
      "template": {
        "containers": [
          {
            "env": [
              {
                "name": "Backend__Url",
                "value": "url3"
              },
              {
                "name": "Backend__Username",
                "value": "user3"
              },
              {
                "name": "Backend__Password",
                "secretRef": "Backend-password-3",
                "value": ""
              },
              {
                "name": "neww",
                "value": "test3"
              },
              {
                "name": "newrev2",
                "value": "test3"
              },
              {
                "name": "test3",
                "value": "test3"
              },
              {
                "name": "fairgame",
                "value": "test3"
              },
              {
                "name": "onemore",
                "value": "tes3"
              },
              {
                "name": "test",
                "value": "test-dev1--atrynewk"
              },
              {
                "name": "lab",
                "value": "lab"
              }
            ],
            "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
            "name": "simple-hello-world-container",
            "probes": [],
            "resources": {
              "cpu": 0.25,
              "memory": "0.5Gi"
            }
          }
        ],
        "initContainers": null,
        "revisionSuffix": null,
        "scale": {
          "maxReplicas": 10,
          "minReplicas": 0,
          "rules": null
        },
        "volumes": null
      },
      "trafficWeight": 33
    },
    "resourceGroup": "MYRG-rg",
    "type": "Microsoft.App/containerapps/revisions"
  },
  {
    "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",
    "name": "test-dev1--allll4",
    "properties": {
      "active": true,
      "createdTime": "2023-01-31T07:34:53+00:00",
      "fqdn": "test-dev1--allll4.some.dns.name",
      "healthState": "Healthy",
      "provisioningState": "Provisioned",
      "replicas": 1,
      "template": {
        "containers": [
          {
            "env": [
              {
                "name": "Backend__Url",
                "value": "url3"
              },
              {
                "name": "Backend__Username",
                "value": "user3"
              },
              {
                "name": "Backend__Password",
                "secretRef": "Backend-password-3",
                "value": ""
              },
              {
                "name": "neww",
                "value": "test3"
              },
              {
                "name": "newrev2",
                "value": "test3"
              },
              {
                "name": "test3",
                "value": "test3"
              },
              {
                "name": "fairgame",
                "value": "test3"
              },
              {
                "name": "onemore",
                "value": "tes3"
              },
              {
                "name": "test",
                "value": "test-dev1--atrynewk"
              },
              {
                "name": "lab",
                "value": "lab"
              }
            ],
            "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
            "name": "simple-hello-world-container",
            "probes": [],
            "resources": {
              "cpu": 0.25,
              "memory": "0.5Gi"
            }
          }
        ],
        "initContainers": null,
        "revisionSuffix": null,
        "scale": {
          "maxReplicas": 10,
          "minReplicas": 0,
          "rules": null
        },
        "volumes": null
      },
      "trafficWeight": 33
    },
    "resourceGroup": "MYRG-rg",
    "type": "Microsoft.App/containerapps/revisions"
  },
  {
    "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",
    "name": "test-dev1--qr8x10j",
    "properties": {
      "active": true,
      "createdTime": "2023-01-31T07:38:02+00:00",
      "fqdn": "test-dev1--qr8x10j.some.dns.name",
      "healthState": "Healthy",
      "provisioningState": "Provisioned",
      "replicas": 1,
      "template": {
        "containers": [
          {
            "env": [
              {
                "name": "Backend__Url",
                "value": "url5"
              },
              {
                "name": "Backend__Username",
                "value": "user3"
              },
              {
                "name": "Backend__Password",
                "secretRef": "Backend-password-3",
                "value": ""
              },
              {
                "name": "neww",
                "value": "test3"
              },
              {
                "name": "newrev2",
                "value": "test3"
              },
              {
                "name": "test3",
                "value": "test5"
              },
              {
                "name": "fairgame",
                "value": "test5"
              },
              {
                "name": "onemore",
                "value": "tes5"
              },
              {
                "name": "test",
                "value": "test-dev1--atrynewk"
              },
              {
                "name": "lab",
                "value": "lab"
              }
            ],
            "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
            "name": "simple-hello-world-container",
            "probes": [],
            "resources": {
              "cpu": 0.25,
              "memory": "0.5Gi"
            }
          }
        ],
        "initContainers": null,
        "revisionSuffix": null,
        "scale": {
          "maxReplicas": 10,
          "minReplicas": 0,
          "rules": null
        },
        "volumes": null
      },
      "trafficWeight": 10
    },
    "resourceGroup": "MYRG-rg",
    "type": "Microsoft.App/containerapps/revisions"
  }
]'
++ jq -r length
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ REVISION_COUNT=4
+ REVISIONS_TRAFFIC=
+ (( i = 0 ))
+ (( i < 4 ))
++ jq -r '.[0].name'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ OLD_REVISION_NAME=test-dev1--allll2
++ jq -r '.[0].properties.trafficWeight'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ TRAFFIC_WEIGTH=24
+ REVISION_NUMBER=2
+ REVISIONS_TRAFFIC='test-dev1--atttttt2=24  '
+ NEW_REVISION_NAME=test-dev1--atttttt2
++ jq -r '.[0].properties.template.containers[0].env[] | select(.name=="Backend__Url") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__URL=url3
++ jq -r '.[0].properties.template.containers[0].env[] | select(.name=="Backend__Username") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__USERNAME=user3
++ jq -r '.[0].properties.template.containers[0].env[] | select(.name=="Backend__Password") | .secretRef'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__PASSWORD=Backend-password-3
+ echo 'Copying test-dev1--allll2 revision to new test-dev1--atttttt2'
Copying test-dev1--allll2 revision to new test-dev1--atttttt2
+ az containerapp revision copy --from-revision test-dev1--allll2 -n test-dev1 -g MYRG-rg --set-env-vars Backend__Url=url3 --revision-suffix atttttt2

/ Running ..
| Running ..
\ Running ..
- Running ..
[K{
  "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerapps/test-dev1",
  "identity": {
    "type": "None"
  },
  "location": "South Central US",
  "name": "test-dev1",
  "properties": {
    "configuration": {
      "activeRevisionsMode": "Multiple",
      "dapr": null,
      "ingress": {
        "allowInsecure": false,
        "customDomains": null,
        "exposedPort": 0,
        "external": true,
        "fqdn": "test-dev1.some.dns.name",
        "ipSecurityRestrictions": null,
        "targetPort": 80,
        "traffic": [
          {
            "revisionName": "test-dev1--qr8x10j",
            "weight": 10
          },
          {
            "revisionName": "test-dev1--allll4",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll3",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll2",
            "weight": 24
          }
        ],
        "transport": "Auto"
      },
      "maxInactiveRevisions": null,
      "registries": null,
      "secrets": [
        {
          "name": "Backend-password-2"
        },
        {
          "name": "Backend-password-3"
        },
        {
          "name": "Backend-password-4"
        }
      ]
    },
    "customDomainVerificationId": "5027210F0F98F768B16422B57AC31925FB4D2D82CA8F528A6EE360E210AADABD",
    "environmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "eventStreamEndpoint": "https://southcentralus.azurecontainerapps.dev/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/containerApps/test-dev1/eventstream",
    "latestRevisionFqdn": "test-dev1--atttttt2.some.dns.name",
    "latestRevisionName": "test-dev1--atttttt2",
    "managedEnvironmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "outboundIpAddresses": [
      "20.225.116.71"
    ],
    "provisioningState": "Succeeded",
    "template": {
      "containers": [
        {
          "env": [
            {
              "name": "Backend__Url",
              "value": "url3"
            },
            {
              "name": "Backend__Username",
              "value": "user3"
            },
            {
              "name": "Backend__Password",
              "secretRef": "Backend-password-3",
              "value": ""
            },
            {
              "name": "neww",
              "value": "test3"
            },
            {
              "name": "newrev2",
              "value": "test3"
            },
            {
              "name": "test3",
              "value": "test5"
            },
            {
              "name": "fairgame",
              "value": "test5"
            },
            {
              "name": "onemore",
              "value": "tes5"
            },
            {
              "name": "test",
              "value": "test-dev1--atrynewk"
            },
            {
              "name": "lab",
              "value": "lab"
            }
          ],
          "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
          "name": "simple-hello-world-container",
          "probes": [],
          "resources": {
            "cpu": 0.25,
            "ephemeralStorage": "1Gi",
            "memory": "0.5Gi"
          }
        }
      ],
      "initContainers": null,
      "revisionSuffix": "atttttt2",
      "scale": {
        "maxReplicas": 10,
        "minReplicas": 0,
        "rules": null
      },
      "volumes": null
    },
    "workloadProfileType": null
  },
  "resourceGroup": "MYRG-rg",
  "systemData": {
    "createdAt": "2023-01-26T06:38:29.8574052",
    "createdBy": "[email protected]",
    "createdByType": "User",
    "lastModifiedAt": "2023-01-31T07:39:16.8730463",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByType": "User"
  },
  "type": "Microsoft.App/containerApps"
}
+ echo 'Deactivating old test-dev1--allll2 revision'
Deactivating old test-dev1--allll2 revision
+ az containerapp revision deactivate --revision test-dev1--allll2 -n test-dev1 -g MYRG-rg
"Deactivate succeeded"
+ echo 'Activating new test-dev1--atttttt2 revision'
Activating new test-dev1--atttttt2 revision
+ az containerapp revision activate --revision test-dev1--atttttt2 -n test-dev1 -g MYRG-rg
"Activate succeeded"
+ (( i++ ))
+ (( i < 4 ))
++ jq -r '.[1].name'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ OLD_REVISION_NAME=test-dev1--allll3
++ jq -r '.[1].properties.trafficWeight'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ TRAFFIC_WEIGTH=33
+ REVISION_NUMBER=3
+ REVISIONS_TRAFFIC='test-dev1--atttttt3=33 test-dev1--atttttt2=24   '
+ NEW_REVISION_NAME=test-dev1--atttttt3
++ jq -r '.[1].properties.template.containers[0].env[] | select(.name=="Backend__Url") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__URL=url3
++ jq -r '.[1].properties.template.containers[0].env[] | select(.name=="Backend__Username") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__USERNAME=user3
++ jq -r '.[1].properties.template.containers[0].env[] | select(.name=="Backend__Password") | .secretRef'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__PASSWORD=Backend-password-3
+ echo 'Copying test-dev1--allll3 revision to new test-dev1--atttttt3'
Copying test-dev1--allll3 revision to new test-dev1--atttttt3
+ az containerapp revision copy --from-revision test-dev1--allll3 -n test-dev1 -g MYRG-rg --set-env-vars Backend__Url=url3 --revision-suffix atttttt3

/ Running ..
| Running ..
\ Running ..
- Running ..
/ Running ..
[K{
  "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerapps/test-dev1",
  "identity": {
    "type": "None"
  },
  "location": "South Central US",
  "name": "test-dev1",
  "properties": {
    "configuration": {
      "activeRevisionsMode": "Multiple",
      "dapr": null,
      "ingress": {
        "allowInsecure": false,
        "customDomains": null,
        "exposedPort": 0,
        "external": true,
        "fqdn": "test-dev1.some.dns.name",
        "ipSecurityRestrictions": null,
        "targetPort": 80,
        "traffic": [
          {
            "revisionName": "test-dev1--qr8x10j",
            "weight": 10
          },
          {
            "revisionName": "test-dev1--allll4",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll3",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll2",
            "weight": 24
          }
        ],
        "transport": "Auto"
      },
      "maxInactiveRevisions": null,
      "registries": null,
      "secrets": [
        {
          "name": "Backend-password-2"
        },
        {
          "name": "Backend-password-3"
        },
        {
          "name": "Backend-password-4"
        }
      ]
    },
    "customDomainVerificationId": "5027210F0F98F768B16422B57AC31925FB4D2D82CA8F528A6EE360E210AADABD",
    "environmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "eventStreamEndpoint": "https://southcentralus.azurecontainerapps.dev/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/containerApps/test-dev1/eventstream",
    "latestRevisionFqdn": "test-dev1--atttttt3.some.dns.name",
    "latestRevisionName": "test-dev1--atttttt3",
    "managedEnvironmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "outboundIpAddresses": [
      "20.225.116.71"
    ],
    "provisioningState": "Succeeded",
    "template": {
      "containers": [
        {
          "env": [
            {
              "name": "Backend__Url",
              "value": "url3"
            },
            {
              "name": "Backend__Username",
              "value": "user3"
            },
            {
              "name": "Backend__Password",
              "secretRef": "Backend-password-3",
              "value": ""
            },
            {
              "name": "neww",
              "value": "test3"
            },
            {
              "name": "newrev2",
              "value": "test3"
            },
            {
              "name": "test3",
              "value": "test5"
            },
            {
              "name": "fairgame",
              "value": "test5"
            },
            {
              "name": "onemore",
              "value": "tes5"
            },
            {
              "name": "test",
              "value": "test-dev1--atrynewk"
            },
            {
              "name": "lab",
              "value": "lab"
            }
          ],
          "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
          "name": "simple-hello-world-container",
          "probes": [],
          "resources": {
            "cpu": 0.25,
            "ephemeralStorage": "1Gi",
            "memory": "0.5Gi"
          }
        }
      ],
      "initContainers": null,
      "revisionSuffix": "atttttt3",
      "scale": {
        "maxReplicas": 10,
        "minReplicas": 0,
        "rules": null
      },
      "volumes": null
    },
    "workloadProfileType": null
  },
  "resourceGroup": "MYRG-rg",
  "systemData": {
    "createdAt": "2023-01-26T06:38:29.8574052",
    "createdBy": "[email protected]",
    "createdByType": "User",
    "lastModifiedAt": "2023-01-31T07:39:40.1735997",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByType": "User"
  },
  "type": "Microsoft.App/containerApps"
}
+ echo 'Deactivating old test-dev1--allll3 revision'
Deactivating old test-dev1--allll3 revision
+ az containerapp revision deactivate --revision test-dev1--allll3 -n test-dev1 -g MYRG-rg
"Deactivate succeeded"
+ echo 'Activating new test-dev1--atttttt3 revision'
Activating new test-dev1--atttttt3 revision
+ az containerapp revision activate --revision test-dev1--atttttt3 -n test-dev1 -g MYRG-rg
"Activate succeeded"
+ (( i++ ))
+ (( i < 4 ))
++ jq -r '.[2].name'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ OLD_REVISION_NAME=test-dev1--allll4
++ jq -r '.[2].properties.trafficWeight'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ TRAFFIC_WEIGTH=33
+ REVISION_NUMBER=4
+ REVISIONS_TRAFFIC='test-dev1--atttttt4=33 test-dev1--atttttt3=33 test-dev1--atttttt2=24    '
+ NEW_REVISION_NAME=test-dev1--atttttt4
++ jq -r '.[2].properties.template.containers[0].env[] | select(.name=="Backend__Url") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__URL=url3
++ jq -r '.[2].properties.template.containers[0].env[] | select(.name=="Backend__Username") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__USERNAME=user3
++ jq -r '.[2].properties.template.containers[0].env[] | select(.name=="Backend__Password") | .secretRef'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__PASSWORD=Backend-password-3
+ echo 'Copying test-dev1--allll4 revision to new test-dev1--atttttt4'
Copying test-dev1--allll4 revision to new test-dev1--atttttt4
+ az containerapp revision copy --from-revision test-dev1--allll4 -n test-dev1 -g MYRG-rg --set-env-vars Backend__Url=url3 --revision-suffix atttttt4

/ Running ..
| Running ..
\ Running ..
- Running ..
[K{
  "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerapps/test-dev1",
  "identity": {
    "type": "None"
  },
  "location": "South Central US",
  "name": "test-dev1",
  "properties": {
    "configuration": {
      "activeRevisionsMode": "Multiple",
      "dapr": null,
      "ingress": {
        "allowInsecure": false,
        "customDomains": null,
        "exposedPort": 0,
        "external": true,
        "fqdn": "test-dev1.some.dns.name",
        "ipSecurityRestrictions": null,
        "targetPort": 80,
        "traffic": [
          {
            "revisionName": "test-dev1--qr8x10j",
            "weight": 10
          },
          {
            "revisionName": "test-dev1--allll4",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll3",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll2",
            "weight": 24
          }
        ],
        "transport": "Auto"
      },
      "maxInactiveRevisions": null,
      "registries": null,
      "secrets": [
        {
          "name": "Backend-password-2"
        },
        {
          "name": "Backend-password-3"
        },
        {
          "name": "Backend-password-4"
        }
      ]
    },
    "customDomainVerificationId": "5027210F0F98F768B16422B57AC31925FB4D2D82CA8F528A6EE360E210AADABD",
    "environmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "eventStreamEndpoint": "https://southcentralus.azurecontainerapps.dev/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/containerApps/test-dev1/eventstream",
    "latestRevisionFqdn": "test-dev1--atttttt4.some.dns.name",
    "latestRevisionName": "test-dev1--atttttt4",
    "managedEnvironmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "outboundIpAddresses": [
      "20.225.116.71"
    ],
    "provisioningState": "Succeeded",
    "template": {
      "containers": [
        {
          "env": [
            {
              "name": "Backend__Url",
              "value": "url3"
            },
            {
              "name": "Backend__Username",
              "value": "user3"
            },
            {
              "name": "Backend__Password",
              "secretRef": "Backend-password-3",
              "value": ""
            },
            {
              "name": "neww",
              "value": "test3"
            },
            {
              "name": "newrev2",
              "value": "test3"
            },
            {
              "name": "test3",
              "value": "test5"
            },
            {
              "name": "fairgame",
              "value": "test5"
            },
            {
              "name": "onemore",
              "value": "tes5"
            },
            {
              "name": "test",
              "value": "test-dev1--atrynewk"
            },
            {
              "name": "lab",
              "value": "lab"
            }
          ],
          "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
          "name": "simple-hello-world-container",
          "probes": [],
          "resources": {
            "cpu": 0.25,
            "ephemeralStorage": "1Gi",
            "memory": "0.5Gi"
          }
        }
      ],
      "initContainers": null,
      "revisionSuffix": "atttttt4",
      "scale": {
        "maxReplicas": 10,
        "minReplicas": 0,
        "rules": null
      },
      "volumes": null
    },
    "workloadProfileType": null
  },
  "resourceGroup": "MYRG-rg",
  "systemData": {
    "createdAt": "2023-01-26T06:38:29.8574052",
    "createdBy": "[email protected]",
    "createdByType": "User",
    "lastModifiedAt": "2023-01-31T07:40:07.7023279",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByType": "User"
  },
  "type": "Microsoft.App/containerApps"
}
+ echo 'Deactivating old test-dev1--allll4 revision'
Deactivating old test-dev1--allll4 revision
+ az containerapp revision deactivate --revision test-dev1--allll4 -n test-dev1 -g MYRG-rg
"Deactivate succeeded"
+ echo 'Activating new test-dev1--atttttt4 revision'
Activating new test-dev1--atttttt4 revision
+ az containerapp revision activate --revision test-dev1--atttttt4 -n test-dev1 -g MYRG-rg
"Activate succeeded"
+ (( i++ ))
+ (( i < 4 ))
++ jq -r '.[3].name'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ OLD_REVISION_NAME=test-dev1--qr8x10j
++ jq -r '.[3].properties.trafficWeight'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ TRAFFIC_WEIGTH=10
+ REVISION_NUMBER=j
+ REVISIONS_TRAFFIC='test-dev1--attttttj=10 test-dev1--atttttt4=33 test-dev1--atttttt3=33 test-dev1--atttttt2=24     '
+ NEW_REVISION_NAME=test-dev1--attttttj
++ jq -r '.[3].properties.template.containers[0].env[] | select(.name=="Backend__Url") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__URL=url5
++ jq -r '.[3].properties.template.containers[0].env[] | select(.name=="Backend__Username") | .value'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__USERNAME=user3
++ jq -r '.[3].properties.template.containers[0].env[] | select(.name=="Backend__Password") | .secretRef'
++ echo '[' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll2",' '"name":' '"test-dev1--allll2",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:33:52+00:00",' '"fqdn":' '"test-dev1--allll2.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 0, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 24 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll3",' '"name":' '"test-dev1--allll3",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:31+00:00",' '"fqdn":' '"test-dev1--allll3.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--allll4",' '"name":' '"test-dev1--allll4",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:34:53+00:00",' '"fqdn":' '"test-dev1--allll4.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url3"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test3"' '},' '{' '"name":' '"fairgame",' '"value":' '"test3"' '},' '{' '"name":' '"onemore",' '"value":' '"tes3"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 33 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '},' '{' '"id":' '"/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerApps/test-dev1/revisions/test-dev1--qr8x10j",' '"name":' '"test-dev1--qr8x10j",' '"properties":' '{' '"active":' true, '"createdTime":' '"2023-01-31T07:38:02+00:00",' '"fqdn":' '"test-dev1--qr8x10j.some.dns.name",' '"healthState":' '"Healthy",' '"provisioningState":' '"Provisioned",' '"replicas":' 1, '"template":' '{' '"containers":' '[' '{' '"env":' '[' '{' '"name":' '"Backend__Url",' '"value":' '"url5"' '},' '{' '"name":' '"Backend__Username",' '"value":' '"user3"' '},' '{' '"name":' '"Backend__Password",' '"secretRef":' '"Backend-password-3",' '"value":' '""' '},' '{' '"name":' '"neww",' '"value":' '"test3"' '},' '{' '"name":' '"newrev2",' '"value":' '"test3"' '},' '{' '"name":' '"test3",' '"value":' '"test5"' '},' '{' '"name":' '"fairgame",' '"value":' '"test5"' '},' '{' '"name":' '"onemore",' '"value":' '"tes5"' '},' '{' '"name":' '"test",' '"value":' '"test-dev1--atrynewk"' '},' '{' '"name":' '"lab",' '"value":' '"lab"' '}' '],' '"image":' '"mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",' '"name":' '"simple-hello-world-container",' '"probes":' '[],' '"resources":' '{' '"cpu":' 0.25, '"memory":' '"0.5Gi"' '}' '}' '],' '"initContainers":' null, '"revisionSuffix":' null, '"scale":' '{' '"maxReplicas":' 10, '"minReplicas":' 0, '"rules":' null '},' '"volumes":' null '},' '"trafficWeight":' 10 '},' '"resourceGroup":' '"MYRG-rg",' '"type":' '"Microsoft.App/containerapps/revisions"' '}' ']'
+ Backend__PASSWORD=Backend-password-3
+ echo 'Copying test-dev1--qr8x10j revision to new test-dev1--attttttj'
Copying test-dev1--qr8x10j revision to new test-dev1--attttttj
+ az containerapp revision copy --from-revision test-dev1--qr8x10j -n test-dev1 -g MYRG-rg --set-env-vars Backend__Url=url5 --revision-suffix attttttj

/ Running ..
| Running ..
\ Running ..
- Running ..
/ Running ..
[K{
  "id": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/containerapps/test-dev1",
  "identity": {
    "type": "None"
  },
  "location": "South Central US",
  "name": "test-dev1",
  "properties": {
    "configuration": {
      "activeRevisionsMode": "Multiple",
      "dapr": null,
      "ingress": {
        "allowInsecure": false,
        "customDomains": null,
        "exposedPort": 0,
        "external": true,
        "fqdn": "test-dev1.some.dns.name",
        "ipSecurityRestrictions": null,
        "targetPort": 80,
        "traffic": [
          {
            "revisionName": "test-dev1--qr8x10j",
            "weight": 10
          },
          {
            "revisionName": "test-dev1--allll4",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll3",
            "weight": 33
          },
          {
            "revisionName": "test-dev1--allll2",
            "weight": 24
          }
        ],
        "transport": "Auto"
      },
      "maxInactiveRevisions": null,
      "registries": null,
      "secrets": [
        {
          "name": "Backend-password-2"
        },
        {
          "name": "Backend-password-3"
        },
        {
          "name": "Backend-password-4"
        }
      ]
    },
    "customDomainVerificationId": "5027210F0F98F768B16422B57AC31925FB4D2D82CA8F528A6EE360E210AADABD",
    "environmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "eventStreamEndpoint": "https://southcentralus.azurecontainerapps.dev/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/containerApps/test-dev1/eventstream",
    "latestRevisionFqdn": "test-dev1--attttttj.some.dns.name",
    "latestRevisionName": "test-dev1--attttttj",
    "managedEnvironmentId": "/subscriptions/eca838e7-b0ae-43c8-aa24-3ca9d0bacbdc/resourceGroups/MYRG-rg/providers/Microsoft.App/managedEnvironments/scus-MYenv-containerapps-environmnet",
    "outboundIpAddresses": [
      "20.225.116.71"
    ],
    "provisioningState": "Succeeded",
    "template": {
      "containers": [
        {
          "env": [
            {
              "name": "Backend__Url",
              "value": "url5"
            },
            {
              "name": "Backend__Username",
              "value": "user3"
            },
            {
              "name": "Backend__Password",
              "secretRef": "Backend-password-3",
              "value": ""
            },
            {
              "name": "neww",
              "value": "test3"
            },
            {
              "name": "newrev2",
              "value": "test3"
            },
            {
              "name": "test3",
              "value": "test5"
            },
            {
              "name": "fairgame",
              "value": "test5"
            },
            {
              "name": "onemore",
              "value": "tes5"
            },
            {
              "name": "test",
              "value": "test-dev1--atrynewk"
            },
            {
              "name": "lab",
              "value": "lab"
            }
          ],
          "image": "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest",
          "name": "simple-hello-world-container",
          "probes": [],
          "resources": {
            "cpu": 0.25,
            "ephemeralStorage": "1Gi",
            "memory": "0.5Gi"
          }
        }
      ],
      "initContainers": null,
      "revisionSuffix": "attttttj",
      "scale": {
        "maxReplicas": 10,
        "minReplicas": 0,
        "rules": null
      },
      "volumes": null
    },
    "workloadProfileType": null
  },
  "resourceGroup": "MYRG-rg",
  "systemData": {
    "createdAt": "2023-01-26T06:38:29.8574052",
    "createdBy": "[email protected]",
    "createdByType": "User",
    "lastModifiedAt": "2023-01-31T07:40:32.1373201",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByType": "User"
  },
  "type": "Microsoft.App/containerApps"
}
+ echo 'Deactivating old test-dev1--qr8x10j revision'
Deactivating old test-dev1--qr8x10j revision
+ az containerapp revision deactivate --revision test-dev1--qr8x10j -n test-dev1 -g MYRG-rg
"Deactivate succeeded"
+ echo 'Activating new test-dev1--attttttj revision'
Activating new test-dev1--attttttj revision
+ az containerapp revision activate --revision test-dev1--attttttj -n test-dev1 -g MYRG-rg
"Activate succeeded"
+ (( i++ ))
+ (( i < 4 ))
+ echo 'Will split traffic: test-dev1--attttttj=10 test-dev1--atttttt4=33 test-dev1--atttttt3=33 test-dev1--atttttt2=24     '
Will split traffic: test-dev1--attttttj=10 test-dev1--atttttt4=33 test-dev1--atttttt3=33 test-dev1--atttttt2=24
+ az containerapp ingress traffic set -n test-dev1 -g MYRG-rg --revision-weight test-dev1--attttttj=10 test-dev1--atttttt4=33 test-dev1--atttttt3=33 test-dev1--atttttt2=24

/ Running ..
| Running ..
\ Running ..
[K[
  {
    "revisionName": "test-dev1--qr8x10j",
    "weight": 0
  },
  {
    "revisionName": "test-dev1--allll4",
    "weight": 0
  },
  {
    "revisionName": "test-dev1--allll3",
    "weight": 0
  },
  {
    "revisionName": "test-dev1--allll2",
    "weight": 0
  },
  {
    "revisionName": "test-dev1--attttttj",
    "weight": 10
  },
  {
    "revisionName": "test-dev1--atttttt4",
    "weight": 33
  },
  {
    "revisionName": "test-dev1--atttttt3",
    "weight": 33
  },
  {
    "revisionName": "test-dev1--atttttt2",
    "weight": 24
  }
]

tomaxsas avatar Jan 31 '23 07:01 tomaxsas

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @calvinsID.

Issue Details

This is autogenerated. Please review and update as needed.

Describe the bug

Trying to create new revisions based on old revisions. Even when --from-revison parameter is passed, all container env variables are taken from latest revision, same as just using containerapp update command.

Command Name az containerapp revision copy Extension Name: containerapp. Version: 0.3.20.

Errors:


To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az containerapp revision copy -o {} --from-revision {} -n {} -g {} --set-env-vars {} --revision-suffix {}

Expected Behavior

environemnt variables are taken from revision which is specified via --from-revision option

Environment Summary

Linux-5.15.79.1-microsoft-standard-WSL2-x86_64-with-glibc2.34, CentOS Stream 9
Python 3.9.16
Installer: RPM

azure-cli 2.44.1

Extensions:
containerapp 0.3.20

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

Author: tomaxsas
Assignees: -
Labels:

question, customer-reported, Service Attention, needs-team-attention, Auto-Assign, ContainerApp

Milestone: -

ghost avatar Feb 03 '23 03:02 ghost

@tomaxsas Forwarding this to service team for further troubleshooting.

RakeshMohanMSFT avatar Feb 03 '23 03:02 RakeshMohanMSFT

Is there any update on this issue? I am experiencing a similar issue.

milesmcc avatar Aug 26 '24 02:08 milesmcc

I've been getting this issue too on my past two blue-green prod deploys.

Runner: https://github.com/actions/runner-images/blob/ubuntu24/20251030.96/images/ubuntu/Ubuntu2404-Readme.md

Script snippet:

echo "Current blue revision: '$BLUE_REVISION'"

# Copy from the blue revision to create the green revision
GREEN_REVISION=$(az containerapp revision copy --name "$ACA" \
  --resource-group "$RESOURCE_GROUP"  --from-revision "$BLUE_REVISION" \
  --revision-suffix "$REVISION_SUFFIX"   --image "$ACR/api:green" \
  --output tsv --query properties.latestRevisionName)

echo "Green revision created: $GREEN_REVISION"

# Label the new revision as green
az containerapp revision label add --name "$ACA" \
  --resource-group "$RESOURCE_GROUP"  --label green --revision "$GREEN_REVISION" \
  --no-prompt --yes

# Set traffic distribution
echo "Setting traffic distribution (90% blue, 10% green)"
az containerapp ingress traffic set --name "$ACA" \
  --resource-group "$RESOURCE_GROUP"   --label-weight blue=90 green=10

echo "Verifying env vars on new revision..."
az containerapp revision show \
  --name "$ACA"   --resource-group "$RESOURCE_GROUP" \
  --revision "$GREEN_REVISION" \
  --query "properties.template.containers[0].env" -o table

Log snippet:

Found blue or initial traffic label on revision: ***--0000021
Current blue revision: '***--0000021'

Green revision created: ***--r19133034986-a5d1000

[
  {    "label": "blue",  "revisionName": "***--0000021",  "weight": 100  },
  {  "label": "pr-301",   "revisionName": "***--0000027",   "weight": 0  },
  {  "label": "pr-305",  "revisionName": "***--0000028",   "weight": 0  },
  {  "label": "pr-308", "revisionName": "***--0000030",   "weight": 0 },
  {  "label": "pr-300",   "revisionName": "***--0000031",   "weight": 0  },
  { "label": "green",   "revisionName": "***--r19133034986-a5d1000",    "weight": 0  }
]
Setting traffic distribution (90% blue, 10% green)

[
  {    "label": "blue",  "revisionName": "***--0000021",  "weight": 90 },
  {  "label": "pr-301",   "revisionName": "***--0000027",   "weight": 0  },
  {  "label": "pr-305",  "revisionName": "***--0000028",   "weight": 0  },
  {  "label": "pr-308", "revisionName": "***--0000030",   "weight": 0 },
  {  "label": "pr-300",   "revisionName": "***--0000031",   "weight": 0  },
  { "label": "green",   "revisionName": "***--r19133034986-a5d1000",    "weight": 10 }
  }
]
Verifying env vars on new revision...
Name                                                     SecretRef                                 Value
-------------------------------------------------------  ----------------------------------------  ------------------------------------
SqlConnectionString                                      azure-sql-connection-string-pr-300

As you can see in the last it's showing one of the secrets generated for the revision labels pr-300. The blue revision doesn't have this appended

Image

stephlocke avatar Nov 06 '25 12:11 stephlocke