Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

az containerapp up fails to create resource group when the containerapp extension is present. #28800

Open JimacoMS4 opened 4 months ago

JimacoMS4 commented 4 months ago

Describe the bug

If a resource group is specified in an az containerapp up command, but does not exist, the command creates it if the containerapp extension is not installed. If the extension is installed, the command fails:

az containerapp up --resource-group my-fastapi-aca-rg --name my-aca-app
--ingress external --target-port 3100 --location eastus --source .
The behavior of this command has been altered by the following extension: containerapp
(ResourceGroupNotFound) Resource group 'my-fastapi-aca-rg' could not be found.

It seems like the command should behave the same regardless of whether the extension is present or not.

Related command

az extension add -n containerapp

Errors

The behavior of this command has been altered by the following extension: containerapp (ResourceGroupNotFound) Resource group 'my-fastapi-aca-rg' could not be found.

Issue script & Debug output

The command didn't create the resource group. (Debug output is too long to attach >65k characters.)

az containerapp up --resource-group my-fastapi-aca-rg --name my-aca-app --ingress external --target-port 3100 --location eastus --source .

Expected behavior

The command creates the resource group.

Environment Summary

azure-cli 2.59.0

core 2.59.0 telemetry 1.1.0

Extensions: containerapp 0.3.50 rdbms-connect 1.0.5 serviceconnector-passwordless 1.0.3

Dependencies: msal 1.27.0 azure-mgmt-resource 23.1.0b2

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

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

Environment output is from Windows command shell, but got the same behavior in CloudShell Bash environment.

To quickly reproduce this behavior you can follow the steps in this topic: https://learn.microsoft.com/en-us/azure/developer/python/tutorial-containerize-simple-web-app?tabs=web-app-fastapi. (You can skip the local build steps.)

yonzhan commented 4 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 4 months ago

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

microsoft-github-policy-service[bot] commented 4 months ago

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

Greedygre commented 4 months ago

Hi @JimacoMS4

Thanks for reporting this issue. I will take a look for it.