I'm working with a client that needs automatic reporting on per user licensing based on groups, this can be obtained manually but Automaticaly is causing me a head ache
So far I have designed a flow that pulls the users in a group from AAD and once its done that it checks each user against the MS graph https://graph.microsoft.com/v1.0/users/@{items('Apply_to_each')?['id']}/licenseDetails
this element works fine, and Almost gives me what I need, the problem is it response in a JSON format with firstly allot more info than is needed but also in information that needs correlating.. (license type would appear as the below), this is a snip from the response.
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"skuId": "71f21848-f89b-4aaa-a2dc-780c8e8aac5b",
"skuPartNumber": "CPC_B_2C_8RAM_128GB",
"servicePlans": [
{
"servicePlanId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"servicePlanName": "M365_LIGHTHOUSE_PARTNER_PLAN1",
"provisioningStatus": "Success",
"appliesTo": "Company"
I have tried to use Parse JSON to allow me to retreieve the skuID and then using the below Schema but this fire out this error when I try
InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value cannot be parsed: 'Unexpected character encountered while parsing value: L. Path '', line 0, position 0.'.
{
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"skuId": {
"type": "string"
},
"skuPartNumber": {
"type": "string"
},
"servicePlans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"servicePlanId": {
"type": "string"
},
"servicePlanName": {
"type": "string"
},
"provisioningStatus": {
"type": "string"
},
"appliesTo": {
"type": "string"
}
},
"required": [
"servicePlanId",
"servicePlanName",
"provisioningStatus",
"appliesTo"
]
}
}
},
"required": [
"id",
"skuId",
"skuPartNumber",
"servicePlans"
]
}
}
}
}