简体   繁体   中英

Error when trying to create a webapp using CLI

I have no experience in coding, just started now.

I am trying to create a webapp using the Azure Cloud Shell, so I used the following command:

az webapp create --name WebAppOne --resource-group learn-64c4ca17-0293-40f6-ba23-e4581751cca0 --plan ServicePlanTest

Then I get the message:

Webapp 'WebAppOne' already exists. The command will use the existing app's settings. Unable to retrieve details of the existing app 'WebAppOne'. Please check that the app is a part of the current subscription

I only have one subscription in Azure as I am still using a free account for learning purposes.

So, I decided to get a list showing the webapps that exist by using the command:

az webapp list --output table

However, the only outcome is a blank line, showing no web apps already existing. What should I try next?

To create a web app in Azure App service, you must have a resource group and App service plan in your subscription.

To check the existing App services in your subscription

az webapp list --resource-group MyRGName

Output: 在此处输入图像描述

As you can see, currently I don't have any webapps created in the given Resource group

Run the below command to create an Azure Web App

az webapp create --name MyWebApp --resource-group MyRGName --plan MyAppServicePlan

Though I don't have any Webapps with the given name, I got the same error.

在此处输入图像描述

In Azure Portal => Azure Active Directory => App registrations => All applications

In search box, searched with the web app name. I can see the web app with same name is already created.

在此处输入图像描述

Reason for the error

You might have created a web app with same name long ago, but the resource got deleted from the resource group. But still, it is available in the Azure Active Directory App registrations.

  • If it is created by you and you don't want to use anymore, you can delete it. If not create web app with another name.

Tried to create web app with another name.

Create Azure App Service:在此处输入图像描述

Now I can see the created Web App List.

List of Azure Web Apps 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM