简体   繁体   English

尝试使用 CLI 创建 web 应用时出错

[英]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 applicationsAzure 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 应用程序注册中可用。

  • 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.如果不使用另一个名称创建 web 应用程序。

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.

相关问题 尝试使用 Azure CLI 创建 web 应用程序时出现限制错误 - Throttling error when trying to create web app using Azure CLI az cli create webapp 失败并出现 ResourceNotFound 错误 - az cli create webapp fails with ResourceNotFound error 使用 Azure cli 部署 webapp 时出错 - Error deploying using Azure cli to deploy webapp az cli 2.0 ... az webapp 创建运行时 php|7.1 错误 - az cli 2.0 … az webapp create runtime php|7.1 error 尝试通过 az cli 创建 azure nic 接口时引发错误,v # invalid expression - Raise error, v # invalid expression when trying to create azure nic interface via az cli 无法使用 Azure Cli az webapp config backup create 备份功能/Web 应用程序 - Unable to backup Function/Web App using Azure Cli az webapp config backup create 尝试通过 cli 命令启动虚拟机备份时显示错误 - Showing error when trying to start backup of vms through cli commands Azure WebApp 在尝试通过 xyz.azurewebsites.net 访问时抛出 502 页面错误 - Azure WebApp throws 502 page error when trying to access over xyz.azurewebsites.net 尝试使用 powershell 获取 azure webapp 状态 - Trying to obtain azure webapp status using powershell 使用Azure CLI将SSL证书从KeyVault绑定到WebApp - Bind SSL Certificate from KeyVault to webapp using Azure CLI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM