Deploying Cloud Service fails with very long branch name


(mike) #1


tl;dr - deploying cloud services fails if “{step name} v{release number}”.Length > 100, which causes problems if your release number includes a very long branch name

Following on from SQL error when creating release with very long version number, I’ve found another issue with long branch names which was sent to me by a different dev team in or organisation (I don’t know why they all insist on extremely long branch names, but that’s beside the point).

In this case, deploying a cloud service (ActionType = “Octopus.AzureCloudService”) fails with the following error:

Set-AzureDeployment : Specified argument was out of the range of valid values. 
Parameter name: parameters.Label 
At E:\Octopus\Work\20180611163020-601394-70449\staging\DeployToAzure.ps1:42 char:5 
+     Set-AzureDeployment -Upgrade -ServiceName $OctopusAzureServiceNam ... 
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo          : CloseError: (:) [Set-AzureDeployment], ArgumentOutOfRangeException 
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.SetAzureDeploymentComma  

To summarise the error:

Obviously, now we’ve identified the length of the branch name as the root cause, I’ve told the devs to use shorter names, but it would be helpful if the Octopus.AzureCloudService action template was aware of the 100 character limit in the Label parameter for Set-AzureDeployment (or just the length of release numbers in general), and gave a meaningful error message with a call to action so our devs didn’t have to escalate to me to investigate :-).



SQL error when creating release with very long version number
(Shaun Marx) #2

Hi Mike,

Thanks for providing all of that information. We wholeheartedly agree. A meaningful error in this case would have spared you a lot of time investigating. I have raised an issue which you can keep track of the progress.

Sorry for the ensuing chaos :slight_smile:


(mike) #3

Perfect. Thanks Shaun.

Just to clarify in the GitHub issue you’ve created, the error also happens if you don’t create a Octopus.Action.Azure.DeploymentLabel variable in your project, and the number of characters in your {Action Name} plus {Release Number} is > 100.

In our case, the root cause was that our {Release Number} included a very long branch name. Your ticket doesn’t explicitly call that out so just wanted to make sure it doesn’t get missed when someone comes to work on the ticket.



(Shaun Marx) #4

Hi Mike, thanks for clarifying.

I have updated the issue and should now capture both cases. Please don’t hesitate to let me know if I have missed anything else!


(mike) #5

Perfect. Thanks Shaun.