powershell - 重新启动使用 Appveyor 部署的 Azure Web 应用程序 (aspnet5 rc1-final)

标签 powershell azure azure-web-app-service appveyor

我正在使用 Appveyor 通过 Web 部署将我的 aspnet5(rc1-final)站点部署到 Azure Web 应用程序(站点)。部署步骤工作正常,但我需要使用 Azure 门户手动重新启动站点,这非常烦人。

我读到的是网络应用程序不会自动重新启动?

我尝试使用 powershell 重新启动网站,但似乎不起作用,或者我做错了什么?

这是我使用atm的powershell脚本。

after_deploy:
 - ps: Disable-AzureDataCollection
 - ps: Select-AzureSubscription -Current -SubscriptionName "Visual Studio Premium with MSDN"
 - ps: Restart-AzureWebsite -Name "sitename"

我尝试仅使用 - ps: Restart-AzureWebsite -Name "sitename" 但 Azure 提示订阅名称,所以我添加了该名称。 我正在将 Visual Studio Premium 与 MSDN 一起使用,很明显它不能用作订阅名称?

Select-AzureSubscription : The subscription name Visual Studio Premium with MSDN doesn't exist.

是否可以使用 powershell 重新启动站点,或者这是一个死胡同?

最佳答案

您正在使用旧的 PowerShell CmdLets。请install最新的,目前是 1.0.1。

在最新版本中,您要运行的 CmdLet 是:

Restart-AzureRmWebApp YourResourceGroup YourWebApp

对于 CI 服务器的身份验证,建议的方法是使用服务主体。请参阅this post了解详情。

关于powershell - 重新启动使用 Appveyor 部署的 Azure Web 应用程序 (aspnet5 rc1-final),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34264018/

相关文章:

powershell - Powershell 中的测试路径行为

c# - 使用自定义模型通过 C# 中的 Forms Recognizer V3 nuget 从表中提取数据

azure - Microsoft Graph Explorer 为用户返回空的商务电话

Azure 云服务和 Amazon Cloudfront 互操作性

r - Shiny 的 Azure WebApp 作为 Azure SQL Server 的用户进行身份验证

asp.net-mvc - 托管 azure MVC 应用程序时,我的 web.config 的 appSettings 集合为空

azure - 如何识别两个不同的应用服务

powershell - Powershell-从Domain.com/OU/GivenName姓氏中删除Domain.com/OU/

powershell - Powershell v .bat Call在Soundplayer上有区别吗?

powershell - 如何在PowerShell中将环境变量打印到控制台?