Gallery › Data Factory › Azure built-in policies
Configure Data Factories to disable public network access
Converted Policy Disabled Modify Mode Indexed Version 1.0.0
Disable public network access for your Data Factory so that it is not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/data-factory/data-factory-private-link.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONPublicNetworkAccess_Modify.json · 63 lines
{
"properties": {
"displayName": "Configure Data Factories to disable public network access",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disable public network access for your Data Factory so that it is not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/data-factory/data-factory-private-link.",
"metadata": {
"version": "1.0.0",
"category": "Data Factory"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.DataFactory/factories"
},
{
"field": "Microsoft.DataFactory/factories/publicNetworkAccess",
"notEquals": "Disabled"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "audit",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/673868aa-7521-48a0-acc6-0f60742d39f5"
],
"operations": [
{
"condition": "[greaterOrEquals(requestContext().apiVersion, '2018-06-01')]",
"operation": "addOrReplace",
"field": "Microsoft.DataFactory/factories/publicNetworkAccess",
"value": "Disabled"
}
]
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/08b1442b-7789-4130-8506-4f99a97226a7",
"name": "08b1442b-7789-4130-8506-4f99a97226a7"
}Bylaw08b1442b-7789-4130-8506-4f99a97226a7.bylaw.ps1 · 30 lines
# Converted from PublicNetworkAccess_Modify.json by ConvertTo-Bylaw.
Policy '08b1442b-7789-4130-8506-4f99a97226a7' {
Properties @{
DisplayName = 'Configure Data Factories to disable public network access'
Description = 'Disable public network access for your Data Factory so that it is not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/data-factory/data-factory-private-link.'
Version = '1.0.0'
Category = 'Data Factory'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.DataFactory/factories' {
Require 'publicNetworkAccess is Disabled' {
Field publicNetworkAccess | Must -Be 'Disabled'
}
}
Modify -Role 'Data Factory Contributor' -ConflictEffect Audit -Effect (Param Effect) {
Field publicNetworkAccess | AddOrReplace 'Disabled' -Condition (Arm '[greaterOrEquals(requestContext().apiVersion, ''2018-06-01'')]')
}
}Source: built-in-policies/policyDefinitions/Data Factory/PublicNetworkAccess_Modify.json in Azure/azure-policy, under the MIT licence.
Bylaw