[BUG] Publisher sends GraphQL schema to service-level API path instead of workspace path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start in the publisher's GraphQL schema PUT path construction and compare it with the workspace-aware API path described in the issue. Reproduce by publishing a GraphQL API in an APIM workspace, then verify the request uses workspaces/{workspaceId}/apis/{apiId}/schemas/graphql and the deployment succeeds without the 403 error.
Written by the indexing model from the issue text.
Description
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
- Create a GraphQL API inside an APIM workspace.
- Run the extractor —
specification.graphqlis written correctly (extractor is unaffected). - Run the publisher against a different environment — it fails with 403.
- Dominant language
- C#
- Stars
- 448
- Forks
- 247
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/apiops
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/vscode-azurefunctions#5197 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
microsoft/microsoft-ui-reactor#1274 ·