Let's say you've deployed an Azure solution consisting of multiple platform services (defined in bicep in this case) at some point time. To keep the solution up to date you want to identify when resources are released in a new API version. E.g. the initial deployment used this resource/API:
Microsoft.Storage/storageAccounts@2021-04-01
I'd like to identify that the current API version is 2021-08-01
The Bicep plug in in VS Code helps a bit, but I have to walk trough all resources (place cursor at API version - press CTRL space to get a pop-up of API versions), which is a manual process. -Is there a better way to use VS Code for this?
Preferably I'd like to have a script (Azure CLI or other) which identifies newer API versions within a scope (e.g. subscription or resource groups). Running this script on a regular basis, it will be easier to keep track of what versions are evolving from the original deploy.
CodePudding user response:
A couple thoughts...
it's not necessary to have the latest apiVersion - deprecation is rare and a long process. For anything that's "necessary" (security, performance) those are generally done in existing apiVersions. So maybe that helps with the urgency. If you have features that are only available in a newer apiVersion, that's the time to move.
the arm-ttk will check apiVersions on a template (not the resources in Azure but the code that deploys resources to azure. Here's the specific test:https://github.com/Azure/arm-ttk/blob/2022.03.16/arm-ttk/testcases/deploymentTemplate/apiVersions-Should-Be-Recent.test.ps1. That will flag anything over 2 years old (and a few other scenarios around preview versions) so it may be possible to modify that to suit your needs.
Perhaps not precisely what you're looking for but does that help?