Gallery › Azure Ai Services › Azure built-in policies
Azure AI Services resources should have key access disabled (disable local authentication)
Converted Policy Audit Deny Disabled Mode Indexed Version 1.1.0
Key access (local authentication) is recommended to be disabled for security. Azure OpenAI Studio, typically used in development/testing, requires key access and will not function if key access is disabled. After disabling, Microsoft Entra ID becomes the only access method, which allows maintaining minimum privilege principle and granular control. Learn more at: https://aka.ms/AI/auth
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDisableLocalAuth_Audit.json · 67 lines
{
"properties": {
"displayName": "Azure AI Services resources should have key access disabled (disable local authentication)",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Key access (local authentication) is recommended to be disabled for security. Azure OpenAI Studio, typically used in development/testing, requires key access and will not function if key access is disabled. After disabling, Microsoft Entra ID becomes the only access method, which allows maintaining minimum privilege principle and granular control. Learn more at: https://aka.ms/AI/auth",
"metadata": {
"version": "1.1.0",
"category": "Azure Ai Services"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.CognitiveServices/accounts"
},
{
"field": "Microsoft.CognitiveServices/accounts/disableLocalAuth",
"notEquals": true
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Search/searchServices"
},
{
"field": "Microsoft.Search/searchServices/disableLocalAuth",
"notEquals": true
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/71ef260a-8f18-47b7-abcb-62d0673d94dc",
"name": "71ef260a-8f18-47b7-abcb-62d0673d94dc"
}Bylaw71ef260a-8f18-47b7-abcb-62d0673d94dc.bylaw.ps1 · 38 lines
# Converted from DisableLocalAuth_Audit.json by ConvertTo-Bylaw.
Policy '71ef260a-8f18-47b7-abcb-62d0673d94dc' {
Properties @{
DisplayName = 'Azure AI Services resources should have key access disabled (disable local authentication)'
Description = 'Key access (local authentication) is recommended to be disabled for security. Azure OpenAI Studio, typically used in development/testing, requires key access and will not function if key access is disabled. After disabling, Microsoft Entra ID becomes the only access method, which allows maintaining minimum privilege principle and granular control. Learn more at: https://aka.ms/AI/auth'
Version = '1.1.0'
Category = 'Azure Ai Services'
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource * {
Require 'type and disableLocalAuth are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.CognitiveServices/accounts' -IfPresent
Field 'Microsoft.CognitiveServices/accounts/disableLocalAuth' | Must -Be $true
}
}
Require 'type and disableLocalAuth are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.Search/searchServices' -IfPresent
Field 'Microsoft.Search/searchServices/disableLocalAuth' | Must -Be $true
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Azure Ai Services/DisableLocalAuth_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw