在 Azure 中,作为资源组贡献者,为什么我不能创建存储帐户,应该如何防止这种情况发生?

In Azure as a Resource Group contributor why can't I create Storage Accounts and what should be done to prevent this situation?

一位客户的订阅管理员授予我(一个 MS 帐户)他们的一个资源组的贡献者角色。

当我尝试在该资源组中创建存储帐户时,出现以下错误:

'AuthorizationFailed' does not have authorization to perform action 'Microsoft.Storage/register/action' over scope

我通过 Powershell 登录订阅并列出了可用的提供商,发现大多数都没有注册。 当我尝试注册时,出现该错误。

为什么他们没有注册?管理员应如何纠正此问题?以后在添加 Contributors 时应该怎么做才能避免这个问题?现在作为那个 RG 的贡献者,我不能做太多。

I logged into the Subscription via Powershell and listed the available providers, and found that most are not registered. When I try to register, I get that error.

您收到此错误的原因是订阅管理员已将您置于特定资源组的 Contributor 角色中。他们没有授予您对 Microsoft.Storage 资源提供者的任何许可。为了使用此资源注册订阅,您需要 Microsoft.Storage 资源提供者的 Write 权限。

您可以要求您的订阅管理员授予您适当的权限,或者他们可以向该资源提供商注册订阅。

更新 - 跟进问题

my understanding was that Contributor role simply allowed the specified user to create resources in the group.

你的理解是正确的。在资源组中拥有 Contributor 角色,您应该能够在其中创建资源。

At one point in this role assignment does the Subscription administrator specify which resources can be created and which not? Or is it that the limitation is somehow on the way the Subscription is set up?

嗯,是的,也不是。因此,如果您被分配了诸如 Contributor 之类的一揽子角色,您应该能够创建任何类型的资源。然而,使用 Custom Roles,管理员可以获得超级创意,并且只允许您创建特定类型的资源。但是,在创建某种资源之前,应向资源提供者注册订阅。

我对整个事情结构的理解是,Azure 中的每个产品团队都负责提供自己的功能。所有这一切的中心点是 Azure Resource Manager,它提供了 Role-based Access Control

让我们以 Azure 存储为例。与存储帐户交互的功能(从管理角度,如创建、删除等)由存储团队使用名为 Storage Resource Provider (SRP) 的东西提供。因此,如果您仔细观察,就会发现每个功能都有一个资源提供程序。由于我不知道的原因,默认情况下并非所有资源提供者都可用(可能是成本原因)并且订阅管理员必须向该资源提供者注册 his/her 订阅,以便可以在其中创建此类资源订阅。