[英]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:我正在尝试使用 Azure Cloud Shell 创建一个 webapp,所以我使用了以下命令:
az webapp create --name WebAppOne --resource-group learn-64c4ca17-0293-40f6-ba23-e4581751cca0 --plan ServicePlanTest az webapp create --name WebAppOne --resource-group learn-64c4ca17-0293-40f6-ba23-e4581751cca0 --plan ServicePlanTest
Then I get the message:然后我收到消息:
Webapp 'WebAppOne' already exists. Webapp 'WebAppOne' 已经存在。 The command will use the existing app's settings.
该命令将使用现有应用程序的设置。 Unable to retrieve details of the existing app 'WebAppOne'.
无法检索现有应用程序“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.我在 Azure 中只有一个订阅,因为我仍在使用免费帐户进行学习。
So, I decided to get a list showing the webapps that exist by using the command:因此,我决定使用以下命令获取一个显示存在的 webapps 的列表:
az webapp list --output table az webapp list --输出表
However, the only outcome is a blank line, showing no web apps already existing.但是,唯一的结果是一个空行,显示没有 web 应用程序已经存在。 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.要在 Azure 应用服务中创建 web 应用,您的订阅中必须有资源组和应用服务计划。
To check the existing App services in your subscription检查订阅中现有的应用服务
az webapp list --resource-group MyRGName
Output: Output:
As you can see, currently I don't have any webapps created in the given Resource group如您所见,目前我没有在给定的资源组中创建任何 webapps
Run the below command to create an Azure Web App运行以下命令创建 Azure Web 应用程序
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.虽然我没有任何具有给定名称的 Web 应用程序,但我得到了同样的错误。
In Azure Portal
=> Azure Active Directory
=> App registrations
=> All applications
在
Azure Portal
=> Azure Active Directory
=> App registrations
=> All applications
In search box, searched with the web app name.在搜索框中,使用 web 应用名称进行搜索。 I can see the web app with same name is already created.
我可以看到已经创建了同名的 web 应用程序。
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.您可能很久以前就创建了同名的 web 应用程序,但该资源已从资源组中删除。 But still, it is available in the Azure Active Directory App registrations.
但是,它仍然在 Azure Active Directory 应用程序注册中可用。
Tried to create web app with another name.尝试使用另一个名称创建 web 应用程序。
Create Azure App Service:创建 Azure 应用服务:
Now I can see the created Web App List.现在我可以看到创建的 Web 应用列表。
List of Azure Web Apps Azure Web 应用程序列表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.