I want to do an automatic deployment using Bamboo (continuous integration solution). I found here ( http://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/#script ) the script part to help. The main code snippet:
#configure powershell with Azure 1.7 modules Import-Module Azure #configure powershell with publishsettings for your subscription $pubsettings = $subscriptionDataFile Import-AzurePublishSettingsFile $pubsettings Set-AzureSubscription -CurrentStorageAccount $storageAccountName -SubscriptionName $selectedsubscription write-host $storageAccountName write-host "$selectedsubscription" #set remaining environment variables for Azure cmdlets $subscription = Get-AzureSubscription $selectedsubscription $subscriptionname = $subscription.subscriptionname $subscriptionid = $subscription.subscriptionid $slot = $environment #main driver - publish & write progress to activity log Write-Output "$(Get-Date βf $timeStampFormat) - Azure Cloud Service deploy script started." Write-Output "$(Get-Date βf $timeStampFormat) - Preparing deployment of $deploymentLabel for $subscriptionname with Subscription ID $subscriptionid." Publish $deployment = Get-AzureDeployment -slot $slot -serviceName $servicename $deploymentUrl = $deployment.Url Write-Output "$(Get-Date βf $timeStampFormat) - Created Cloud Service with URL $deploymentUrl." Write-Output "$(Get-Date βf $timeStampFormat) - Azure Cloud Service deploy script finished."
First, I tried to run this script from cmd by running powershell E:\CI\OCZDeployment\publish_cloud_service.ps1 -environment Staging -serviceName "ocz" -storageAccountName "t2vsoft" -packageLocation OCZ.cspkg -cloudConfigLocation ServiceConfiguration.Cloud.cscfg -subscriptionDataFile E:\CI\OCZDeployment\SubscriptionDataFile.publishsettings -selectedsubscription "Development Subscription"
where the publish settings file is downloaded from Azure.
But I kept getting the error message:
New-AzureDeployment: CurrentStorageAccount is not installed. Use Set-AzureSubscription under the name -CurrentStorageAccount storageaccount to install it.
It was definitely installed in the fragment. I even tried to copy and paste the Set-AzureSubscription line inside the New-AzureDeployment function. Bad luck.
Help me! Thanks!
source share