从 Visual Studio 发布 Microsoft Azure

问题描述 投票:0回答:1

我正在尝试将应用程序(机器人)从 Visual Studio 部署到 Azure 云服务(经典)。我选择了订阅和云服务。然后,该过程提示我创建存储帐户,但我现有的存储帐户未显示在列表中。当我尝试创建新的存储帐户时,出现以下错误,如屏幕截图所示。

仅供参考,我正在尝试从here部署机器人。我已经尝试了存储库中的多个示例,但得到了相同的结果。

azure visual-studio azure-cloud-services azure-storage-account
1个回答
0
投票

错误的原因是您在新门户中创建的存储帐户很可能位于资源管理器部署模型下,但您使用的云服务经典仍处于经典部署模型下.

我在我的环境中尝试时遇到了同样的错误。

  • 要解决此问题,您需要在
    Portal=>Storage account(classic)
    中创建经典存储帐户:

enter image description here

或者您可以使用命令创建:

New-AzureRmResource -ResourceName "" -ResourceGroupName $resourceGroupName -ResourceType "Microsoft.ClassicStorage/StorageAccounts" -Location "South Central US" -Properties @{ AccountType = "Standard_LRS" } -ApiVersion "2015-06-01" -Force

enter image description here

  • 官方 MSDOC 中所述,云服务经典和存储帐户将被完全弃用,建议使用 Azure 资源管理器的云服务扩展支持,它允许使用您现有的存储帐户。请参阅MSDOC

enter image description here

  • 在门户中创建云服务(扩展支持)
  • 创建云服务时配置存储帐户:

enter image description here

  • 在 Visual Studio 中右键单击

    Project=>Publish(extended Support)

  • 使用您的云服务配置部署:

enter image description here

enter image description here

  • 部署成功:

enter image description here

  • 能够运行已部署的应用程序:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.