gpt4 book ai didi

azure - 仅允许在 Azure 中选择特定区域

转载 作者:行者123 更新时间:2023-12-03 01:41:34 25 4
gpt4 key购买 nike

我试图强制在 Azure 中配置资源或服务的任何人只能选择特定区域。例如,当他们配置资源组时,下拉列表仅显示特定区域。我希望有一些全局设置会影响所有用户。我们还使用 Azure AD;这有帮助吗?我尝试搜索 Azure 文档和 PowerShell 命令,但找不到任何提及此设置的信息。

最佳答案

您可以使用Azure Policy去做这件事。

这里是一个示例策略,要求将所有资源部署到批准的位置,请参阅此link ,你可以尝试deploy with portalwith powershell

This policy requires that all resources are deployed to the approved locations. You specify an array of approved locations.

示例模板:

{
"properties": {
"displayName": "Allowed locations",
"policyType": "BuiltIn",
"description": "This policy enables you to restrict the locations your organization can specify when deploying resources. Use to enforce your geo-compliance requirements.",
"parameters": {
"listOfAllowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of locations that can be specified when deploying resources.",
"strongType": "location",
"displayName": "Allowed locations"
}
}
},
"policyRule": {
"if": {
"not": {
"field": "location",
"in": "[parameters('listOfAllowedLocations')]"
}
},
"then": {
"effect": "Deny"
}
}
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "e56962a6-4747-49cd-b67b-bf8b01975c4c"
}

关于azure - 仅允许在 Azure 中选择特定区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52838163/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com