如何为特定SQL提供程序SKU创建策略 [英] How to create policy for specific SQL Provider SKU
问题描述
大家好。
使用Azure Stack(目前)我们不能限制租户使用特定的SKU(SQL Provider)(https://docs.microsoft.com / en-us / azure / azure-stack / azure-stack-sql-resource-provider-hosting-servers #sku-notes)
With Azure Stack (currently) we cann't limit tenant to use specific SKU (SQL Provider) (https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-sql-resource-provider-hosting-servers#sku-notes)
但是如果我们用azure策略限制一些SKU怎么办? ?有可能吗?
But what if we restrict some SKUs with azure policy? Is it possible?
我可以用这个定义创建策略:
I can create policy with this definition:
New-AzureRmPolicyDefinition -Name "DisablePremiumSKU" -Policy '{
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.SQLAdapter/databases"
}
]
},
"then": {
"effect": "deny"
}
}'
但是,我不知道如何限制SKU。我尝试使用这样的思考:
But, i don't know how to restrict SKUs. I tried to use somethink like this:
New-AzureRmPolicyDefinition -Name "DisablePremiumSKU" -Policy '{
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.SQLAdapter/databases"
},
{
"field": "Microsoft.SQLAdapter/databases/sku.name",
"like": "Premium*"
}
]
},
"then": {
"effect": "deny"
}
}'
失败:
我试图通过请求https://management.local.azurestack.external/providers/来枚举所有的alises ?api-version = 2017-08-01& $ expand = resourceTypes / aliases
I tried to enumerate all alises by requesting https://management.local.azurestack.external/providers/?api-version=2017-08-01&$expand=resourceTypes/aliases
响应包含具有空别名的不同资源类型。
Responce contains different resource types with empty aliases.
怎么能我在azure堆栈中获取别名?
How can i get aliases in azure stack?
如何创建策略定义以限制SQL SKU的使用?
How to create policy definition to restrict SQL SKUs usage?
mcp,mcdba,mcsa,mcse,ccna
mcp, mcdba, mcsa, mcse, ccna
推荐答案
我正在就这个问题与一些不同的消息来源联系。我想看看是否有更好的方法来解决这个问题,以及政策是否能够正常运作。
I am reaching out to some different sources regarding this question. I would like to see if there is a better way to go about this, as well as if policies will be able to work correctly.
这篇关于如何为特定SQL提供程序SKU创建策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!