microsoftgraph / microsoftgraph/msgraph-sdk-powershell

New-MgExternalConnectionItem returns 404 errors

Aperta
#3,375 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Status: Needs Investigation type:bug
Lingua principale
C#
Stelle
898
Fork
230
Merge medio
2g 5h
PR unite (30g)
31

Descrizione

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"
],
"floor@odata.type": "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
  1. 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

  1. create the external connection
    $newConnector = New-MgExternalConnection -BodyParameter $connector

  2. add the schema for the external connection
    $schemaUpdateResp = Update-MgExternalConnectionSchema -ExternalConnectionId $newConnector.Id -BodyParameter $schema

  3. add an external connection item to the connection
    $newItem = New-MgExternalConnectionItem -ExternalConnectionId "samplecon" -id $id -Properties $props -Content $content -Acl $acl

SDK Version

2.27.0 Microsoft.Graph.Search

Latest version known to work for scenario above?

?

Known Workarounds

The $id, $acl, and $props are all good because if I use fiddler to resend the request, but modify it to use the verb PUT and add the ID to the URL, it works. This is how the Graph REST API has in the documentation-
https://learn.microsoft.com/en-us/graph/connecting-external-content-manage-items#add-an-item

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal punto di ingresso New-MgExternalConnectionItem e confronta la richiesta che genera con la documentazione di Microsoft Graph per l’aggiunta di un elemento collegata nell’issue. Riproduci la richiesta POST e verifica che il cmdlet utilizzi l’URL e il metodo documentati per l’elemento, quindi conferma che il comando memorizzi correttamente l’elemento creato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
api
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.