我正在尝试在 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 来自旧的经典管理器,而后者在 Cloud Shell 中不可用。
基本上我需要使用脚本从 Cloud Shell发布一个 Web App 包。我怎样才能做到这一点?我还有其他选择吗?