0

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 ?

Sam
  • 13,934
  • 26
  • 108
  • 194

1 Answers1

2

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

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • i didn't know about this `--debug` command, very useful indeed. Unfortunately it gives me the same error. One thing I noticed is that in the resource explorer if I browse to the resource group, there is no Microsoft.Weg/sites node. Should this be created before I can create a webapp ? If so, how do I do it ? – Sam Jul 21 '20 at 15:44
  • hum.... sorry you are right, I've changed the name of the webapp and now it works indeed. But the error message was the same, even with --debug. Problem solved, thanks – Sam Jul 21 '20 at 15:46
  • 1
    right, but you need to look at the whole debug output, not just the error message ;) in there it would say something like: `name already taken` and then what would happen - it would attempt to update it (thinking it exists) – 4c74356b41 Jul 21 '20 at 16:03
  • 1
    indeed, found the message saying the name already exists :) thanks, that was very useful info. – Sam Jul 21 '20 at 16:38