Gallery › Azure Data Explorer › Azure Community Policy
Configure private DNS Zones for an Azure Data Explorer cluster groupID
Converted Policy AuditIfNotExists DeployIfNotExists Disabled Mode Indexed Version 1.0.0
Configure private DNS zone group to override the DNS resolution for Azure Data Explorer 'cluster' groupID private endpoint.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 183 lines
{
"name": "85e69e4d-9953-49b9-b864-dcddea977455",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Configure private DNS Zones for an Azure Data Explorer cluster groupID",
"description": "Configure private DNS zone group to override the DNS resolution for Azure Data Explorer 'cluster' groupID private endpoint.",
"metadata": {
"version": "1.0.0",
"category": "Azure Data Explorer"
},
"mode": "Indexed",
"parameters": {
"blobStoragePrivateDnsZoneId": {
"type": "String",
"metadata": {
"displayName": "Private DNS Zone for blob endpoints",
"description": "One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.",
"strongType": "Microsoft.Network/privateDnsZones"
}
},
"tableStoragePrivateDnsZoneId": {
"type": "String",
"metadata": {
"displayName": "Private DNS Zone for table endpoints",
"description": "One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.",
"strongType": "Microsoft.Network/privateDnsZones"
}
},
"queueStoragePrivateDnsZoneId": {
"type": "String",
"metadata": {
"displayName": "Private DNS Zone for queue endpoints",
"description": "One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.",
"strongType": "Microsoft.Network/privateDnsZones"
}
},
"kustoPrivateDnsZoneId": {
"type": "String",
"metadata": {
"displayName": "Private DNS Zone for kusto endpoints",
"description": "One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone.",
"strongType": "Microsoft.Network/privateDnsZones"
}
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "DeployIfNotExists, AuditIfNotExists or Disabled the execution of the Policy"
},
"allowedValues": [
"DeployIfNotExists",
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "DeployIfNotExists"
}
},
"policyRule": {
"if": {
"allOf": [
{
"equals": "Microsoft.Network/privateEndpoints",
"field": "type"
},
{
"count": {
"field": "Microsoft.Network/privateEndpoints/privateLinkServiceConnections[*]",
"where": {
"allOf": [
{
"field": "Microsoft.Network/privateEndpoints/privateLinkServiceConnections[*].privateLinkServiceId",
"contains": "Microsoft.Kusto/clusters"
},
{
"field": "Microsoft.Network/privateEndpoints/privateLinkServiceConnections[*].groupIds[*]",
"equals": "cluster"
}
]
}
},
"greaterOrEquals": 1
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7",
"/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7"
],
"deployment": {
"properties": {
"mode": "incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"blobStoragePrivateDnsZoneId": {
"type": "string"
},
"tableStoragePrivateDnsZoneId": {
"type": "string"
},
"queueStoragePrivateDnsZoneId": {
"type": "string"
},
"kustoPrivateDnsZoneId": {
"type": "string"
},
"privateEndpointName": {
"type": "string"
},
"location": {
"type": "string"
}
},
"resources": [
{
"name": "[concat(parameters('privateEndpointName'), '/deployedByPolicy')]",
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
"apiVersion": "2024-05-01",
"location": "[parameters('location')]",
"properties": {
"privateDnsZoneConfigs": [
{
"name": "privateDnsZoneBlobStorage",
"properties": {
"privateDnsZoneId": "[parameters('blobStoragePrivateDnsZoneId')]"
}
},
{
"name": "privateDnsZoneTableStorage",
"properties": {
"privateDnsZoneId": "[parameters('tableStoragePrivateDnsZoneId')]"
}
},
{
"name": "privateDnsZoneQueueStorage",
"properties": {
"privateDnsZoneId": "[parameters('queueStoragePrivateDnsZoneId')]"
}
},
{
"name": "privateDnsZoneKusto",
"properties": {
"privateDnsZoneId": "[parameters('kustoPrivateDnsZoneId')]"
}
}
]
}
}
]
},
"parameters": {
"blobStoragePrivateDnsZoneId": {
"value": "[parameters('blobStoragePrivateDnsZoneId')]"
},
"tableStoragePrivateDnsZoneId": {
"value": "[parameters('tableStoragePrivateDnsZoneId')]"
},
"queueStoragePrivateDnsZoneId": {
"value": "[parameters('queueStoragePrivateDnsZoneId')]"
},
"kustoPrivateDnsZoneId": {
"value": "[parameters('kustoPrivateDnsZoneId')]"
},
"privateEndpointName": {
"value": "[field('name')]"
},
"location": {
"value": "[field('location')]"
}
}
}
}
}
}
}
}
}Bylaw85e69e4d-9953-49b9-b864-dcddea977455.bylaw.ps1 · 66 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '85e69e4d-9953-49b9-b864-dcddea977455' {
Properties @{
DisplayName = 'Configure private DNS Zones for an Azure Data Explorer cluster groupID'
Description = 'Configure private DNS zone group to override the DNS resolution for Azure Data Explorer ''cluster'' groupID private endpoint.'
Version = '1.0.0'
Category = 'Azure Data Explorer'
Mode = 'Indexed'
}
Parameter BlobStoragePrivateDnsZoneId @{
Type = 'String'
DisplayName = 'Private DNS Zone for blob endpoints'
Description = 'One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.'
Metadata = [ordered]@{ strongType = 'Microsoft.Network/privateDnsZones' }
}
Parameter TableStoragePrivateDnsZoneId @{
Type = 'String'
DisplayName = 'Private DNS Zone for table endpoints'
Description = 'One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.'
Metadata = [ordered]@{ strongType = 'Microsoft.Network/privateDnsZones' }
}
Parameter QueueStoragePrivateDnsZoneId @{
Type = 'String'
DisplayName = 'Private DNS Zone for queue endpoints'
Description = 'One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone to your Azure Data Explorer Cluster.'
Metadata = [ordered]@{ strongType = 'Microsoft.Network/privateDnsZones' }
}
Parameter KustoPrivateDnsZoneId @{
Type = 'String'
DisplayName = 'Private DNS Zone for kusto endpoints'
Description = 'One of the four private DNS zone IDs required for Microsoft.Kusto/clusters to resolve a private DNS Zone.'
Metadata = [ordered]@{ strongType = 'Microsoft.Network/privateDnsZones' }
}
Parameter Effect @{
AllowedValues = @('DeployIfNotExists', 'AuditIfNotExists', 'Disabled')
Default = 'DeployIfNotExists'
DisplayName = 'Effect'
Description = 'DeployIfNotExists, AuditIfNotExists or Disabled the execution of the Policy'
}
Resource 'Microsoft.Network/privateEndpoints' {
Require 'privateLinkServiceConnections, privateLinkServiceId and groupIds are as required' {
Count 'privateLinkServiceConnections[*]' -Where {
Field privateLinkServiceId | Must -ContainText 'Microsoft.Kusto/clusters'
Field groupIds | Must -Exist
Count 'groupIds[*]' -Where {
Element | Must -Not -Be 'cluster'
} | Must -Be 0
} | Must -Be 0
}
}
DeployIfNotExists 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups' -Role 'Network Contributor', 'Reader' -Effect (Param Effect) {
Deployment -TemplateFile './templates/85e69e4d-9953-49b9-b864-dcddea977455.json' -Parameters ([ordered]@{
blobStoragePrivateDnsZoneId = (Param BlobStoragePrivateDnsZoneId)
tableStoragePrivateDnsZoneId = (Param TableStoragePrivateDnsZoneId)
queueStoragePrivateDnsZoneId = (Param QueueStoragePrivateDnsZoneId)
kustoPrivateDnsZoneId = (Param KustoPrivateDnsZoneId)
privateEndpointName = (Arm '[field(''name'')]')
location = (Arm '[field(''location'')]')
})
}
}Its deployment templates are written beside it:
templates/85e69e4d-9953-49b9-b864-dcddea977455.json
Source: policyDefinitions/Azure Data Explorer/configure-private-dns-zones-for-azure-data-explorer-cluster-groupid/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw