0
votes

How can I get an access token to use in REST requests from Azure by providing my credentials?

Basically, when you write Connect-AzAccount you enter your credentials and after that, you have some access token under the hood used by the other cmdlets.

I need to do some requests via REST because I don't have access to PowerShell and Az module in some environment.

What endpoint should I make a request to and by providing my credentials and my subscription id, get an access token as a response?

1

1 Answers

0
votes

The instructions to get access token and how to use Azure REST API is very well documented here: https://docs.microsoft.com/en-us/rest/api/azure.

In short, you will send the request to get authorization code and access token to https://login.microsoftonline.com. Once you get the access token, you will be making requests to https://management.azure.com endpoint to perform REST API operations against your Azure Subscription.