New-MgExternalConnectionItem returns 404 errors
Describe the bug
I am trying to create new external connection items for an external connector, and I get a 404 not-found error message in response. Here is the command I use- $newItem = New-MgExternalConnectionItem -ExternalConnectionId "samplecon" -id $id -Properties $props -Content $content -Acl $acl
A fiddler trace of the above call shows this- POST https://graph.microsoft.com/v1.0/external/connections/samplecon/items
The body is this- { "id": "R06", "acl": [ { "accessType": "grant", "type": "everyoneExceptGuests", "value": "56713e33-e7c4-4ce4-ac45-a4ae33ab87b7" } ], "properties": { "title": "Adding Test Items", "language": "hu-HU", "floor": [ "London_B1" ], "[email protected]": "Collection(String)", "recordId": "R06" }, "content": { "type": "text", "value": "A new item R06" } }
Expected behavior
I expect the new-item to be created and stored in the $newItem variable.
How to reproduce
- connect with MGGraph- Connect-MgGraph -ClientId "{client_id}" -TenantId "{tenant}.onmicrosoft.com" -certificate $x509Cert
#Make sure the app has ExternalConnection.ReadWrite.OwnedBy | ExternalConnection.ReadWrite.All and ExternalItem.ReadWrite.OwnedBy | ExternalItem.ReadWrite.All
This might be an issue with our metadata resulting in a POST as that's the verb for a create. But as this is noted to work as a PUT request which is usually for an update but appears to be working as an upsert