Open manuel-falcao-magalhaes opened 1 year ago
Thanks for bringing this to our attention.
This is due to how the API is declared in the service metadata, our single source of truth for the SDKs. The API is described as supporting GET
, POST
, PATCH
, and DELETE
methods in the service metadata, which does not mirror what's described in the API reference. This results in us generating invalid commands for /contacts/*
APIs.
I'll surface this to the API owner for them to fix.
The workload owner has been informed via ICM #359099379.
Came across this issue doing some research after running into an error when attempting to remove an orphaned contacts (trying to move to graph over the older powershell modules where we can). The error I ran into (and potential work around) are below in code block :
Connect-MGGraph -Scopes Contacts.ReadWrite
Remove-MgContact -OrgContactId $ObjectID
#Response: Remove-MgContact_Delete1: Data contract version does not allow 'Delete' operations against instances of resource 'OrgContact'.
Select-MgProfile 'Beta'
Remove-MgContact -OrgContactId $ObjectID
Get-MgContact -OrgContactId $ObjectID
#Response: Get-MgContact_Get: Resource 'x'' does not exist or one of its queried reference-property objects are not present.
Not sure if expected, but it seems moving to the Beta profile fixed the issue for me, but not quite sure if this is the same issue OP reported, or a tangenitally related issue. The docs appear to be the same for v1.0 and beta.
I will say it's pretty common place for us to need to switch to a beta profile to get most modern functionality out of graph, as many of the things we use other powershell modules, Graph v1.0 just doesn't have what we need.
Any Updates on this?
Remove-MgContact calls "DELETE /contacts/{orgContact-id}", however the MS Graph API can only do read-only operations on orgContacts: (https://learn.microsoft.com/en-us/graph/api/resources/orgcontact?view=graph-rest-1.0)
"Additionally, organizational contacts are either synchronized from on-premises directories or from Exchange Online, and are read-only in Microsoft Graph."