REST token from Azure powershell script

I need to pull some data back from azure that i can only get at with the azure rest API. Do you guys have an example of run an azure powershell script and pulling out the auth token so i can build a header and make the rest call?
thanks
tim

Hi Tim,

Thanks for getting in touch! I’ve asked around the development team and we don’t have any examples of pulling out the token to use in REST calls.

The code we use in Calamari is open source, so if you want to see how we authenticate the Powershell context have a look on GitHub. You may be able to do something similar and run another authenticate to get the data you need for authenticating the calls.

Alternatively, Microsoft have a sample on authenticating the API calls that might be of use.

Hope that helps!

Shannon