Hey @JamesH,
Thanks for your patience as we looked into this. I’m one of the engineers who is a custodian the Deploy an App Service step. Jumping in for @clare.martin here due to timezones.
I think I’ve figured out what the root cause of your issue may be. I noticed that the deployment process you uploaded to us is using Deployment Slots.
The process uses a variable of #{AzureDeploymentSlot}
in the Deployment Slot
field of the “Deploy an App Service” step. Based on the logs you submitted with OctopusPrintVariables
turned on, it looks like in your variables for the project, you have only defined a value for this AzureDeploymentSlot
variable scoped to the environments that use a slot. There is no value for the other environments that don’t expect to use a slot.
In our variable templating/substitution engine, if a substitution template references an unknown variable, then we always evaluate it as the template itself, not an empty string. So “#{DoesntExist}” is returned literally as “#{DoesntExist}”, not an empty string.
In your usage, I suspect the “Deploy an App Service” is trying to deploy to a slot literally called “#{AzureDeploymentSlot}”.
I get that this can be counter-intuitive, and it’s definitely not helped by the fact that we don’t give you any hints as to what’s happening here in the logs. I’m sorry for this, and it’s something I’ll add in to our backlog to improve. I think we could also make the “unknown variable” behaviour more explicit in our product documentation. I couldn’t find a clear call-out that this is how it behaves. I’ll look into that, too.
On the upside, if my assessment is correct, it means that you should fairly easily be able to fix these failing deployments. All you would need to do is add an extra, empty value for your AzureDeploymentSlot
, scoped to the environments which don’t use deployment slots, so that for those environments, the Deploy an App Service step will get an empty string for Deployment Slot, and so proceed with deploying to the main/default slot in the App Servce.
As per our Scoping Variables documentation, scoping works from most-to-least tightly scoped. So you may be able to simply leave this empty value of AzureDeploymentSlot
unscoped, which will then make it the fallback for any environment which doesn’t have/need a Deployment Slot.
So the process would be, find the AzureDeploymentSlot
variable:
Add a value using the contextual menu:
Leave that value empty, and do not scope it
I hope this helps you get your deployments a nice bright Green! Please let us know how you go, and do reach out if you have any questions or need clarification on the above.
Cheers,
Matt