Set Up Permissions for Microsoft Entra ID Authentication to Azure Blob Storage#
Assign the Azure roles a user needs to connect to Azure Blob Storage with the Azure (Microsoft Entra ID) connection profile.
Refer to Azure Blob Storage for how to connect.
Required Permissions#
A user needs the following two permissions on the storage account:
Permission |
Granted by |
Used for |
|---|---|---|
Read, write and delete containers and blobs |
A data role such as Storage Blob Data Reader (read only), Storage Blob Data Contributor or Storage Blob Data Owner |
Browsing and transferring files |
|
The custom role created below, or the Owner role |
Get Account Information, which Cyberduck uses to detect whether the account has a hierarchical namespace enabled |
None of the data roles includes the action getInfo/action, which is why it is granted with a separate custom role containing only that action.
Warning
Avoid assigning Storage Account Contributor only to obtain this permission. It includes Microsoft.Storage/storageAccounts/*, which allows to create and delete storage accounts, change their configuration and to list and regenerate the account keys.
Step 1: Create the Custom Role#
Create the role once per subscription. It contains the single action Microsoft.Storage/storageAccounts/blobServices/getInfo/action.
Replace <subscription-id> with the ID of the subscription containing the storage account.
Sign in and select the subscription.
az login az account set --subscription <subscription-id>
Save the role definition as
storage-account-info-reader.json.{ "Name": "Storage Account Information Reader", "Description": "Allows to read the account information of a storage account such as whether a hierarchical namespace is enabled.", "Actions": [ "Microsoft.Storage/storageAccounts/blobServices/getInfo/action" ], "NotActions": [], "DataActions": [], "NotDataActions": [], "AssignableScopes": [ "/subscriptions/<subscription-id>" ] }
Create the role.
az role definition create --role-definition @storage-account-info-reader.json
Save the role definition as
storage-account-info-reader.json.{ "properties": { "roleName": "Storage Account Information Reader", "description": "Allows to read the account information of a storage account such as whether a hierarchical namespace is enabled.", "assignableScopes": [ "/subscriptions/<subscription-id>" ], "permissions": [ { "actions": [ "Microsoft.Storage/storageAccounts/blobServices/getInfo/action" ], "notActions": [], "dataActions": [], "notDataActions": [] } ] } }
Open the subscription in the Azure portal and choose Access control (IAM).
Choose Add → Add custom role.
For Baseline permissions choose Start from JSON and select the file
storage-account-info-reader.json.Choose Review + create and then Create.
Step 2: Assign the Roles#
Assign both the data role and the custom role to the user or group on the storage account. Assigning a role to a group avoids repeating the steps for every user.
Look up the resource ID of the storage account.
az storage account show --name <account> --query id --output tsvAssign the data role. Replace
<assignee>with the user principal name (such asuser@example.com), or with the object ID of a user or group, and<scope>with the resource ID from the previous step.az role assignment create --assignee <assignee> --role "Storage Blob Data Contributor" --scope <scope>Use
Storage Blob Data Readerinstead for read-only access.Assign the custom role created in step 1.
az role assignment create --assignee <assignee> --role "Storage Account Information Reader" --scope <scope>
Open the storage account in the Azure portal and choose Access control (IAM).
Choose Add → Add role assignment.
In Role, select Storage Blob Data Contributor (or Storage Blob Data Reader for read-only access) and choose Next.
In Members, choose Select members, pick the user or group and choose Select, then Review + assign.
Repeat the steps to assign the custom role Storage Account Information Reader, which is listed in the Job function roles tab.
Note
It can take several minutes until a new role assignment takes effect. If the user is already signed in with Cyberduck, disconnect and connect again to use a new access token.
Step 3: Verify the Assignments#
List the assignments of the user on the storage account, including those inherited from the subscription or a group.
az role assignment list --assignee <assignee> --scope <scope> --include-inherited --include-groups --output table
The output must list the data role and Storage Account Information Reader. Test that the data role works by listing the containers.
az storage container list --account-name <account> --auth-mode login
In the storage account choose Access control (IAM) → Check access, select the user and verify that both roles are listed under Role assignments. Roles inherited from the subscription or a resource group are listed with their scope.
Connect with the Azure (Microsoft Entra ID) connection profile in Cyberduck to confirm.
Troubleshooting#
Hierarchical namespace (Azure Data Lake Storage)#
Accounts with a hierarchical namespace additionally evaluate POSIX-like access control lists (ACLs) when no data role grants access. Assign a data role to avoid maintaining ACLs.