Gallery › API Management › Azure Community Policy
Require Internal VPN
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
The policy requires the API Manager resource to be deployed in an Internal Virtual Private Network. No Public EndPoint, no External VPN.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 45 lines
{
"name": "eb969283-cfab-4a68-a8a8-2b1fdd5feef8",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Require Internal VPN",
"description": "The policy requires the API Manager resource to be deployed in an Internal Virtual Private Network. No Public EndPoint, no External VPN.",
"metadata": {
"category": "API Management",
"version": "1.0.0"
},
"mode": "All",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Deny, Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ApiManagement/service"
},
{
"field": "Microsoft.ApiManagement/service/virtualNetworkType",
"notEquals": "Internal"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaweb969283-cfab-4a68-a8a8-2b1fdd5feef8.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy 'eb969283-cfab-4a68-a8a8-2b1fdd5feef8' {
Properties @{
DisplayName = 'Require Internal VPN'
Description = 'The policy requires the API Manager resource to be deployed in an Internal Virtual Private Network. No Public EndPoint, no External VPN.'
Category = 'API Management'
Version = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.ApiManagement/service' {
Require 'virtualNetworkType is Internal' {
Field virtualNetworkType | Must -Be 'Internal'
}
}
Effect (Param Effect)
}Source: policyDefinitions/API Management/deny-enforcing-internal-vpn/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw