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

Invalid duplicate name error on webapp create

Open brianmgray opened this issue 2 years ago • 3 comments

Describe the bug

Hi folks, I am running the az webapp create command, and getting the error below, but I have checked exhaustively that the name is not used in our entire Azure portal (all subscriptions):

Unable to retrieve details of the existing app 'frontend-staging'. Please check that the app is a part of the current subscription

I came across this issue, so I checked across all our subscriptions. We only have 2 so I switched with az login and used az resource list --query "[?contains(name, 'frontend-')]" -o table - there are no resources with that name. I also tried this: Screenshot 2024-07-18 at 11 11 30 AM

  • I deleted the resource group I am creating this in and recreated it, and I still get the same error.

Related command

az webapp create --name frontend-staging --resource-group fuguux-staging --plan frontend-plan-staging --runtime NODE:18-lts --assign-identity '[system]' --https-only true --public-network-access Enabled --tags stack=staging timestamp=2024-07-18T11:03:23Z -o table

Errors

+ az webapp create --name frontend-staging --resource-group fuguux-staging --plan frontend-plan-staging --runtime NODE:18-lts --assign-identity '[system]' --https-only true --public-network-access Enabled --tags stack=staging timestamp=2024-07-18T11:10:38Z --verbose -o table
Webapp 'frontend-staging' already exists. The command will use the existing app's settings.
Unable to retrieve details of the existing app 'frontend-staging'. Please check that the app is a part of the current subscription

Issue script & Debug output

debug.log

Expected behavior

The webapp should be created - there's no reason the webapp should exist first in order to create it. I have run this same command on other resource groups and it works fine, but for some reason I get this error on this one. This is the RG we use for staging, so now we are concerned this issue will happen on prod as well so we want to understand why this is happening.

Environment Summary

azure-cli 2.62.0

core 2.62.0 telemetry 1.1.0

Extensions: account 0.2.5 application-insights 1.2.1 authV2 0.1.3 containerapp 0.3.53

Dependencies: msal 1.28.1 azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.62.0/libexec/bin/python' Extensions directory '/Users/brian/.azure/cliextensions'

Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

brianmgray avatar Jul 18 '24 15:07 brianmgray

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

yonzhan avatar Jul 18 '24 15:07 yonzhan

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

Ok I believe we figured this out- it seems like the webapp name must be globally unique across all of Azure because it is used as the subdomain for the webapp URL and that subdomain can't be changed. So I changed it to a more unique name. This could definitely be better documented, and improved in the error message. Even reading the issue, I thought "globally unique" meant within our Azure account.

brianmgray avatar Jul 18 '24 20:07 brianmgray