question

BelaguliVijayakumarAdarsha-3880 avatar image
0 Votes"
BelaguliVijayakumarAdarsha-3880 asked ·

is there any way in api for azure subscription role assignments

In Azure portal,
Under Home - Subscriptions - Microsoft Azure - Access control (IAM) - Role Assignments tab - I want to add New Role assignment.
Is there any possibilitlity to achieve this using microsoft partner api rather than manually using portal UserInterface?
If yes, Please give detailed steps to use the api.

partner-center-api
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DennisGuo-0699 avatar image
2 Votes"
DennisGuo-0699 answered ·

We can use REST API below to achieve it.

 https://management.azure.com/subscriptions/CustomerSubscriptionID/providers/Microsoft.Authorization/roleAssignments/GUID(need to generated)?api-version=2015-07-01

The following article with step by step for your reference.

How to use REST API to assign CSP subscription roles to new created CSP customer .


More information:

Add or remove role assignments using Azure RBAC and the REST API


Add or remove role assignments using Azure RBAC and Azure PowerShell





· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BelaguliVijayakumarAdarsha-3880, I hope @DennisGuo-0699, response has helped you in answering your query. If yes, please do not forget to mark the response as "Answered", so that it helps others also.

0 Votes 0 · ·
soumi-MSFT avatar image
0 Votes"
soumi-MSFT answered ·

@BelaguliVijayakumarAdarsha-3880, The Microsoft Partner API can only perform the following operations as documented here:

  1. Create a referral

  2. Update a referral

  3. Get a list of referrals

  4. Get a referral by ID

  5. Get a price sheet

  6. Get foreign exchange rates

You can consider using Microsoft Graph API if you intend to programatically perform the New Role Assignment for RBAC. To perform Role Assignments using Microsoft Graph API, you can find the API details here.

Hope this helps. Please do mark this response as "Answered" if the response helped in answering your query.




· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank You very much for the quick response.
I have gone through the documentation and understood at the high level.
Could you please send me an example, where create role assignment to a user is done for a subscription.

0 Votes 0 · ·