首页 文章

从Visual Studio Online部署Azure Cloud 服务

提问于
浏览
2

我们是否可以将Azure Cloud Service部署设置为构建过程的一部分,以获得与Visual Studio向导相似的结果?

VS Publish Cloud Service Wizard

UPD. 我们发现"Azure Cloud Service Deployment"构建步骤,但它失败并出现以下意外错误(因为实际设置了存储帐户,请参阅下面的完整日志) .

Build step

CurrentStorageAccountName is not set. Use Set-AzureSubscription
subname -CurrentStorageAccountName storageaccount to set it.

完整日志:

Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\AzureCloudPowerShellDeployment\1.0.13\Publish-AzureCloudDeployment.ps1
Looking for Azure PowerShell module at C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1
AzurePSCmdletsVersion= 0.9.1
Get-ServiceEndpoint -Name ***cut** -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
Username= ***cut**
Add-AzureAccount -Credential $psCredential
azureSubscriptionId= ***cut**
azureSubscriptionName= ***cut**
Select-AzureSubscription -SubscriptionId ***cut**
ConnectedServiceName= ***cut** 
ServiceName= ***cut**
ServiceLocation= East US
StorageAccount= ***cut**
CsPkg= C:\a\c409f63f\***cut**.cspkg
CsCfg= C:\a\c409f63f\***cut**.cscfg
Slot= Production
AllowUpgrade= true
Find-Files -SearchPattern C:\a\c409f63f\***cut**.cscfg
serviceConfigFile= C:\a\c409f63f\***cut**.cscfg
Find-Files -SearchPattern C:\a\c409f63f\***cut**.cspkg
servicePackageFile= C:\a\c409f63f\***cut**.cspkg
Get-AzureService -ServiceName ***cut** -ErrorAction SilentlyContinue
Applying any configured diagnostics extensions.
New-AzureServiceDiagnosticsExtensionConfig -Role ***cut** -StorageContext  -DiagnosticsConfigurationPath C:\a\c409f63f\***cut**.xml
New-AzureServiceDiagnosticsExtensionConfig -Role ***cut** -StorageContext  -DiagnosticsConfigurationPath C:\a\c409f63f\***cut**.xml
Get-AzureDeployment -ServiceName crgd-scheduler -Slot Production -ErrorAction SilentlyContinue
Set-AzureDeployment -Upgrade -ServiceName ***cut** -Package C:\a\c409f63f\***cut**.cspkg -Configuration C:\a\c409f63f\***cut**.cscfg -Slot Production -ExtensionConfiguration 
CurrentStorageAccountName is not set. Use Set-AzureSubscription subname -CurrentStorageAccountName storageaccount to set it.

2 回答

  • 0

    我们最终成功完成了"Azure PowerShell"泛型构建步骤和使用Azure API创建/更新Azure部署的自定义PS脚本( New-AzureDeploymentSet-AzureDeployment ) .

    vso build step

    包含完整脚本的精彩文章在这里:http://www.kenneth-truyers.net/2014/02/06/deploying-cloud-services-to-azure-with-powershell/ .

  • 1

    在尝试任何命令之前,您需要设置并登录订阅 .

    我通常将它作为我的PowerShell的一部分,如果你搜索一下,你可以找到如何加密你的凭据,使其不在脚本中 .

相关问题