az cli create webapp fails with ResourceNotFound error

571 Views Asked by At

This command fails

az webapp create --resource-group my-rg -n my-app --plan my-plan 

with error

ResourceNotFound - The Resource 'Microsoft.Web/sites/my-app' under resource group 'my-rg' was not found.

To me this doesn't make sense. The very purpose of this command is to create the webapp, so obviously it should not expect it to exist before executing the command. Did I miss somthing ?

1

There are 1 best solutions below

4
4c74356b41 On BEST ANSWER

What I think is happening - the App Service name is already taken and it spits out this silly error, try changing the name to something unique and it will work.

ps. figured it out with a --debug added to the command