Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

New-MgExternalConnectionItem returns 404 errors

未關閉
#3,375 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
powershell
領域
api

研究方向

從 New-MgExternalConnectionItem 進入點開始,將它產生的要求與 issue 中連結的 Microsoft Graph 新增項目文件進行比較。重現 POST 要求並確認 cmdlet 使用文件所述的項目 URL 和方法,然後確認命令成功儲存建立的項目。

由索引模型根據 Issue 內容生成。

描述

Status: Needs Investigation type:bug
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
  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_
主要語言
C#
星號
901
分支
232
平均合併
1 天 5 小時
30 天內合併 PR
20

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoftgraph/msgraph-sdk-powershell 的其他 Issue

查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。