Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az containerapp update is not setting minreplicas to 0 #5391

Open
charris-msft opened this issue Sep 27, 2022 · 9 comments
Open

az containerapp update is not setting minreplicas to 0 #5391

charris-msft opened this issue Sep 27, 2022 · 9 comments
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. ContainerApp Service Attention This issue is responsible by Azure service team.

Comments

@charris-msft
Copy link

charris-msft commented Sep 27, 2022

  • If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli

Related command

containerapp update

Extension name (the extension in question)

containerapp

Description of issue (in as much detail as possible)

I originally created a containerapp with a yaml file that specified minReplicas: 0

Now, I want to update minReplicas to 0 so I updated the yaml file like this:

    scale:
      minReplicas: 0
      maxReplicas: 1

and ran

az container app update ... --yaml updated.yaml

However, in the output from the command and in the portal, the minReplicas is still set to 0.

Then, I tried the following:

az containerapp update ... --min-replicas 0

The command completed successfully, but minReplicas did not get updated.

Final try - I updated minReplicas via a Revision in the Portal and that finally worked.


@ghost ghost added Auto-Assign Auto assign by bot ContainerApp CXP Attention This issue is handled by CXP team. labels Sep 27, 2022
@charris-msft charris-msft changed the title az containerapp update --yaml is not setting minreplicas to 0 az containerapp update is not setting minreplicas to 0 Sep 27, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 27, 2022

route to CXP team

@panchagnula
Copy link
Contributor

@charris-msft thanks for reporting, we will investigate further. However, wanted to get a clarification, if this behavior is specific to yaml from CLI command. Does this work with ARM template or updating from portal directly?
Thanks. @StrawnSC , @haroonf FYI.

@charris-msft
Copy link
Author

@panchagnula -
I saw the issue with yaml from CLI and with the --min-replicas parameter from CLI (no --yaml specified).
It behaved as expected when I updated in the portal.
I did not try with an ARM template.

@panchagnula
Copy link
Contributor

@panchagnula -
I saw the issue with yaml from CLI and with the --min-replicas parameter from CLI (no --yaml specified).
It behaved as expected when I updated in the portal.
I did not try with an ARM template.

Gotcha. Could you also provide the CLI version being used (run az --version). CLI updated recently to use the latest api-version, so I am wondering if there is a change here we need to look into. Portal still uses an older api-version. Thanks!

@PramodValavala-MSFT PramodValavala-MSFT added bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. and removed CXP Attention This issue is handled by CXP team. labels Sep 27, 2022
@ghost
Copy link

ghost commented Sep 27, 2022

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

Issue Details
  • If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli

Related command

containerapp update

Extension name (the extension in question)

containerapp

Description of issue (in as much detail as possible)

I originally created a containerapp with a yaml file that specified minReplicas: 0

Now, I want to update minReplicas to 0 so I updated the yaml file like this:

    scale:
      minReplicas: 0
      maxReplicas: 1

and ran

az container app update ... --yaml updated.yaml

However, in the output from the command and in the portal, the minReplicas is still set to 0.

Then, I tried the following:

az containerapp update ... --min-replicas 0

The command completed successfully, but minReplicas did not get updated.

Final try - I updated minReplicas via a Revision in the Portal and that finally worked.


Author: charris-msft
Assignees: -
Labels:

bug, Service Attention, Client, Auto-Assign, ContainerApp

Milestone: -

@charris-msft
Copy link
Author

 >  az --version
azure-cli                         2.40.0

core                              2.40.0
telemetry                          1.0.8

Extensions:
connectedk8s                       1.3.3
containerapp                      0.3.11
customlocation                     0.1.3
k8s-extension                      1.3.4
rdbms-connect                      1.0.3

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\chris\.azure\cliextensions'

Python (Windows) 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 15:58:59) [MSC v.1929 32 bit (Intel)]

@stfnzl
Copy link

stfnzl commented Sep 18, 2023

Had same issue but got around it by providing --max-replicas as well

@jason-berk-k1x
Copy link

jason-berk-k1x commented Nov 27, 2023

is there an updated for this?

I created a new container app with this in my config.yml file:

scale:
    minReplicas: 1
    maxReplicas: 10

I then updated the config like so:

scale:
  minReplicas: 0
  maxReplicas: 50
  rules: [
    {
      name: 'event-driven',
      custom: {
        type: 'azure-servicebus',
        metadata: {
          queueName: 'my-queue-name',
          messageCount: '1'
        },
        auth: [
          {
            secretRef: 'service-bus-conn',
            triggerParameter: 'connection'
          }
        ]
      }
    }
  ]

ran the deploy and minReplicas is still 1, but the scaling part all worked as expected

Screenshot 2023-11-27 at 11 09 32 AM

also, if I try to use the CLI flags along with the yml config, I get this:

WARNING: Additional flags were passed along with --yaml. These flags will be ignored, and the configuration defined in the yaml will be used instead

EDIT: I can confirm that when using the --yaml flag, the minReplicas value is ignored.

so, since the app was created with default scaling rules (ie: 1 and 10 for min / max), I have to do two update commands to update the image for the new revision AND update the scaling min/max:

# update the app using the values in the yaml config that actually work......
az containerapp update -n my-app-name -g my-app-rg --yaml ${{ variables.configFile }}
# update the replica counts that DO NOT WORK as described by this issue
az containerapp update -n my-app-name -g my-app-rg --min-replicas 0 --max-replicas 20

@Greedygre
Copy link
Contributor

Greedygre commented Nov 30, 2023

This issue about az containerapp update --min-replicas 0 not work has been fixed and released in version 0.3.46 of containerapp extension.
You can update the extension with command, thanks!

az extension add -n containerapp --upgrade

About setting minReplicas to 0 in --yaml not work, the fix be released in azure-cli 2.57.0 in February.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. ContainerApp Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants