Cannot make myself Synapse Administrator from CLI but only from Portal

Rafi Trad 61 Reputation points
2022-11-08T10:43:11.183+00:00

I am an owner on the subscription level. I created a Synapse workspace, and wanted to make myself its administrator from Azure CLI (cloud shell).

When running:

   az synapse role assignment create --workspace-name $SynapseWorkspaceName \  
     --role "Synapse Administrator" \  
     --assignee-object-id $MyId \  
     --assignee-principal-type User  

I am faced with the odd error:
(Unauthorized) The principal 'x-x-x-x' does not have the required Synapse RBAC permission to perform this action. Required permission: Action: Microsoft.Synapse/workspaces/read, Scope: workspaces/y/.
Code: Unauthorized
Message: The principal 'x-x-x-x' does not have the required Synapse RBAC permission to perform this action. Required permission: Action: Microsoft.Synapse/workspaces/read, Scope: workspaces/y/
.

Using --assignee or --scope is not changing anything.

If I use Portal, I am able to assign the role successfully. The user is the same, and from CLI I can assign other roles on other resources. Why is this happening when I am an owner?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,395 questions
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
672 questions
{count} votes

Accepted answer
  1. BhargavaGunnam-MSFT 26,306 Reputation points Microsoft Employee
    2022-11-09T21:25:04.94+00:00

    Hello @Rafi Trad ,

    As per the discussion with my internal team, for a user to be able to run the commands to add Synapse RBAC roles using CLI, the user themselves should have a Synapse Administrator role at the Synapse Studio level.

    When creating a workspace, the workspace owner automatically gets the Synapse administrator roles in the Synapse Studio.

    It seems like you have Synapse administrator roles on another synapse studio, due to this reason you were able to use CLI on that workspace.

    Please see the below documents explains the Synapse RBAC assignments in Synapse Studio

    https://learn.microsoft.com/en-us/azure/synapse-analytics/security/how-to-review-synapse-rbac-role-assignments
    https://learn.microsoft.com/en-us/azure/synapse-analytics/security/synapse-workspace-synapse-rbac#who-can-assign-synapse-rbac-roles

    I hope this helps. If you have any questions, please let me know.

    258800-image.png

    ------------------------------

    • Please don't forget to click on 130616-image.png and upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful