Forum Discussion
Issue enforcing Azure Policy on Azure OpenAI Model Deployments
Hi everyone,
Due to strict data residency and compliance regulations within our organization, we need to enforce controls ensuring that global inference deployments (such as GlobalStandard or GlobalProvisioned) cannot be created within our Azure OpenAI environments. Our goal is to mandate the use of Data Zone or Regional deployments (e.g., DataZoneStandard).
To achieve this, we created a custom Azure Policy using a whitelisting approach on the resource type Microsoft.CognitiveServices/accounts/deployments. We want to deny any model deployment whose SKU does not match our allowed deployment types.
Here is the policy definition we are attempting to use:
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.CognitiveServices/accounts/deployments"
},
{
"field": "Microsoft.CognitiveServices/accounts/deployments/sku.name",
"notIn": [
"Standard",
"DataZoneStandard",
"Provisioned",
"DataZoneProvisioned"
]
}
]
},
"then": {
"effect": "deny"
}
}
}The Problem:
Despite referencing the fully qualified alias Microsoft.CognitiveServices/accounts/deployments/sku.name (and attempting variation matches with like/notLike), the policy is still not working as expected when creating deployments via the Azure Portal or ARM/Bicep templates.
We previously ran into an error stating that sku.name was not a valid field, but after changing it to the full alias, the definition saves—yet the rule fails to block non-compliant deployments during evaluation.
Questions for the Community:
Is Microsoft.CognitiveServices/accounts/deployments/sku.name the correct alias evaluated during ARM deployment calls for Azure OpenAI model deployments?
Does Azure OpenAI store deployment types (GlobalStandard, DataZoneStandard, etc.) under a different property path or alias during validation?
Has anyone successfully implemented a policy rule to block Global Token deployments or enforce Data Zone deployments only?
Any insights, working policy samples, or alias pointers would be greatly appreciated!
Thanks in advance for your help!
1 Reply
- benibixBrass Contributor
Hi semod92
Your alias is fine. The problem is the mode. Indexed only evaluates resource types that support tags and location, and Microsoft's own sample for denying a deployment type on Microsoft.CognitiveServices/accounts/deployments uses All. Change that one line and the rule should start denying.
Two SKU names in your list are also off. The codes are ProvisionedManaged and DataZoneProvisionedManaged, so as written you'd block regional provisioned deployments too. If you use batch, DataZoneBatch needs to be on the list as well. Here's the rule with those fixed:
{ "mode": "All", "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.CognitiveServices/accounts/deployments" }, { "field": "Microsoft.CognitiveServices/accounts/deployments/sku.name", "notIn": [ "Standard", "DataZoneStandard", "ProvisionedManaged", "DataZoneProvisionedManaged", "DataZoneBatch" ] } ] }, "then": { "effect": "deny" } } }
Give a new assignment at least 15 minutes before you test it. Microsoft's sample is here: https://learn.microsoft.com/en-us/azure/foundry-classic/foundry-models/how-to/configure-deployment-policies