0

It seems nice and easy to enable the tag inheritance preview feature in the Azure portal. See here https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/enable-tag-inheritance, But I'd like to do this using Terraform.

I think the Azure/azapi provider is the key to using Azure preview features. See here https://registry.terraform.io/providers/Azure/azapi/latest/docs however, I'm stuck trying to workout out to use it to enable the feature on my subscription.

I'm hoping simply enabling this preview future will mean we can avoid setting up a set of tag policies.

We've added the provider to our terraform but are unsure how to use it to enable the tag inheritance preview feature. I've been looking through the rest API, but currently have not found anything https://learn.microsoft.com/en-us/rest/api/azure/. and i not find any clues when web searching.

Any help or pointers is appreciated

pete
  • 1
  • The AzureRM provider for Terraform does tend to lag behind releases, as it's not published by Microsoft. As to your tagging policies and how tag inheritance can help you, it's going to depend on what you use tags for. If it's just for billing, then tag inheritance looks like a good option to prevent adding common tags to resources. However, as the doc you shared stats it only applies to usage, so the tags wouldn't appear in the Azure Portal like defined tags and wouldn't be used for other non-billing purposes. – Anthony Norwood May 04 '23 at 04:25
  • Hi, thanks for the feedback, yes, I was not clear, our use case is for billing. We had the same thought, the tag inheritance seems like an easy route to take. The rest of our setup up is in IoC in Terraform. I'm struggling with enabling this preview feature. One option is to turn it on manually in the portal and wait until it reaches GA and is in AzureRM. but I thought i try to explore using azapi – pete May 04 '23 at 09:13
  • Think I've found what I was looking for :-) https://learn.microsoft.com/en-us/azure/templates/microsoft.costmanagement/2022-10-05-preview/settings?pivots=deployment-language-terraform – pete May 04 '23 at 11:06

0 Answers0