Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

az webapp config container set "unrecognized arguments: --container-image-name" #28862

Open pmierzwa opened 7 months ago

pmierzwa commented 7 months ago

Describe the bug

When using the az webapp config container set container command, I should according to the documentation switch from using the optional parameter --docker-custom-image-name, and instead use --container-image-name as the prior is depricated.

Related command

az webapp config container set --name webappName --resource-group rg-xxxx-tst-01 --container-image-name xxxx.azurecr.io/repo:tag does not work, but the following does:

Errors

unrecognized arguments: --container-image-name xxxx.azurecr.io/repo:tag

Examples from AI knowledge base:
az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --name MyWebApp --resource-group MyResourceGroup
Set a web app container's settings. (autogenerated)

az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-password StrongPassword --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --docker-registry-server-user DockerUserId --name MyWebApp --resource-group MyResourceGroup
Set a web app container's settings. (autogenerated)

https://docs.microsoft.com/en-US/cli/azure/webapp/config/container#az_webapp_config_container_set
Read more about the command in reference docs

Issue script & Debug output

cli.knack.cli: Command arguments: ['webapp', 'config', 'container', 'set', '--name', 'webappName ', '--resource-group', 'rg-xxxx-tst-01', '-container-image-name', 'xxxx.azurecr.io/repo:tag', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fc2949c00e0>, <function OutputProducer.on_global_arguments at 0x7fc29496a200>, <function CLIQuery.on_global_arguments at 0x7fc29499fce0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'webapp': ['azure.cli.command_modules.appservice', 'azure.cli.command_modules.serviceconnector']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: appservice                0.212        73       260
cli.azure.cli.core: serviceconnector          0.036        16       244
cli.azure.cli.core: Total (2)                 0.249        89       504
cli.azure.cli.core: Loaded 87 groups, 504 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : webapp config container set
cli.azure.cli.core: Command table: webapp config container set
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fc29385dc60>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vscode/.azure/commands/2024-05-01.06-19-15.webapp_config_container_set.3909112.log'.
az_command_data_logger: command args: webapp config container set --name {} --resource-group {} -c{} {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7fc2938a6d40>]
cli.knack.commands: Configured default 'rg-xxxx-dev-01' for arg resource_group_name
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7fc2938c5f80>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7fc2938c60c0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22webapp+config+container+set%22%2C+%22parameters%22%3A+%22%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.58.0%22%2C+%22errorType%22%3A+%22UnrecognizedArguments%22%2C+%22correlationId%22%3A+%22xxxxxxxxxxxx%22%2C+%22subscriptionId%22%3A+%xxxxxxxxxxxx%22%2C+%22eventId%22%3A+%22xxxxxxxxxxxxxxx%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: unrecognized arguments: xxxx.azurecr.io/repo:tag
az_command_data_logger: unrecognized arguments: xxxx.azurecr.io/repo:tag

Examples from AI knowledge base:
az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --name MyWebApp --resource-group MyResourceGroup
Set a web app container's settings. (autogenerated)

az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-password StrongPassword --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --docker-registry-server-user DockerUserId --name MyWebApp --resource-group MyResourceGroup
Set a web app container's settings. (autogenerated)

https://docs.microsoft.com/en-US/cli/azure/webapp/config/container#az_webapp_config_container_set
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fc29385dee0>]
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 1.298 seconds (init: 0.253, invoke: 1.045)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4291 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /home/vscode/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

I expect the command to function the way --docker-custom-image-name functioned. It should set the "image" and "tag" in the deployment center in the azure portal on my webapp.

Environment Summary

azure-cli                         2.58.0 *

core                              2.58.0 *
telemetry                          1.1.0

Dependencies:
msal                              1.26.0
azure-mgmt-resource             23.1.0b2

Python location '/opt/az/bin/python3'
Extensions directory '/home/vscode/.azure/cliextensions'

Python (Linux) 3.11.7 (main, Feb 29 2024, 02:09:26) [GCC 12.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

Notice the command works when using the short hand notations -c and -i.

I am referring to the following documentation: https://learn.microsoft.com/en-us/cli/azure/webapp/config/container?view=azure-cli-latest#az-webapp-config-container-set

azure-client-tools-bot-prd[bot] commented 7 months ago

Hi @pmierzwa,

2.58.0 is not the latest Azure CLI(2.60.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 7 months ago

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

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

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

pmierzwa commented 7 months ago

Issue still persists after updating from 2.58 to 2.60