Gallery › SQL › Azure built-in policies
[Deprecated]: Azure PostgreSQL flexible server should have Azure Active Directory Only Authentication enabled
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0-deprecated Deprecated
This policy is deprecated because it uses unsupported api. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID b4dec045-250a-48c2-b5cc-e0c4eec8b5b4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONPostgreSQL_FlexibleServers_ADOnlyEnabled_Audit.json · 50 lines
{
"properties": {
"displayName": "[Deprecated]: Azure PostgreSQL flexible server should have Azure Active Directory Only Authentication enabled",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy is deprecated because it uses unsupported api. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID b4dec045-250a-48c2-b5cc-e0c4eec8b5b4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation",
"metadata": {
"version": "1.0.0-deprecated",
"category": "SQL",
"deprecated": true
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.DBforPostgreSQL/flexibleServers"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations",
"name": "aad_auth_only",
"existenceCondition": {
"field": "Microsoft.DBforPostgreSQL/flexibleServers/configurations/value",
"equals": "ON"
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/e27a6dfc-883f-4f9e-97cc-a819fe702400",
"name": "e27a6dfc-883f-4f9e-97cc-a819fe702400"
}Bylawe27a6dfc-883f-4f9e-97cc-a819fe702400.bylaw.ps1 · 29 lines
# Converted from PostgreSQL_FlexibleServers_ADOnlyEnabled_Audit.json by ConvertTo-Bylaw.
Policy 'e27a6dfc-883f-4f9e-97cc-a819fe702400' {
Properties @{
DisplayName = '[Deprecated]: Azure PostgreSQL flexible server should have Azure Active Directory Only Authentication enabled'
Description = 'This policy is deprecated because it uses unsupported api. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID b4dec045-250a-48c2-b5cc-e0c4eec8b5b4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation'
Version = '1.0.0-deprecated'
Category = 'SQL'
Deprecated = $true
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'Disabled'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.DBforPostgreSQL/flexibleServers'
AuditIfNotExists 'Microsoft.DBforPostgreSQL/flexibleServers/configurations' -Name 'aad_auth_only' -Effect (Param Effect) {
Require 'value is ON' {
Field value | Must -Be 'ON'
}
}
}Source: built-in-policies/policyDefinitions/SQL/PostgreSQL_FlexibleServers_ADOnlyEnabled_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw