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

azure cli command az webapp create not idempotent any more??

Open jerryxu1234 opened this issue 2 years ago • 6 comments

Describe the bug

Hi, When running this command in a azure devop pipeline (hosted by microsoft), it always fail at the second run. If I delete the web app and run the command, it will succeed. But second run will fail again. The command is:

$output = az webapp create -g ThunderEuwUat -p 'ASP-Thunder-DataLookup-ProductserviceEuwPreP' -n 'ThunderDataApiV2-ThunderEuwUat1' --runtime ''dotnet:7'' --assign-identity [system] --tags 'Business Criticality=yes' 'Data Classification=United Kingdom' 'Family=Core' 'Product=Thunder' 'Owner=Savvas' 'Environment=PreProd' 'Location=westeurope' 'Data Sovereignty=Proprietary' 'Data Transfer Restrictions=Global UK' if (!$?){Throw}

Related command

az webapp create

Errors

2024-06-03T13:56:01.2805576Z WARNING: Webapp 'ThunderDataApiV2-ThunderEuwUat1' already exists. The command will use the existing app's settings. 2024-06-03T13:56:08.6266647Z ERROR: Unable to retrieve details of the existing app 'ThunderDataApiV2-ThunderEuwUat1'. Please check that the app is a part of the current subscription

Issue script & Debug output

2024-06-11T10:23:38.2768966Z Downloading task: AzureCLI (2.239.4) 2024-06-11T10:23:39.0898640Z ##[debug]Task 'AzureCLI' has been downloaded into '024-06-11T10:26:00.6194296Z ##[debug]Agent environment resources - Disk: D:\ Available 12281.00 MB out of 14333.00 MB, Memory: Used 1955.00 MB out of 7167.00 MB, CPU: Usage 2.70% 2024-06-11T10:26:01.5150228Z ERROR: Unable to retrieve details of the existing app 'ThunderDataApiV2-ThunderEuwUat'. Please check that the app is a part of the current subscription 2024-06-11T10:26:02.7868521Z ScriptHalted

Expected behavior

command should succeed even if the site has been created before.

Environment Summary

task: AzureCLI (2.239.4)

Additional context

No response

jerryxu1234 avatar Jul 02 '24 08:07 jerryxu1234

API change check

API changes are not detected in this pull request.

azure-sdk avatar Jun 28 '24 21:06 azure-sdk

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

yonzhan avatar Jul 02 '24 08:07 yonzhan

hi, any update?

jerryxu1234 avatar Jul 05 '24 13:07 jerryxu1234

hi, any update?

jerryxu1234 avatar Jul 15 '24 20:07 jerryxu1234

Also running into this issue

brianmgray avatar Jul 17 '24 17:07 brianmgray

Unable to repro. Can you please share what changes you are making when you try to run the command a second time? We haven't made any changes that would change whether or not this command was idempotent. I just ran the same create command twice and both succeeded. Please update to the latest CLI version and let us know if this is still an issue.

seligj95 avatar Feb 03 '25 21:02 seligj95

Closing for now due to no response. Please comment if the issue still persists and we can re-open and investigate further.

seligj95 avatar Feb 06 '25 15:02 seligj95