there seems to have been a change in the Graph API, as it no longer returns a value for the userPrincipalName
parameter at the https://graph.microsoft.com/v1.0/applications/{appID}/owners
endpoint although an owner is defined.
"value": [
{
"@odata.type": "#microsoft.graph.user",
"id": "c76ed757-0dd0-458d-af13-xxxxxxxxx",
"businessPhones": [],
"displayName": null,
"givenName": null,
"jobTitle": null,
"mail": null,
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": null
}
]
Therefore the logic app tries to send an email to null, which fails.
Removing the owner from the app "fixes" it, as the Graph API now return an empty value which evaluates length(body('Get_Secret_Owner')?['value'])
is equal to
int('0')
to true.