1

https://learn.microsoft.com/en-us/rest/api/resources/resourcegroups/createorupdate

Authentication for this call is Azure Active Directory OAuth2 Flow, however I am unable to use impersonation and it will be running as a function.

To call the graph api I would set up something like this.

var nvc = new List<KeyValuePair<string, string>>();
nvc.Add(new KeyValuePair<string, string>("client_id", Config.ServicePrincipalId));
nvc.Add(new KeyValuePair<string, string>("scope", "https://graph.microsoft.com/.default"));
nvc.Add(new KeyValuePair<string, string>("client_secret", Config.ServicePrincipalKey));
nvc.Add(new KeyValuePair<string, string>("grant_type", "client_credentials"));

Any idea what my scope would be for this call or a good reference on where I can find scopes for creating a bunch of different things in Azure?

TIA

1 Answer 1

1

First of all, you can't manage Azure resources with Graph API, so you don't need it. And you absolutely correctly referred to the Azure Resource Manager Rest API, just use the client credential OAuth flow (instead of using user impersonation) to get access token with which you can then call API. Something like this:

Azure Resource Manager API

Or you can use SDK, here is C# example:

Resource Manager SDK

Sign up to request clarification or add additional context in comments.

1 Comment

Thats exactly what I needed. Thank you very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.