Storage Account woes Azure Cloud Service

Using the latest and greatest Octopus in a POC environment.

I want to accomplish a simple deployment of a Cloud Service from the ground up. Meaning no App exists, and no storage account has been created that the built-in deploy cloud service needs to process the deployment.

I have a step that checks for, and then creates the storage account that runs successfully. It uses a variable for the name and a Certificate connection to Azure. Using that same cert connection for the deploy cloud service step, I receive an error that seems to be related to storage.

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
   at Microsoft.WindowsAzure.StorageAccountOperationsExtensions.GetKeys(IStorageAccountOperations operations, String accountName)
   at Calamari.Azure.Integration.AzurePackageUploader.GetStorageAccountPrimaryKey(SubscriptionCloudCredentials credentials, String storageAccountName, String serviceManagementEndpoint) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari.Azure\Integration\AzurePackageUploader.cs:line 124
   at Calamari.Azure.Integration.AzurePackageUploader.Upload(SubscriptionCloudCredentials credentials, String storageAccountName, String packageFile, String uploadedFileName, String storageEndpointSuffix, String serviceManagementEndpoint) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari.Azure\Integration\AzurePackageUploader.cs:line 22
   at Calamari.Azure.Deployment.Conventions.UploadAzureCloudServicePackageConvention.Install(RunningDeployment deployment) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\UploadAzureCloudServicePackageConvention.cs:line 44
   at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
   at Calamari.Deployment.ConventionProcessor.RunConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
Running rollback conventions...```

Is it possible this is masking a different issue?

Hi Anthony,

Can you send through the script you use to create your storage account? It may be that you’re creating a “non-classic” storage account which we currently don’t support for Cloud Services (we have this issue to add support for “non-classic” storage accounts for Cloud Services).

And if you could send through screenshots of how you’ve configured your deployment process and the raw log of the failed deployment task above that would be very helpful.

Thank you and best regards,

Glad to provide this info.

Script (Step 3 below):

Get-AzureStorageAccount -StorageAccountName $cloudStorageName -ev notPresent -ea 0

if ($notPresent)
$storageAccount = New-AzureStorageAccount –StorageAccountName $cloudStorageName -Location “$resGroupLocation”
$storageAccount = Get-AzureStorageAccount -StorageAccountName $cloudStorageName


RAW log attached. Thanks so much. I’m trying to prove to a group using old and horrible process that life can be so much easier with Octo. Tell Paul I said hi!



ServerTasks-355.log.txt (28 KB)

Hi Anthony,

Thanks for sending through that info, can you also send through a screenshot of how you’ve configured step 4 (the cloud service step).



Hey Anthony,

I think you’re going to like this.

I set up an identical deployment process to yours to try and replicate your issue and ran it but contrary to your result, it succeeded. So I was scratching my beard trying to figure out why yours isn’t working and then I spotted it.

In your script to create the storage account you reference the variable $cloudStorageName, but then in your step to deploy the cloud service you’re referencing a variable named #{cloudStorageAccount} and I’m guessing this is a typo and should really be #{cloudStorageName}.

Please let me know if this helps!

Thank you and kind regards,

By golly that was it… facepalm. I knew it was something on my end. You all have this pretty nailed down and I just needed that other set of eyes from a group that would give them to me.

Now getting a cert error due to one needed in the roles but that should be a breeze using the certs stored in octo and a little script.



Hi Anthony,

Great to hear you got it all worked out.

Happy deployments!