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

Broken idempotency for az webapp config access-restriction add --service-tag #8271

Open
gabbsmo opened this issue Nov 13, 2024 · 1 comment
Labels
App Services Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. extension/webapp Service Attention This issue is responsible by Azure service team. Web Apps

Comments

@gabbsmo
Copy link

gabbsmo commented Nov 13, 2024

Describe the bug

When running a command for adding a app service restriction for a service tag twice, there will be an error.

Related command

az webapp config access-restriction add -g ResourceGroup -n AppServiceName --priority 100 --scm-site --service-tag AzureCloud

Errors

Service Tag: AzureCloud already exists. Cannot add duplicate Service Tag values.

Issue script & Debug output

DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 654, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/invocation.py", line 113, in _validation
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 921, in _validate_arg_level
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/_validators.py", line 334, in validate_service_tag
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/_validators.py", line 375, in _validate_service_tag_existence
azure.cli.core.azclierror.ArgumentUsageError: Service Tag: AzureCloud already exists. Cannot add duplicate Service Tag values.

ERROR: cli.azure.cli.core.azclierror: Service Tag: AzureCloud already exists. Cannot add duplicate Service Tag values.
ERROR: az_command_data_logger: Service Tag: AzureCloud already exists. Cannot add duplicate Service Tag values.
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000001E020259BC0>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.main: Command ran in 8.079 seconds (init: 0.410, invoke: 7.669)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.client: Accumulated 0 events. Flush the clients.
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 3917 in cache file under C:\Users\user.azure\telemetry\20241113135510233
INFO: telemetry.main: Begin creating telemetry upload process.
INFO: telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\user.azure C:\Users\user.azure\telemetry\20241113135510233"
INFO: telemetry.process: Return from creating process 9200
INFO: telemetry.main: Finish creating telemetry upload process.

Expected behavior

The command should be idempotent and not generate errors.

Environment Summary

azure-cli 2.66.0

core 2.66.0
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

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

Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@gabbsmo gabbsmo added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 13, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 13, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. App Services Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot extension/webapp Web Apps labels Nov 13, 2024
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Services Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. extension/webapp Service Attention This issue is responsible by Azure service team. Web Apps
Projects
None yet
Development

No branches or pull requests

2 participants