web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Loading data from Azure AD and MS 365 Admin Center in Power Automate

Posted on by
Hello,
 
i want to load user- and company information from Azure Active Directory and license data from Microsoft 365 Admin Center using Power Automate and store them in Microsoft Dataverse.
 
I have tried it with Http Connector using Microsoft graph API, but i always get errors, eg.:
 
{
  "error": {
    "code": "BadRequest",
    "message": "Write requests (excluding DELETE) must contain the Content-Type header declaration.",
    "innerError": {
      "date": "2024-07-24T13:45:31",
      "request-id": "c6782682-1ec6-460a-91ba-3edc8158b0ed",
      "client-request-id": "c6782682-1ec6-460a-91ba-3edc8158b0ed"
    }
  }
}
 
Does anyone have a working solution for case? How can i load information from Azure AD and Microsoft 365 Admin Center?
 
Here the steps i did in Power Automate which unfortunatelly doesn't work:
  1. 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.
  2. 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.
      • 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
  3. 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"
      }
      }
      }
  4. 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.
      • Headers:
         
        json
        {
        "Authorization": "Bearer @{body('Parse_JSON')?['access_token']}",
        "Content-Type": "application/json"
        }
 
Thank you and best Regards
Lukas
PArt1.png
Part2.png

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard

Featured topics