Azure Web Apps for Containers lets you deploy containers to an Azure Web App. This way you get the best to two worlds: the flexibility and portability of containers combined with most of the great features of Azure App Services (authentication, scaling, SSL handling, backup, diagnostics, etc…).
Recently I needed to receive a list of all Web Apps for Containers and the full name of their attached docker images, and I will share my approach with you in this blog post:
In your browser go to https://resources.azure.com which will lead you to the Azure Resource Explorer website.
You will be asked to log in with your Azure AD credentials.
The tree view to the left lets you navigate through the hierarchy of resources.
Follow these six steps (shown above as green numbered circles):
Click on the PowerShell tab.
Then copy the PowerShell snippet below.
This snippet will enable us to work with the raw output of the web apps in PowerShell.
Paste our snippet into PowerShell and assign it to a variable (in this case $sites)
We can use the ‘Show-Object’ cmdlet to explore how PowerShell interprets the web apps data we got from Azure Resource Explorer.
With Show-Object we can drill into the object structure, and just like we saw in the JSON input, we also have a ‘value’ here starting with ‘DOCKER|‘ (step 1).
Step 2 highlights the actual path into the object structure where our docker image resides.
The following two steps will receive and display the docker images for our web apps:
The 2nd docker image (‘testcontainerreg002.azurecr.io/bitnami.bitnami/wordpress:4.9.6‘) is actual a docker image coming from a Azure Container Registry that I use for testing purposes. The other two comes directly from Docker Hub.
The full PowerShell code is here:
$sites = Get-AzureRmResource -ResourceId /subscriptions/2060338b-6824-47c3-b778-c86f1d58a534/providers/Microsoft.Web/sites -ApiVersion 2016-08-01 $sites[3] | Show-Object $sites | ? {$_.Properties.siteProperties.properties.value -like "DOCKER|*" } | select name, {$_.Properties.siteProperties.properties.value}
Photo by maijou2501
4Azure API Management news at Ignite 2021: Event Grid, GraphQL and WebSockets
BUILD 2021 NEWS: “Native support for WebSocket APIs in Azure API Management”
AZURE NEWS: Azure API Management Premium tier price reduction for incremental purchased units