-
Create or Open Your Flow:
- Go to Power Automate.
- Create a new flow or open your existing flow where you are trying to retrieve the license details.
-
Configure the HTTP Action for Access Token:
- Add a new HTTP action to obtain the access token.
- Configure it as follows:
- Method:
POST - URL:
https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token- Replace
{tenant-id}with your Azure tenant ID.
- Replace
- Headers:
json
{
"Content-Type": "application/x-www-form-urlencoded"
} - Body:
plaintext
client_id=YOUR_CLIENT_ID&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials
- Method:
-
Extract the Access Token:
- Add a "Parse JSON" action to parse the response from the token request.
- Use the following schema:
json
{
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
}
-
Configure the HTTP Action for License Details:
- Add another HTTP action to get the license details.
- Configure it as follows:
- Method:
GET - URL:
https://graph.microsoft.com/v1.0/users/{user-id}/licenseDetails- Replace
{user-id}with the actual user ID or dynamic content.
- Replace
- Headers:
json
{
"Authorization": "Bearer @{body('Parse_JSON')?['access_token']}",
"Content-Type": "application/json"
}
- Method:
