使用PowerShell错误部署Azure应用服务(Web App)

时间:2016-04-15 13:26:27

标签: powershell azure deployment

我们在Azure中有一个App Service(Web App),有3个部署插槽。

我目前正在powershell中构建一个部署脚本,以便在我们的Team City构建服务器上使用,以部署到我们的临时环境,但我遇到了一个问题。

当我运行New-AzureDeployment命令时,出现以下错误:

New-AzureDeployment : ResourceNotFound: The hosted service does not exist.
OperationID : 'c50c73c0f8219d47adb1e579065b267a'
At C:\sourcecode\econ-appstore\scripts\azure-deployment.ps1:70 char:15
+     $opstat = New-AzureDeployment -Slot $slot -Package $packageLocation -Configu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureDeployment], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.NewAzureDeploymentCommand

我之前运行以下命令:

Import-AzurePublishSettingsFile $pubsettings
Set-AzureSubscription -CurrentStorageAccountName $storageAccountName -SubscriptionName $selectedsubscription
Select-AzureSubscription $selectedsubscription

所以我查看了azure的管理休息api,特别是https://management.core.windows.net/ $ subscriptionId / services / hostedservices端点,我什么也得不到。所以我似乎没有托管服务。

要使我的应用服务成为托管服务,我该怎么办?我找不到任何关于此的信息或指南。

非常感谢帮助。

- 编辑---

Thx to Alexandr我找到了以下命令:Publish-AzureWebsiteProject

这将为您部署项目。您需要更改msbuild脚本以将您的Web部署包输出为zip文件,但就是这样。

请求帮助!

1 个答案:

答案 0 :(得分:0)

That commandlet creates the service based on the cloud service model. Is that what you want? You mentioned Web App - maybe New-AzureWebSite commandlet is what you want? The error is connected with the Cloud Service - create it using the portal or the commandlet.

相关问题