[Bug]: get_pricesheet_status returns "Unknown" although the price sheet is ready (link is in publishedEntity.properties.downloadUrl)

Open Beginner friendly
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
azure
Domain
cloud

Research direction

Find the CostManagement implementation of get_pricesheet_status and trace how it parses the operation status response. Check whether it reads publishedEntity.properties.downloadUrl and expiryTime, using the response shape in the issue as the guide. Add coverage for that response shape and confirm the tool returns the link and expiry after completion.

Written by the indexing model from the issue text.

Description

bug
Description

For a Microsoft Partner Agreement billing account, start_pricesheet_download (agreementType MCA_Invoice, invoice scope) is accepted and returns an operationStatusUrl. get_pricesheet_status on that URL never returns the download link: after InProgress it answers Unknown with "no downloadUrl was present in the response" indefinitely.

Reading the same operationStatusUrl directly (same identity, same URL, all query parameters kept) returns HTTP 200 with the link after 60–90 seconds. The link is in publishedEntity.properties.downloadUrl, not in a top-level downloadUrl or properties.downloadUrl. The tool appears to look only at the top level.

Steps to Reproduce
  1. Identity with Billing account reader on a Microsoft Partner Agreement billing account.
  2. Call start_pricesheet_download with agreementType = MCA_Invoice and scope = /providers/Microsoft.Billing/billingAccounts/<account>/billingProfiles/<profile>/invoices/<invoice> (the invoice's billingProfileId + /invoices/ + invoice name).
  3. The tool answers Accepted with an operationStatusUrl.
  4. Call get_pricesheet_status with that operationStatusUrl every 60 seconds.
  5. In parallel, GET the same operationStatusUrl directly (same token, unchanged URL).
Expected Behavior

get_pricesheet_status returns the download link (and its expiry) once the operation completes, as the direct GET of the same URL does.

Actual Behavior

First poll: {"status":"InProgress","retryAfterSeconds":60,"message":"Pricesheet generation still in progress. Poll again after 60 seconds."}
Every poll after that, for 20+ minutes:
{"status":"Unknown","message":"Operation status=Unknown but no downloadUrl was present in the response."}

Direct GET of the same operationStatusUrl after 60–90 s: HTTP 200, body fields:
locationHeaderUri=null; asyncHeaderUri=null; operationId=null; errorMessage=null;
publishedEntity.id=/providers/Microsoft.CostManagement/billingAccounts//pricesheets/default;
publishedEntity.type=Microsoft.Billing/pricesheets;
publishedEntity.properties.downloadUrl=;
publishedEntity.properties.rawUrls[0]=;
publishedEntity.properties.expiryTime=

VSCode Version

Not used. Claude (claude.ai) custom connector through agentgateway to the hosted ARM MCP; reproduced with direct MCP JSON-RPC calls from PowerShell 7 (no IDE).

ARM MCP Server Version

Hosted endpoint https://mcp.management.azure.com, CostManagement toolset, 10 Nov 2026.

Model Being Used

Claude (Anthropic) via a claude.ai connector; also reproduced without a model (direct MCP calls).

Trace ID

Not returned by these calls.

Logs / Screenshots

Additional Context
  • Reproduced with a user identity (Billing account owner) and an app identity (Billing account reader): the direct GET returns the link for both, so permissions are not the issue.
  • The operationStatusUrl returned by start_pricesheet_download is identical in path and query parameter names to the Location header from calling the REST API directly (POST .../invoices//providers/Microsoft.CostManagement/pricesheets/default/download, api-version 2023-11-01).
  • Reading the URL without its query parameters fails (HTTP 400), so clients can't work around it with get_resource on the bare path.
  • Suggested fix: also read publishedEntity.properties.downloadUrl / expiryTime in get_pricesheet_status.
Dominant language
No language data
Stars
30
Forks
6
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/Azure-Resource-Manager-MCP

All issues in Azure/Azure-Resource-Manager-MCP

Similar issues

More Cloud issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.