Azure / Azure/azure-cli-extensions

[costmanagement] az costmanagement export uses old version of Exports API incompatible with Exports created using the latest API version..

Open
#10,007 2 comments 1 reaction 2 assignees Claimed by @a0x1ab View on GitHub
Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

Source: https://github.com/Azure/azure-cli/issues/32769 (by @rigofundora)
Affected extension: `costmanagement` (`src/costmanagement/`)

---

<<>>
# Issue #32769 (by @rigofundora)
## Title
az costmanagement export uses old version of Exports API incompatible with Exports created using the latest API version..

## Body
### Describe the bug

"az costmanagement export" uses an old API version which is not compatible with Exports that were created with the latest Exports API's (API versions 2025-03-01 and 2023-07-01-preview.). The Azure portal currently uses the latest Export API version (2025-03-01) during creation. Therefore, if you create an Export in the Azure Portal using the GUI; you won't be able to view nor manage that same Export using "az costmanagement export" due to the incompatibility of API versions.

Please find below some examples of this issue:

**az costmanagement export list**

**API version used by command**: 2020-06-01
**Issue description:** Incompatible with Exports created using API versions 2025-03-01 and 2023-07-01-preview. When you run the command, any Export created with API versions 2025-03-01 and 2023-07-01-preview will not show in the response. No error message.

**az costmanagement export show**

**API version used by command:** 2020-06-01
**Issue description:** Incompatible with Exports created using API versions 2025-03-01 and 2023-07-01-preview. When running the command for an Export created with API versions 2025-03-01 and 2023-07-01-preview, the API returns a 404 not found response, even when the Export exists in the given scope.

**az costmanagement export delete**

**API version used by command:** 2020-06-01
**Issue description:** Incompatible with Exports created using API versions 2025-03-01 and 2023-07-01-preview. When running the command for an Export created with API versions 2025-03-01 and 2023-07-01-preview, the API returns a 404 not found response, even when the Export exists in the given scope.

### Related command

az costmanagement export list
az costmanagement export show
az costmanagement export delete
az costmanagement export update
az costmanagement export create

### Errors

{"error":{"code":"404","message":"No export found for {Export_Name}, Enrollment: 123456789. (Request ID: 9d483edb-98e0-4099-bbc1-7efe54f940b0)"}}

### Issue script & Debug output

PS C:\Users\user> az costmanagement export show --name "export_name" --scope "providers/Microsoft.Billing/billingAccounts/12456789" --debug
cli.knack.cli: Command arguments: ['costmanagement', 'export', 'show', '--name', 'export_name', '--scope', 'providers/Microsoft.Billing/billingAccounts/12456789', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
Enable VT mode.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'costmanagement': ['azext_costmanagement']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: costmanagement 0.977 2 6 C:\Users\user\.azure\cliextensions\costmanagement
cli.azure.cli.core: Total (1) 0.977 2 6
cli.azure.cli.core: Loaded 2 groups, 6 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : costmanagement export show
cli.azure.cli.core: Command table: costmanagement export show
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\user\.azure\commands\2026-02-10.17-39-44.costmanagement_export_show.28148.log'.
az_command_data_logger: command args: costmanagement export show --name {} --scope {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x000002235EF46B60>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x000002235EF98EA0>, .add_cache_arguments at 0x000002235EF99080>, .update_breaking_change_info at 0x000002235EF99120>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x000002235EF98F40>]
az_command_data_logger: extension name: costmanagement
az_command_data_logger: extension version: 1.0.0
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=CostManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\\Users\\user\\.azure\\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\user\.azure\msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891
msal.authority: openid_config("https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic', 'self_signed_tls_client_auth'], 'jwks_uri': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/12334567-12345-12345-12345-1234567891/kerberos', 'mtls_endpoint_aliases': {'token_endpoint': 'https://mtlsauth.microsoft.com/12334567-12345-12345-12345-1234567891/oauth2/v2.0/token'}, 'tls_client_certificate_bound_access_tokens': True, 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? True
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token_info: scopes=('https://manag
... [truncated, original was 15101 chars]

## Comments
### Comment by @yonzhan

Thank you for opening this issue, we will look into it.

### Comment by @microsoft-github-policy-service[bot]
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ms-premp, @ramaganesan-rg.

<<>>

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.