-1

https://learn.microsoft.com/en-us/rest/api/appservice/webapps/listfunctions

enter image description here

How can I generate the token highlighted in green dynamically using JavaScript or an Api? I know it can be generated using Azure CLI az account get-access-token but that does not fit my solution to help me monitor my functions programmatically.

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30

1 Answers1

1

You can acquire the access token either using the OAuth2 service endpoints, or MSAL. OAuth2 endpoints are Platform- and language-neutral, but MSAL is not.

The two Azure AD endpoints that you use to authenticate your client and acquire an access token are referred to as the OAuth2 /authorize and /token endpoints. How you use them depends on the type of OAuth2 authorization grant flow you need to support your app.

For instance, a non-interactive client can use client credentials grant, wherein the access token can be acquired by sending a POST request to the /token endpoint.

From Postman:

Get AAD Token v2.0

For more information, refer to the Azure REST API reference.

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30