Gallery › Azure Ai Services › Azure built-in policies
Azure AI Services resources should use Azure Private Link
Converted Policy Audit Disabled Mode Indexed Version 1.0.0
Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform reduces data leakage risks by handling the connectivity between the consumer and services over the Azure backbone network. Learn more about private links at: https://aka.ms/AzurePrivateLink/Overview
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONEnablePrivateEndpoints_Audit.json · 77 lines
{
"properties": {
"displayName": "Azure AI Services resources should use Azure Private Link",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform reduces data leakage risks by handling the connectivity between the consumer and services over the Azure backbone network. Learn more about private links at: https://aka.ms/AzurePrivateLink/Overview",
"metadata": {
"version": "1.0.0",
"category": "Azure Ai Services"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.CognitiveServices/accounts"
},
{
"count": {
"field": "Microsoft.CognitiveServices/accounts/privateEndpointConnections[*]",
"where": {
"field": "Microsoft.CognitiveServices/accounts/privateEndpointConnections[*].privateLinkServiceConnectionState.status",
"equals": "Approved"
}
},
"less": 1
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Search/searchServices"
},
{
"count": {
"field": "Microsoft.Search/searchServices/privateEndpointConnections[*]",
"where": {
"field": "Microsoft.Search/searchServices/privateEndpointConnections[*].privateLinkServiceConnectionState.status",
"equals": "Approved"
}
},
"less": 1
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/d6759c02-b87f-42b7-892e-71b3f471d782",
"name": "d6759c02-b87f-42b7-892e-71b3f471d782"
}Bylawd6759c02-b87f-42b7-892e-71b3f471d782.bylaw.ps1 · 42 lines
# Converted from EnablePrivateEndpoints_Audit.json by ConvertTo-Bylaw.
Policy 'd6759c02-b87f-42b7-892e-71b3f471d782' {
Properties @{
DisplayName = 'Azure AI Services resources should use Azure Private Link'
Description = 'Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform reduces data leakage risks by handling the connectivity between the consumer and services over the Azure backbone network. Learn more about private links at: https://aka.ms/AzurePrivateLink/Overview'
Version = '1.0.0'
Category = 'Azure Ai Services'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource * {
Require 'type, privateEndpointConnections and privateLinkServiceConnectionState.status are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.CognitiveServices/accounts' -IfPresent
Count 'Microsoft.CognitiveServices/accounts/privateEndpointConnections[*]' -Where {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
} | Must -BeGreaterOrEqual 1
}
}
Require 'type, privateEndpointConnections and privateLinkServiceConnectionState.status are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.Search/searchServices' -IfPresent
Count 'Microsoft.Search/searchServices/privateEndpointConnections[*]' -Where {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
} | Must -BeGreaterOrEqual 1
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Azure Ai Services/EnablePrivateEndpoints_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw