You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Versions
terraform: 1.9.8
azure provider: 3.108
module: 6.2.0
Description
Describe the bug
The policy Deploy-Private-DNS-Generic can be used to add private DNS zone records for resources not supported by the default policy Deploy-Private-DNS-Zones. Using the generic policy does not work however, since the required role assignment on the connectivity management group scope is not set.
Steps to Reproduce
Add policy assignment for policy Deploy-Private-DNS-Generic and configure the required parameters
Check policy compliance and create remediation task
Remediation task will fail with the following error message: LinkedAuthorizationFailed The client '********-****-****-****-************' with object id '********-****-****-****-************' has permission to perform action 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups/write' on scope '/subscriptions/***-application-landing-zone-subscription-***/resourcegroups/**********/providers/Microsoft.Network/privateEndpoints/********-psql/privateDnsZoneGroups/deployedByPolicy'; however, it does not have permission to perform action(s) 'Microsoft.Network/privateDnsZones/join/action' on the linked scope(s) '/subscriptions/***-connectivity-subscription-***/resourceGroups/******-dns/providers/Microsoft.Network/privateDnsZones/privatelink.postgres.database.azure.com' (respectively) or the linked scope(s) are invalid.
Screenshots
Additional context
I think this is similar to #794. Reading the commits there I was able to create a workaround outside of the module with this code:
# We use policy Deploy-Private-DNS-Generic to add Private DNS Zone records for resources that are not supported by the default policy Deploy-Private-DNS-Zones# Permissions for this policy are not correctly assigned, so this creates the required assignmentsresource"azurerm_role_assignment""private_dns_zone_contributor_connectivity" {
# Create role assignment for each policy assignment that uses the policy Deploy-Private-DNS-Genericfor_each={ fork, vinmodule.enterprise_scale.azurerm_management_group_policy_assignment.enterprise_scale:k=>vifendswith(v.policy_definition_id, "policyDefinitions/Deploy-Private-DNS-Generic") }
provider=azurerm.connectivityrole_definition_name="Private DNS Zone Contributor"scope="/providers/Microsoft.Management/managementGroups/${var.root_id}-connectivity"principal_id=each.value.identity[0].principal_id
}
The text was updated successfully, but these errors were encountered:
Community Note
Versions
terraform: 1.9.8
azure provider: 3.108
module: 6.2.0
Description
Describe the bug
The policy
Deploy-Private-DNS-Generic
can be used to add private DNS zone records for resources not supported by the default policyDeploy-Private-DNS-Zones
. Using the generic policy does not work however, since the required role assignment on the connectivity management group scope is not set.Steps to Reproduce
Deploy-Private-DNS-Generic
and configure the required parametersLinkedAuthorizationFailed
The client '********-****-****-****-************' with object id '********-****-****-****-************' has permission to perform action 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups/write' on scope '/subscriptions/***-application-landing-zone-subscription-***/resourcegroups/**********/providers/Microsoft.Network/privateEndpoints/********-psql/privateDnsZoneGroups/deployedByPolicy'; however, it does not have permission to perform action(s) 'Microsoft.Network/privateDnsZones/join/action' on the linked scope(s) '/subscriptions/***-connectivity-subscription-***/resourceGroups/******-dns/providers/Microsoft.Network/privateDnsZones/privatelink.postgres.database.azure.com' (respectively) or the linked scope(s) are invalid.
Screenshots
Additional context
I think this is similar to #794. Reading the commits there I was able to create a workaround outside of the module with this code:
The text was updated successfully, but these errors were encountered: