Forum Discussion
azure file share resource group name is in lowercase instead of uppercase prefix 'mc'
The issue arises because Azure handles resource naming inconsistently across services. For AKS clusters, the resource group is typically created with the MC_ prefix in uppercase. However, some Azure services, like Recovery Services vaults, display it in lowercase (mc_) due to internal normalization.
Why This Happens:
Casing Differences: Azure normalizes some names internally to lowercase, but Terraform and certain APIs treat resource IDs as case-sensitive.
Terraform Behavior: Terraform performs strict comparisons, so mismatches like MC_ vs. mc_ or Microsoft.Storage vs. Microsoft.storage cause it to see resources as different.
How to Resolve:
Normalize Case in Terraform: Use the replace function to align casing:
resource_group_name = replace("mc_CLUSTER_NAME", "mc_", "MC_")
Ignore Case Differences: Add lifecycle.ignore_changes in Terraform:
lifecycle {
ignore_changes = [source_storage_account_id]
}
Verify Resource IDs: Use Azure CLI to confirm the actual casing:
az resource show --ids <RESOURCE_ID>
Azure Kubernetes Service (AKS) Resource Group Naming
https://learn.microsoft.com/en-us/azure/aks/cluster-configuration