Skip to content

[AOE] Cost management tag inheritance with different tag casing breaks storage account recommendations #1430

Description

@helderpinto

🐛 Problem

When cost management tag inheritance is enabled, billed resources inherit tags from resource groups and/or subscriptions in a case sensitive manner. For example, tag 'App' in the resource is different from tag 'app' in the resource group. Billing events for that resource thus include both tags name/value pairs.

The Recommend-StorageAccountOptimizationsToBlobStorage runbook does a JSON conversion (ConvertFrom-Json, in PS 5.1) of the tags property generated by the recommendations results, which throws an error, because of duplicate keys (PS is case-insensitive).

👣 Repro steps

  1. Enable Cost Management tag inheritance
  2. Add a storage account tag, e.g., 'environment'='prd'
  3. Add to the storage account's resource group a similar tag in uppercase, e.g., 'ENVIRONMENT'='prd'
  4. Create the conditions for the generation of a cost recommendation for that storage account, for example, letting it grow in size for several weeks in a row
  5. See Recommend-StorageAccountOptimizationsToBlobStorage runbook throwing exception.

🤔 Expected

The Recommend-StorageAccountOptimizationsToBlobStorage should deal with tag duplicates before trying to convert it to JSON in PowerShell.

🙋‍♀️ Ask for the community

We could use your help:

  1. Please vote this issue up (👍) to prioritize it.
  2. Leave comments to help us solidify the vision.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions