Azure Lei Zhang的博客

weibo: LeiZhang的微博/QQ: 185165016/QQ群:319036205/邮箱:leizhang1984@outlook.com/TeL:139-161-22926

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  489 随笔 :: 0 文章 :: 417 评论 :: 70万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

  《Windows Azure Platform 系列文章目录

 

  我们把一个资源从资源组A移动到资源组B的时候,如果这时候有其他人对资源组A或者资源组B的时候,会遇到创建失败的错误,并且会提示该资源组正在被移动,所以无法部署

  其实我们可以自定义角色(Custom Role),拒绝某些用户移动Azure资源。

  在创建custom role的时候,需要至少有以下权限:

  • 在源资源组上,需要Microsoft.Resources/subscriptions/resourceGroups/moveResources/action
  • 在目标资源组上,需要Microsoft.Resources/subscriptions/resourceGroups/write

 

  我们可以在custom role的时候,设置如下信息:

  • 自定义Role Name为CannotMoveResource
  • Action为*,表示可以执行任何操作,类似于Owner
  • Not Action为Microsoft.Resources/subscriptions/resourceGroups/moveResources/action,不允许移动资源
复制代码
{
    "properties": {
        "roleName": "CannotMoveResource",
        "description": "",
        "assignableScopes": [
            "/subscriptions/3851f1a6-e76d-4c8b-b204-0809652cbe98/resourceGroups/20221124-rg"
        ],
        "permissions": [
            {
                "actions": ["*"],
                "notActions": ["Microsoft.Resources/subscriptions/resourceGroups/moveResources/action"],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
复制代码

  

 

  

posted on   Lei Zhang的博客  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2017-12-27 Windows Azure Platform Introduction (14) 申请海外的Windows Azure账户
2016-12-27 Azure Application Gateway (4) 设置URL路由 - PowerShell
2016-12-27 Azure Application Gateway (3) 设置URL路由
2013-12-27 [SDK2.2]Windows Azure Virtual Network (2) 创建简单的Virtual Network
2012-12-27 [New Portal]Windows Azure Cloud Service (33) 使用Visual Studio 2012 部署Cloud Service
点击右上角即可分享
微信分享提示