You should have the following ready to test the functionality using Postman:
- OAuth 2.0 token endpoint, you can get this in the Endpoints tab of Azure AD and grab the URL:
- Grant type: A hardcoded client_credentials value.
- Client ID of the client application: You noted it in the fourth step of the Registering the client app in Azure AD section.
- Key that you generated for your client application: You noted it in the fifth step of the Registering the client app in Azure AD section.
- Resource: Resource to which we need to access. It's the client ID of the backend application; you noted it in the fourth step of the Configuring Azure AD to the function app section.
- Once you have all that information, you need to pass all the parameters and make a call to an Azure AD tenant, which returns the bearer token as follows:
- The next and final step is to make a call to the actual backend (the Azure Function HTTP trigger) by passing the bearer JWT token (access_token) that we copied from the preceding screen:
- As shown in this screenshot, add an Authorization header and paste the JWT token. Don't forget to provide the text bearer word.