Forum Discussion
EPNAdam
Apr 24, 2025Iron Contributor
onBehalfOfUserMri cannot be null or empty - Team installedApps
Hi, Posting this in the Graph community as I suspect the issue is Graph related since I can reproduce this via PowerShell script as well. Anyone else with this issue? Reading up on the https://lear...
EPNAdam
Apr 24, 2025Iron Contributor
Some additional details:
Test code to reproduce the issue I used as follows and the App I'm trying to add is the Dynamics 365 App.
As mentioned, it has been working for years.
...
$teamsAppId = "cd2d8695-bdc9-4d8e-9620-cc963ed81f41" # Dynamics 365 App
$requestBody = @{
# Note {at sign} shall be @
"teamsApp{at sign}odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/$teamsAppId"
} | ConvertTo-Json -Compress
$installParams = @{
Method = 'Post'
Uri = "https://graph.microsoft.com/v1.0/teams/$teamId/installedApps"
Headers = @{
'Authorization' = "Bearer $token"
'Content-Type' = 'application/json'
}
Body = $requestBody
ErrorAction = 'Stop'
}
$response = Invoke-RestMethod @installParams
Write-Host "Teams app installed successfully" -ForegroundColor Green