Gallery › Media Services › Azure built-in policies
[Deprecated]: Azure Media Services accounts that allow access to the legacy v2 API should be blocked
Converted Policy Audit Deny Disabled Mode Indexed Version 1.1.0-deprecated Deprecated
This policy is deprecated because Media Services retirement. 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 JSONBlockRestV2_Audit.json · 52 lines
{
"properties": {
"displayName": "[Deprecated]: Azure Media Services accounts that allow access to the legacy v2 API should be blocked",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy is deprecated because Media Services retirement. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.",
"metadata": {
"version": "1.1.0-deprecated",
"category": "Media Services",
"deprecated": true
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Disabled",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Media/mediaservices"
},
{
"field": "Microsoft.Media/mediaservices/encryption.type",
"exists": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ccf93279-9c91-4143-a841-8d1f21505455",
"name": "ccf93279-9c91-4143-a841-8d1f21505455"
}Bylawccf93279-9c91-4143-a841-8d1f21505455.bylaw.ps1 · 30 lines
# Converted from BlockRestV2_Audit.json by ConvertTo-Bylaw.
Policy 'ccf93279-9c91-4143-a841-8d1f21505455' {
Properties @{
DisplayName = '[Deprecated]: Azure Media Services accounts that allow access to the legacy v2 API should be blocked'
Description = 'This policy is deprecated because Media Services retirement. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.'
Version = '1.1.0-deprecated'
Category = 'Media Services'
Deprecated = $true
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Disabled'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Media/mediaservices' {
Require 'encryption.type exists' {
Field 'Microsoft.Media/mediaservices/encryption.type' -AllowUnknownAlias | Must -Exist
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Media Services/BlockRestV2_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw