Forum Discussion
Power BI and Intune MobileApps
- 1 year ago
Hello Anonymous
I tried your solution but it didn't work. I was able to find a solution on my own and this is how I managed it.
// Step 1 : Get Token
resource = "https://graph.microsoft.com",
tokenResponse = Json.Document(Web.Contents("https://login.windows.net/",
[
RelativePath = #"Azure AD Tenant ID" & "/oauth2/token",
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = #"Azure Application Client ID",
resource = resource,
grant_type = "client_credentials",
client_secret = #"Azure Application Client Secret"
]
)),
Headers = [Accept = "application/json"], ManualStatusHandling = {400}
])),
access_token = tokenResponse[access_token],
// Step 2 : Query MS Graph URL
SourceAssignmentApps = Web.Contents("https://graph.microsoft.com/beta/deviceAppManagement/mobileApps?$select=id&$expand=assignments",[ Headers = [ Authorization = "Bearer " & access_token, Accept = "application/json" ] ]),// Handle json to retrieve values
parsedJsonAssignmentApps = Json.Document(SourceAssignmentApps),
metadataAssignmentApps = Record.ToTable(parsedJsonAssignmentApps),
ValueAssignmentApps = metadataAssignmentApps{2}[Value],
I hope this helps others.Have a nice day
Hi Jerome_C63,
Sure! Here's a rephrased version of your message:
Thanks for sharing the solution! If you could kindly mark your response as the "Accepted Solution", it would really help others in the community who might face a similar issue. It’ll make it easier for them to find the answer quickly.
Thanks & regards,
Prasanna Kumar