我有一个服务主体,它是某个存储容器中的数据Blob贡献者。我检查了,可以使用Azure CLI在该容器中上传/下载/删除Blob
--auth-mode login
参数,而不传递访问密钥。
然而,当我跑步时
terraform init
对于针对相同存储容器的相同服务主体,我得到的是:
Initializing the backend...
â·
â Error: Failed to get existing workspaces: Error retrieving keys for Storage Account "app541certfremotebackend": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="AuthorizationFailed" Message="The client '53bfcd5f-0906-4043-bda0-84cacf6ce9d0' with object id '53bfcd5f-0906-4043-bda0-84cacf6ce9d0' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/4...d/resourceGroups/a...2/providers/Microsoft.Storage/storageAccounts/a...d' or the scope is invalid. If access was recently granted, please refresh your credentials."
â
â
âµ
使用访问密钥需要我们授予服务主体一个包含操作的角色
Microsoft.Storage/storageAccounts/listKeys/action
。最接近的内置角色是
Reader And Data Access
。
我真的不喜欢它,因为有了访问密钥,就不可能访问存储帐户中的所有存储容器了吗?
是否可以通过利用RBAC使其在没有访问密钥的情况下工作?