Checking Azure provider’s apiVersions in Json files with Azure latest versions

Tzahi Kolber
2 min readAug 11, 2022

Every provider or resource type in Azure has one or more apiVersions, which must be specified in the json file.
It might happen that the version in the json file is too old and needs to be updated with the newer one.
In this blog I will review a short script which reviews all the ARM templates in a specific directory and checks the apiVersion of all providers to verify they are the latest possible / most updated.
Each organization might choose to handle the versioning differently, and update the templates once every period of time, or only when updating its contents., but at least using the script, you can review how “old” are the apiVersions you are using for each resource type.

Script overview

The script reviews every json file in the c:\Temp\Templates directory, lists the resource type, its current apiVersions and the latest apiVersions in Azure to the console screen.
of course, the path of the json files can be changed in the beginning of the scripts to any directory containing json files.
At the end of every json review, a csv file is created in the same folder where the json file is located, with the original name of the file being tested, which includes the following columns:

  1. Resource type.
  2. Current apiVersions of the resource type in the json file.
  3. The latest apiVersions of the resource type in Azure.
  • This what the console looks like during the script runtime:
  • And the CSV looks similar to this:

The script

Click the link below to get the script:

--

--

Tzahi Kolber

During the last 15 years, I was working as a Senior PFE within Exchange area at Microsoft. Now I’m Senior Consult as Azure IAAS, PowerShell & Automations.