microsoftgraph / powershell-intune-samples

This repository of PowerShell sample scripts show how to access Intune service resources. They demonstrate this by making HTTPS RESTful API requests to the Microsoft Graph API from PowerShell.
MIT License
1.36k stars 657 forks source link

Graph API to create androidManagedStoreAppConfiguration giving 403 #175

Open rahulnagar-bb opened 3 years ago

rahulnagar-bb commented 3 years ago

The Microsoft graph API for androidManagedStoreAppConfiguration always giving 403 Forbidden error, while permissions required to call this API as background application already given to app. The API is working when we authenticate with user credentials but always giving 403 when calling as application-level with admin consent.

Please find the details as: Request: https://graph.microsoft.com/beta/deviceAppManagement/mobileAppConfigurations Body: { "profileApplicability": "default", "roleScopeTagIds": [], "packageId": "Package Id value", "payloadJson": "Payload Json value", "permissionActions": [], "description": "Description value", "displayName": "Display Name value", "targetedMobileApps": [ "78275341-6d68-4f17-8755-d05f7c4bdf9a" ], "@odata.type": "#microsoft.graph.androidManagedStoreAppConfiguration" }

Request Type: POST Authentication Type: Consented by Administrator Authentication Scope: .default Permissions: DeviceManagementApps.ReadWrite.All

Call Reference: https://docs.microsoft.com/en-us/graph/api/intune-apps-androidmanagedstoreappconfiguration-create?view=graph-rest-beta

Even after providing all application-level permission just to check if some permission causing issue, it's still giving 403-Forbidden.

Please advise if anyone has some leads.