【发布时间】:2018-11-08 18:37:57
【问题描述】:
我正在尝试在 Azure 上的应用服务上发布 Web 应用程序包。 为了发布包,我需要创建一个 Powershell 脚本以从 Cloud Shell 运行。 我写了以下代码
Import-AzurePublishSettingsFile - $WebApp.PublishProfilePath
Publish-AzureWebsiteProject -Package $WebApp.ZipPath -Name $WebApp.WebAppName
此代码适用于我的本地计算机,但不适用于我收到以下错误的 Cloud Shell:
Import-AzurePublishSettingsFile : The term 'Import-AzurePublishSettingsFile'
is not recognized as the name of a cmdlet, function, script file, or
operable program.
Publish-AzureWebsiteProject : The term 'Publish-AzureWebsiteProject' is not
recognized as the name of a cmdlet, function, script file, or operable
program.
我猜这些错误是由于这些 cmdlet 来自旧的 Classic Manager,而 Cloud Shell 中不可用。
基本上,我需要使用脚本从 Cloud Shell 发布 Web 应用程序包。我怎样才能做到这一点?我还有其他选择吗?
【问题讨论】:
-
只是好奇,为什么需要使用脚本从 Cloud Shell 发布 Web App 包?
-
我知道这看起来很奇怪,但就我而言,我无法设置持续部署流程,而且我不是负责发布 Web 应用程序的人。由于我想避免由于外部因素(例如缺少模块、缺少运行脚本的权限...)而导致的任何类型的问题,我决定创建一个可以由另一个人在我测试脚本的同一环境中执行的脚本.
标签: azure powershell azure-web-app-service azure-resource-manager azure-cloud-shell