microsoft / microsoft/azure-tools-for-java
Azure Explorer unusable for users with RBAC Reader role (403 on listKeys)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 262
- Forks
- 185
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 1
Description
This is duplicating an issue found in Rider's Azure Explorer plugin, the matching issue can be found here.
Below is the duplicated text from that issue posting:
Bug Report / Feature Request
Summary
Users who only have the Azure RBAC Reader role assigned cannot browse Storage Accounts
or Resource Groups in the Azure Explorer. The plugin silently fails or shows errors because
it unconditionally calls operations that require permissions beyond Reader.
Environment
- IDE: JetBrains Rider 2026.1.2
- Plugin version: 4.7.4
- Azure subscription: Reader role only (no Contributor/Owner)
Steps to Reproduce
- Sign in to Azure with an account that has Reader role only on the subscription
- Open the Azure Explorer tool window
- Expand Storage → click on any Storage Account node
Expected Behavior
Storage accounts are listed. The user can browse container/blob metadata available
via ARM (which Reader CAN access). Write actions (Delete, Create, Copy Key) are
hidden or disabled.
Actual Behavior
The plugin calls Microsoft.Storage/storageAccounts/listKeys/action when expanding
a Storage Account node (to obtain a connection string for data-plane access). Reader
does not have this permission, resulting in:
- A 403 AuthorizationFailed error
- The node fails to expand or shows a generic error
The same 403 also surfaces in BaseStorageAccountResourceDefinition.initEnv() when
connecting storage to a Run Configuration.
Root Cause (investigated)
The plugin has two layers of listKeys calls triggered by Reader-only accounts:
-
Node expansion (
StorageNodeProvider.java): When a Storage Account node is
expanded,StorageAccount::getSubModulesis invoked, which triggers the underlying
SDK to calllistKeysto authenticate against the data plane (Blob/Queue/Table/File).
Reader does not haveMicrosoft.Storage/storageAccounts/listKeys/action. -
Action contributors (
StorageActionsContributor.java): The context menu actions
Copy Connection String and Copy Primary Key always callgetConnectionString()
/getKey()regardless of permissions. These are visible even when they will always fail.
Additionally, write actions such as Delete and Create (registered in
ResourceCommonActionsContributor.java) are shown to all users regardless of their
RBAC role, leading to confusing "Access Denied" failures when invoked.
Suggested Fix
Add a Reader Mode setting (plugin Settings → Azure → "Reader access mode") that:
- Skips sub-module expansion for Storage Accounts — prevents
listKeysfrom
being called; shows a note like "Reader mode: key-based browsing unavailable" - Hides write context-menu actions — COPY_CONNECTION_STRING, COPY_PRIMARY_KEY,
DELETE, CREATE — for all resource types when reader mode is active - Gracefully handles 403 in
BaseStorageAccountResourceDefinition.initEnv()
rather than surfacing a raw exception
Optionally, a toolbar toggle on the Azure Explorer panel would allow quick switching
without going to Settings.
Auto-detection (inspecting the user's role assignments at login) would be an even
better long-term solution, but a manual toggle is a low-risk first step.
Workaround
None currently. Users with Reader-only access cannot use the Azure Explorer for
Storage at all.
References
- Azure RBAC built-in roles:https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
Microsoft.Storage/storageAccounts/listKeys/actionis NOT included in the Reader role- ARM read operations (list resource groups, list storage accounts by name) ARE available toReader
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read StorageNodeProvider.java and the StorageAccount.getSubModules path first, then inspect StorageActionsContributor.java, ResourceCommonActionsContributor.java, and BaseStorageAccountResourceDefinition.initEnv(). Done means Reader-only users can expand Storage Accounts without a listKeys 403, key and write actions are unavailable when appropriate, and initEnv() handles the authorization failure gracefully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, java
- Domain
- authorization, cloud, devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100