azure - 如何拒绝除某些用户之外的 Azure 中创建资源的权限

标签 azure azure-active-directory

除了某些用户之外,是否有任何内置角色拒绝在 az 订阅中创建资源的权限。一、

我使用了“不允许的资源类型”策略,但它适用于整个订阅。

最佳答案

我尝试在我的环境中重现相同的内容以拒绝在 Azure 中创建资源:

感谢Tiny Wang提出同样的建议。

  1. 读者角色分配给用户,以限制Azure中的资源创建,如下所示。<

Azure 门户 > 订阅 > 选择您的订阅 > 访问控制 (IAM) > 添加 > 添加角色分配。

enter image description here

分配了读者角色。

enter image description here

当我尝试在订阅中创建Azure VM时,同一用户出现授权错误。

enter image description here

Note: if you create an Azure policy to deny the resource creation, the policy will apply to the scope level, not to users.

Ex: Subscription, Resource Groups

enter image description here

我已创建一个策略并将其分配给资源组范围,以拒绝在资源组内创建资源。

当我尝试创建任何资源时,出现策略限制错误。

enter image description here

Azure 策略规则:

{
"mode": "All",
"policyRule": {
"if": {
"field": "type",
"in": "[parameters('listOfResourcesTypesNotAllowed')]"
},
"then": {
"effect": "Deny"
}
},
"parameters": {
"listOfResourcesTypesNotAllowed": {
"type": "Array",
"metadata": {
"displayName": "Not Allowed Resources creation",
"description": "The list of resources type that cannot be deployed.",
"strongType": "resourceTypes"
}
}
}
}

关于azure - 如何拒绝除某些用户之外的 Azure 中创建资源的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75331502/

相关文章:

node.js - Azure 队列不断通知待处理消息

Azure应用程序注册客户端 secret 过期

javascript - 在什么触发器上,我可以通过 MSAL 的 msalObj.acquireTokenSilent() 方法以静默方式获取 id_token?

c# - 无法加载文件或程序集“msshrtmi”,系统找不到指定的文件

c# - 在哪里可以找到 FluentMigrator 类?

azure - 通过 ARM 模板运行 powershell 命令会抛出 "The term ' Connect-AzureAD' 未被识别为 cmdlet 的名称”错误

azure - 如何修复 "ERROR: Invalid id_token. OpenSSL unable to verify data"

azure - 为什么我们需要在创建 Azure Key Vault 之前在 Azure Active Directory 中创建应用程序?

asp.net-mvc - Azure 网站/应用程序可以确定其实例的 CPU/内存使用情况吗?

azure - 将 Visual Studio Professional 订阅添加到 Azure 帐户