2015-06-29 2 views
2

Можем ли мы установить развертывание Azure Cloud Service как часть процесса сборки, чтобы получить аналогичный результат, который дает мастер Visual Studio?Развертывание службы облачного облака из Visual Studio Online

VS Publish Cloud Service Wizard

UPD. Мы обнаружили шаг сборки «Azure Cloud Service», но он не выполнил следующую непредвиденную ошибку (поскольку учетная запись хранилища фактически установлена, см. Полный журнал ниже).

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.

ответ

0

Наше окончательное решение было выполнено с помощью шага «Azure PowerShell» и пользовательского сценария PS, который использует API Azure для создания/обновления развертывания Azure (New-AzureDeployment, Set-AzureDeployment).

vso build step

Большая статья, которая содержит полный сценарий здесь: http://www.kenneth-truyers.net/2014/02/06/deploying-cloud-services-to-azure-with-powershell/.

0

Вам нужно настроить и войти в подписку, прежде чем попробовать любые команды.

Я обычно делаю это частью моей PowerShell, и если вы будете искать вокруг, вы сможете узнать, как зашифровать ваши учетные данные, чтобы не иметь их в скрипте.

+0

Он связан и выбран в определении этапа сборки в пользовательском интерфейсе Visual Studio. Пожалуйста, посмотрите изображение в обновленном сообщении. Любая другая мысль, учитывая этот факт? –

Смежные вопросы