diff --git a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go index e75a340e7fa2..2a23e4c780a9 100644 --- a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go +++ b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go @@ -120,6 +120,12 @@ func resourceArmEventHubNamespaceAuthorizationRuleRead(d *schema.ResourceData, m } name := id.Path["authorizationRules"] + // The resource id is made of `authorizationRules` in newer API version. However, it is made of `AuthorizationRules` in older API version. + // Hence currently it would fail to parse resource id with `AuthorizationRules` for older one. + // So here it has to be compatible with both new version and old version. + if name == "" { + name = id.Path["AuthorizationRules"] + } resourceGroup := id.ResourceGroup namespaceName := id.Path["namespaces"] @@ -169,6 +175,12 @@ func resourceArmEventHubNamespaceAuthorizationRuleDelete(d *schema.ResourceData, } name := id.Path["authorizationRules"] + // The resource id is made of `authorizationRules` in newer API version. However, it is made of `AuthorizationRules` in older API version. + // Hence currently it would fail to parse resource id with `AuthorizationRules` for older one. + // So here it has to be compatible with both new version and old version. + if name == "" { + name = id.Path["AuthorizationRules"] + } resourceGroup := id.ResourceGroup namespaceName := id.Path["namespaces"]