Skip to content

[Az.Resources] [Get-AzResourceProvider] Returns non-existent API versions #22581

@AlexanderSehr

Description

@AlexanderSehr

Description

The Get-AzResourceProvider cmdlet seemingly returns API versions that are either not existing - or - not yet.

We're using the command as part of the AZureAPICrawler module used in the CARML module library to check that leveraged API versions are not outdated.

Trivia: The AzureAPICrawler fetches both the results it finds via the Get-AzResourceProvider cmdlet as well as everything documented in the azure-rest-api-specs repository and combined them to one big list of available API versions, as the Get-AzResourceProvider cmdlet alone does not return all api versions we'd expect.

Reviewing such a failed test today, I came to realize, the Get-AzResourceProvider cmdlet returns several additional API versions that are not yet documented anywhere for at least Microsoft.NetApp/NetAppAccounts (see below example).

The latest API version documented in

Don't know anything beyond API version in 2022 (with the seemingly actual latest being 2022-11-01m while the cmdlet believes it is 2023-03-01.

While this is already an issue for us, I suspect that something might be slightly off with the script in general an Net-App may only be a lucky find.

Issue script & Debug output

((Get-AzResourceProvider -ProviderNamespace 'Microsoft.NetApp').ResourceTypes | Where-Object {
 $_.ResourceTypeName -eq 'NetAppAccounts'
}).ApiVersions

# returns
# 2023-05-01-preview
# 2023-05-01
# 2023-03-01-preview
# 2023-03-01
# 2023-01-01-preview
# 2023-01-01
# 2022-11-01-preview
# 2022-11-01
# 2022-09-01
# 2022-07-01
# (...)

Environment data

PS > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

Whatever is installed as latest on the GitHub hosted runnners. [Documented](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#powershell-modules) is Az verion `9.3.0`.

Error output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMService AttentionThis issue is responsible by Azure service team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions