删除/添加存储帐户中的删除/添加用户角色时,Azure Automation帐户runbook错误

发布于 2025-01-26 13:31:01 字数 526 浏览 5 评论 0原文

当我尝试使用以下命令通过自动化帐户删除存储帐户上的用户,我会遇到错误

对象引用未设置为对象的实例

Remove-AzRoleAssignment -SignInName $emailid -RoleDefinitionName 
"Storage File Data SMB Share Contributor" -Scope "/subscriptions/00000-0000-00/resourceGroups/resourcegroupname/providers/Microsoft.Storage/storageAccounts/storageaccname"

”在此处输入图像描述”

When i'm trying to remove user on the storage account using below commands through automation account i'm getting error

object reference not set to instance of an object

Remove-AzRoleAssignment -SignInName $emailid -RoleDefinitionName 
"Storage File Data SMB Share Contributor" -Scope "/subscriptions/00000-0000-00/resourceGroups/resourcegroupname/providers/Microsoft.Storage/storageAccounts/storageaccname"

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惯饮孤独 2025-02-02 13:31:01

您可以遵循很少的解决方法来达到上述要求;

  • 确保您有遵循 < strong> 权限 到该订阅
    所有者或,用户访问管理员必须具有包括Microsoft.authorization.authorization/roleassignments/write Permissions)的角色才能分配或删除。

  • 如果您有上述权限检查在存储帐户中定义的角色与您提到的要删除相同的角色。或是否存在。

  • 并确保您要删除的角色,而不会显示为 继承的 ,因此您无法删除这些作业在儿童范围内分配。

有关更多信息,请参阅下面的链接: -

Few of the workaround you can follow to achieve the above requirement;

  • Make sure that you have following permission to that subscription
    Owner or, User Access Administrator(must have a role that includes Microsoft.Authorization/roleAssignments/write permissions) to assign or remove.

  • If you have above permission Check the role which have defined in storage account same as what you have mentioned want to remove. Or it exist or not.

  • And make sure that the role which you want to remove, that not showing as inherited If so you can not remove those assignments as you are trying to remove a role assignment at a child scope.

For more information please refer the below links:-

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文