Get-AzCognitiveServicesModelCapacity does not support querying models with the Format "Mistral AI"
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Start at the Get-AzCognitiveServicesModelCapacity cmdlet and inspect how the ModelFormat parameter is validated, using the reported Mistral AI command as the reproducer. Compare it with the successful Invoke-AzRestMethod request. Done means formats containing spaces are accepted and the cmdlet returns the expected model capacity results.
Written by the indexing model from the issue text.
Description
Description
Running the follow command produces an error about an unmatched regex pattern in ModelFormat:
Get-AzCognitiveServicesModelCapacity -Location 'eastus2' -Format 'Mistral AI' -Name 'mistral-document-ai-2512' -Version '1'
Invoking the ARM API endpoint directly produces no error and returns expected results:
Invoke-AzRestMethod -Method GET -Uri 'https://management.azure.com/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.CognitiveServices/locations/eastus2/modelCapacities?api-Version=2026-01-15-preview&modelFormat=Mistral AI&modelName=mistral-document-ai-2512&modelVersion=1'
StatusCode : 200
Content : {
"value": [
{
"id": "/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.CognitiveServices/locations/eastus2/models/Mistral AI.mistral-document-ai-2512.1/skuCapacities/GlobalStandard",
"type": "Microsoft.CognitiveServices/locations/models/skuCapacities",
"name": "GlobalStandard",
"location": "eastus2",
"properties": {
"model": {
"format": "Mistral AI",
"name": "mistral-document-ai-2512",
"version": "1"
},
"skuName": "GlobalStandard",
"availableCapacity": 60,
"scopeType": "Classic",
"scopeId": "eastus2"
}
},
{
"id": "/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.CognitiveServices/locations/eastus2/models/Mistral AI.mistral-document-ai-2512.1/skuCapacities/DataZoneStandard",
"type": "Microsoft.CognitiveServices/locations/models/skuCapacities",
"name": "DataZoneStandard",
"location": "eastus2",
"properties": {
"model": {
"format": "Mistral AI",
"name": "mistral-document-ai-2512",
"version": "1"
},
"skuName": "DataZoneStandard",
"availableCapacity": 40,
"scopeType": "Classic",
"scopeId": "eastus2"
}
}
]
}
Headers : {
"Cache-Control": "no-cache",
"Pragma": "no-cache",
"X-Content-Type-Options": "nosniff",
"x-ms-request-id": "",
"x-envoy-upstream-service-time": "109",
"x-ms-operation-identifier": "",
"x-ms-ratelimit-remaining-subscription-reads": "249",
"x-ms-ratelimit-remaining-subscription-global-reads": "3749",
"x-ms-correlation-request-id": "",
"x-ms-routing-request-id": "",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Cache": "CONFIG_NOCACHE",
"X-MSEdge-Ref": "Ref A: Ref B: Ref C: 2026-05-19T14:18:50Z",
"Date": "Tue, 19 May 2026 14:18:50 GMT"
}
Method : GET
RequestUri : https://management.azure.com/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.CognitiveServices/locations/eastus2/modelCapacities?api-Version=2026-01-15-preview&modelFormat=Mistral AI&modelName=mistral-document-ai-2512&modelVersion=1
Version : 1.1
The cmdlet does not support ModelFormat values that include a space, but the ModelFormat value for Mistral includes a space:
Get-AzCognitiveServicesModel -Location 'eastus2' | Where { $_.ModelProperty.Name -eq 'mistral-document-ai-2512' } | Select -Expand ModelProperty -First 1
BaseModel :
IsDefaultVersion : False
Skus : {GlobalStandard, DataZoneStandard}
MaxCapacity : 3
Capabilities : {[chatCompletion, false], [area, US]}
FinetuneCapabilities :
Deprecation : Microsoft.Azure.Management.CognitiveServices.Models.ModelDeprecationInfo
LifecycleStatus : Stable
SystemData : Microsoft.Azure.Management.CognitiveServices.Models.SystemData
Publisher : Mistral AI
Format : Mistral AI
Name : mistral-document-ai-2512
Version : 1
Source :
SourceAccount :
CallRateLimit :
Issue script & Debug output
PS> Get-AzCognitiveServicesModelCapacity -Location eastus2 -Format 'Mistral AI' -Name 'mistral-document-ai-2512' -Version '1' -Debug
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:09:33 AM - GetAzureCognitiveServicesModelCapacityCommond begin processing with ParameterSet 'DefaultParameterSet'.
DEBUG: 10:09:33 AM - using account id '<USER ID>'...
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.CognitiveServices], Cmdlet = [Get-AzCognitiveServicesModelCapacity]. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: '<USER ID>', environment: 'AzureCloud', tenant: '<TENANT ID>'
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 10:09:33 AM - [ConfigManager] Got [False] from [EnableLoginByWam], Module = [], Cmdlet = [].
DEBUG: 10:09:33 AM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'<TENANT ID>', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'<USER ID>'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] ==== GetAccounts started - GetAccounts ====
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] Account id filter: False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] [Internal cache] Clearing user token cache accessor.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] [Internal cache] Total number of cache partitions found while getting refresh tokens: 1. PartitionKey False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] [Internal cache] Total number of cache partitions found while getting accounts: 1. PartitionKey False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <SESSION ID>] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] Returning 1 accounts
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] MSAL MSAL.CoreCLR with assembly version '4.82.1.0'. CorrelationId(<CORRELATION ID>)
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] LoginHint provided: False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] Account provided: True
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] ForceRefresh: False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - <CORRELATION ID>
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
FMI Path:
Credential FMI Path:
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] === Token Acquisition (SilentRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z] [Internal cache] Clearing user token cache accessor.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] [Internal cache] Total number of cache partitions found while getting access tokens: 1
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] [FindAccessTokenAsync] Discovered 9 access tokens in cache using partition key: <PRINCIPAL ID>.<TENANT ID>
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] Access token is not expired. Returning the found cache entry. [Current time (05/19/2026 14:09:33) - Expiration Time (05/19/2026 15:01:57 +00:00) - Extended Expiration Time (05/19/2026 15:01:57 +00:00)]
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] AT expiration time: 5/19/2026 3:01:57 PM +00:00, scopes: https://management.core.windows.net//.default https://management.core.windows.net//user_impersonation. source: Cache
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>]
[LogMetricsFromAuthResult] Cache Refresh Reason: NotApplicable
[LogMetricsFromAuthResult] DurationInCacheInMs: 0
[LogMetricsFromAuthResult] DurationTotalInMs: 4
[LogMetricsFromAuthResult] DurationInHttpInMs: 0
DEBUG: False MSAL 4.82.1.0 MSAL.CoreCLR .NET 10.0.6 Microsoft Windows 10.0.26200 [2026-05-19 14:09:33Z - <CORRELATION ID>] TokenEndpoint: ****
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: ExpiresOn: 2026-05-19T15:01:57.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '<TENANT ID>', UserId: '<USER ID>'
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [Az.CognitiveServices], Cmdlet = [Get-AzCognitiveServicesModelCapacity]. Returning default value [False].
Get-AzCognitiveServicesModelCapacity: 'modelFormat' does not match expected pattern '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'.
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.CognitiveServices], Cmdlet = [Get-AzCognitiveServicesModelCapacity]. Returning default value [True].
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:09:33 AM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:09:33 AM - No authentication telemetry is found for the current cmdlet with Id 01600ad5-b731-466c-b524-aadaf3723fc2.
DEBUG: AzureQoSEvent: Module: Az.CognitiveServices:1.16.0; CommandName: Get-AzCognitiveServicesModelCapacity; PSVersion: 7.6.1; IsSuccess: False; Duration: 00:00:00.0567155; SanitizeDuration: 00:00:00; Exception: 'modelFormat' does not match expected pattern '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'.;
DEBUG: 10:09:33 AM - [ConfigManager] Got [False] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 10:09:33 AM - GetAzureCognitiveServicesModelCapacityCommond end processing.
Environment data
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.6.1
PSEdition Core
GitCommitId 7.6.1
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Module versions
PS> Get-Module Az*
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 5.3.3 Az.Accounts
Script 1.16.0 Az.CognitiveServices
Error output
PS> Resolve-AzError
HistoryId: 2
Message : 'modelFormat' does not match expected pattern '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'.
StackTrace : at Microsoft.Azure.Management.CognitiveServices.LocationBasedModelCapacitiesOperations.ListWithHttpMessagesAsync(String location, String modelFormat, String modelName, String modelVersion, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.CognitiveServices.LocationBasedModelCapacitiesOperationsExtensions.ListAsync(ILocationBasedModelCapacitiesOperations operations, String location, String modelFormat, String modelName, String modelVersion, CancellationToken cancellationToken)
at Microsoft.Azure.Management.CognitiveServices.LocationBasedModelCapacitiesOperationsExtensions.List(ILocationBasedModelCapacitiesOperations operations, String location, String modelFormat, String modelName, String modelVersion)
at Microsoft.Azure.Commands.Management.CognitiveServices.CognitiveServicesAccountBaseCmdlet.ListAll[T](Func`5 listFirst, String para0, String para1, String para2, String para3, Func`2 listNext)
at Microsoft.Azure.Commands.Management.CognitiveServices.GetAzureCognitiveServicesModelCapacityCommond.<ExecuteCmdlet>b__17_0()
at Microsoft.Azure.Commands.Management.CognitiveServices.CognitiveServicesAccountBaseCmdlet.RunCmdLet(Action action)
at Microsoft.Azure.Commands.Management.CognitiveServices.GetAzureCognitiveServicesModelCapacityCommond.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : Microsoft.Rest.ValidationException
InvocationInfo : {Get-AzCognitiveServicesModelCapacity}
Line : Get-AzCognitiveServicesModelCapacity -Location eastus2 -Format 'Mistral AI' -Name 'mistral-document-ai-2512' -Version '1'
Position : At line:1 char:1
+ Get-AzCognitiveServicesModelCapacity -Location eastus2 -Format 'Mistr …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 2
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 49
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/azure-powershell
-
[Feature]: Opencustomer-reported feature-request needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Azure/azure-powershell#30135 ·
-
customer-reported feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Azure/azure-powershell#30100 ·
-
bug customer-reported needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Azure/azure-powershell#29615 ·
-
bug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-powershell#29540 · 1 comment · 2 reactions ·
-
bug Compute Possible-Solution Service Attention Similar-Issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-powershell#29432 · 1 comment ·
All issues in Azure/azure-powershell
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·