You may have received Security recommendations for your App Services similar to the one shown below:
"Upgrade your Java and Tomcat versions on App Service to continue receiving critical security updates.
You're receiving this email because you currently use an outdated version of Java or Tomcat on App Service."
Not just for Java, you may receive these notifications for other stacks like PHP, Python, .NET etc. These recommendations do not provide a list of Apps in your subscription that are non-compliant (in this case, apps using outdated Java or Tomcat version). To take proper action on this recommendation, you will first need to find out what Java versions are used by your Apps. This article discusses how you can obtain this information using Azure CLI.
Login to Azure CLI and ensure you’re signed into the right account:
You can alternatively use Azure Cloud Shell: https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart.
Run this command to set the subscription you’ll be working with:
The commands used in this article are demonstrated using Azure Cloud Shell.
The basic idea is to query the Java and Tomcat versions using javaVersion, javaContainer, and javaContainerVersion properties on the Microsoft.Web/sites/config object on Windows sites. On Linux sites, you can query the LinuxFxVersion property on the site object.
Here’s a sample output of this command for my subscription:
For other stacks:
To do the same for other stacks, just run the command below for any of your Apps and check the respective parameter to query:
You will see parameters like:
You can use these in the query above and customize it to get more granular results. Here are some samples:
Repeat the above steps for all the subscriptions that received the notification.
Upgrade your Java or Tomcat version as needed: Java, Tomcat, and JBoss EAP version updates - Azure App Service
If you want to play around with the query further and alter it to suit your needs, here are some documents I found helpful:
I hope this helps! Happy CLI-ing :smiling_face_with_smiling_eyes:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.