0
votes

I just started learning Azure by following Pluralsight course. I'm following Author's video and doing the same in my system.

To create App service, used the following command.

>az webapp create -p MahaAppServicePlan -g MAHAResourceGroup -n datingapp -l

I have already created MahaAppServicePlan app service plan, and MAHAResourceGroup resource group. Now, I am trying to create datingapp webapp. Hence, issued the command like above. But, I am getting below error.

ResourceNotFound - The Resource 'Microsoft.Web/sites/datingapp' under resource group 'MAHAResourceGroup' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

I followed the above link with the hope that some suggestion could be helpful to me, but no luck.

When googled, I've got some resources, but with my existing knowledge, I am unable to tune it to my requirement. Can anyone please suggest me how to fix the above error!

1
Hi! Try adding --debug to the command and read the logs info to get what its your problem. I see something like the name was not available. - Nacho Martínez-Aedo
Hi @Nacho, Thank you for your suggestion. Even after using --debug also, I got the same error, but unable to understand how to fix this error with my existing knowledge (as of now, I don't know anything about Azure). One thing I want to let you know: from the below command ---- >az webapp create -p MahaAppServicePlan -g MAHAResourceGroup -n datingapp -l ---- datingapp is my angular app with database as Sqlite. Can I use angular app to create webapp resource? By seeing the error, it looks like the error is NOT due to that I have used Angular app. But, I want your suggestion. - Ashok kumar
Yeah you can create a Webapp for an angular APP. - Nacho Martínez-Aedo
Like @NachoMartínez-Aedo said its the name that is the issue, it needs to be globally unique. - Daniel Björk

1 Answers

1
votes

I'm not use to work with powershell but I have recreated your problem and I get this: enter image description here If you explore the log info you will see something like this: enter image description here I confirm that the error its that the app Name it's invalid, I have manually created the app service and see this: enter image description here

I can see in this last image that the Runtime its mandatory which in the documentation does not say(https://docs.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-create). But if you add the -r "your choose runtime" you will execute the command with succed:

az webapp create -g MAHAResourceGroup -p MahaAppServicePlan -n webappteststackoverflow -r "DOTNETCORE|3.1"

enter image description here

You can see the available runtimes with this command:

az webapp list-runtimes