Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MgBetaDeviceAppManagementTargetedManagedAppConfiguration can create, but not update?! #5671

Open
dannyKBjj opened this issue Jan 25, 2025 · 0 comments

Comments

@dannyKBjj
Copy link
Contributor

dannyKBjj commented Jan 25, 2025

Update-MgBetaDeviceAppManagementTargetedManagedAppConfigurationApp @params only works if you do not include 'apps' in the hashtable. Otherwise you will get the error:

"Update-MgBetaDeviceAppManagementTargetedManagedAppConfiguration : Cannot apply PATCH to navigation property 'apps' on entity type 'microsoft.management.services.api.targetedManagedAppConfiguration'.
Status: 400 (BadRequest)"

New-MgBetaDeviceAppManagementTargetedManagedAppConfigurationApp @params works fine, so presumably this is a bug.

Used graph explorer to investigate:

https://graph.microsoft.com/v1.0/deviceAppManagement/targetedManagedAppConfigurations//apps/

retrieves the apps just fine.

There is another URI https://graph.microsoft.com/v1.0/deviceAppManagement/targetedManagedAppConfigurations/{targetedManagedAppConfiguration-id}/apps/{managedMobileApp-id}

It isn't obvious how to retrieve a valid {managedMobileApp-id}, but tried some app Ids retreived from the previous graph request (e.g 'com.asana.app.android') and also some bundleIds, but it comes up with:
"No OData route exists that match template ~/singleton/navigation/key/navigation/key with http verb GET for request /MAMAdmin_2412/MAMAdminFEService/deviceAppManagement/targetedManagedAppConfigurations

probably not surprising as i'd expect it to be a guid? However, there seems to be no way to retrieve a valid Id.

Graph explorer did reveal the Update-MgBetaDeviceAppManagementTargetedManagedAppConfigurationApp cmd-let, but that won't work without a valid {managedMobileApp-id}

Also tried retriving an Id using Get-MgBetaDeviceAppManagementMobileApp

$mobileApp = Get-MgBetaDeviceAppManagementMobileApp | Where-object {$_.AdditionalProperties.bundleId -eq "com.asana.Asana"}

Same problem...

Can anyone help?!

dannyKBjj added a commit to dannyKBjj/Microsoft365DSC that referenced this issue Jan 26, 2025
Mostly fixes issue microsoft#5566 where the applications part of the policy was completely ignored.

Module will now detect drift when Apps are changed, and is able to correctly recreate the policy when deleted. There seems to be a problem with MgGraph that means for now, 'update' will not work. Added verbose message for now, left code that should do the 'update' commented out.

Issue has been reported here: microsoft#5671 and here https://feedbackportal.microsoft.com/feedback/idea/c0940cc8-d7da-ef11-95f6-0022484d7a88
dannyKBjj added a commit to dannyKBjj/Microsoft365DSC that referenced this issue Jan 26, 2025
Have added a number of missing properties for the resource and added test/create support for 'Applications'

Unfortunately unable to fix 'update' due to what looks like an MgGraph issue. Added a verbose message to the code to warn the user..

reported here:
microsoft#5671

and here:
 https://feedbackportal.microsoft.com/feedback/idea/c0940cc8-d7da-ef11-95f6-0022484d7a88

Similarly the module cannot support the 'Application Catalogue Settings' either. I can find them in Graph explorer but the related cmdlet doesn't work and cannot retrieve using invoke-mgGraph either.

Issue reported here
https://feedbackportal.microsoft.com/feedback/idea/f77feb49-11dc-ef11-95f6-0022484d7a88

and here
microsoft#5672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant