Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] Publisher sends GraphQL schema to service-level API path instead of workspace path

未关闭
#861 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
azure, csharp, graphql
领域
api, cloud

调研方向

从 publisher 中 GraphQL schema 的 PUT 路径构造入手,并将其与 issue 中描述的 workspace-aware API 路径进行比较。在 APIM workspace 中发布一个 GraphQL API 以重现问题,然后验证请求使用 workspaces/{workspaceId}/apis/{apiId}/schemas/graphql,并且部署成功且不会出现 403 错误。

由索引模型根据 Issue 内容生成。

描述

Release version

APIOps Toolkit for Azure APIM v7.0.2

Describe the bug

When publishing a GraphQL API that belongs to a workspace, the publisher constructs the wrong URI for the GraphQL schema PUT. It targets the service-level API schemas endpoint instead of the workspace-scoped one, causing a 403 AuthorizationFailed error.

The failing request:

PUT .../service/{serviceName}/apis/{apiId}/schemas/graphql

Expected request:

PUT .../service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/graphql
Expected behavior

Publisher successfully PUTs the GraphQL schema to workspaces/{workspaceId}/apis/{apiId}/schemas/graphql and the API deploys without error.

Actual behavior

Publisher fails with HTTP 403:

System.Net.Http.HttpRequestException: HTTP request to URI
https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/
Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/graphql
?api-version=2024-05-01 failed with status code 403.
Content is '{"error":{"code":"AuthorizationFailed","message":"The client '...'
does not have authorization to perform action
'Microsoft.ApiManagement/service/apis/schemas/write' over scope
'.../service/{serviceName}/apis/{apiId}/schemas/graphql'
or the scope is invalid."}}'.
Reproduction Steps
  1. Create a GraphQL API inside an APIM workspace.
  2. Run the extractor — specification.graphql is written correctly (extractor is unaffected).
  3. Run the publisher against a different environment — it fails with 403.
主要语言
C#
星标
448
派生
247
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/apiops 的其他 Issue

查看 Azure/apiops 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。