Azure webapp tags

Is there a way to add azure resource tags to a webapp deployment?
Microsoft’s website indicates this can be part of the deployment json (https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags). But, I haven’t been able to find a way to set tags either within OctoDeploy, or configuration settings in my build process.

Hi Cary,

Thanks for getting in touch.

There is no out-of-the-box way to assign tags to your Azure resources, but you can add a Azure Script step (or using the Custom Deployment Script feature on your Azure Web App step) that does it for you. Example from the Microsoft docs

$r = Get-AzResource -ResourceName examplevnet -ResourceGroupName examplegroup
Set-AzResource -Tag @{ Dept="IT"; Environment="Test" } -ResourceId $r.ResourceId -Force

I hope that helps.

Thank you and best regards,
Henrik

Thanks for the reply. I was afraid that would be the answer :slight_smile: I’ll give it a try.

1 Like