Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility issue while parsing resource id for event hub auth rule #7244

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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"]

Expand Down Expand Up @@ -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"]

Expand Down