Gallery › Service Bus › Azure Community Policy
Service Bus Namespace - Tier Setting DENY
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
This Azure Policy denies the deployment of a Service Bus Namespace when the 'Pricing tier' setting is not set to 'Premium'.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 49 lines
{
"name": "eec5f337-bdf0-4f0e-ba31-99b14db17487",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Service Bus Namespace - Tier Setting DENY",
"description": "This Azure Policy denies the deployment of a Service Bus Namespace when the 'Pricing tier' setting is not set to 'Premium'.",
"metadata": {
"version": "1.0.0",
"category": "Service Bus"
},
"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.ServiceBus/namespaces"
},
{
"anyOf": [
{
"field": "Microsoft.ServiceBus/namespaces/sku.name",
"notEquals": "Premium"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaweec5f337-bdf0-4f0e-ba31-99b14db17487.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy 'eec5f337-bdf0-4f0e-ba31-99b14db17487' {
Properties @{
DisplayName = 'Service Bus Namespace - Tier Setting DENY'
Description = 'This Azure Policy denies the deployment of a Service Bus Namespace when the ''Pricing tier'' setting is not set to ''Premium''.'
Version = '1.0.0'
Category = 'Service Bus'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.ServiceBus/namespaces' {
Require 'sku.name is Premium' {
Field sku.name | Must -Be 'Premium'
}
}
Effect (Param Effect)
}Source: policyDefinitions/Service Bus/service-bus-namespace-tier-setting-deny/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw