How to programatically identify the latest stable REST API version of Azure management REST

If you are making direct calls to the Azure REST API you notice that you need to provide the API version for that specific REST endpoint.

Sometimes the version provided in the Microsoft documentation is wrong.


If you provide an invalid API version you receive an error message that contains the available API versions.

However, should you wish to programatically determine the current latest API version you can use the providers API.

https://learn.microsoft.com/rest/api/resources/providers

For example if you would like to know the latest Web Apps API version you can call the providers API and provide the namespace in which the Web Apps API resides (the provider API version is currently 2021-04-01).

https://management.azure.com/providers/Microsoft.Web?api-version=2021-04-01

As you can see from the results here shown in Postman there is a resource type of "Sites" (again Microsoft are a bit inconsistent in their naming between the API and the documentation - web apps are infact "sites" in the REST API).

You can see the current API version is 2023-01-01 (not what is shown in the documentation).



The equivilant in the Azure Az PowerShell cmdlets would be the Get-AzResourceProvider cmdlet.

Get-AzResourceProvider -ProviderNamespace "Microsoft.Web"



Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.