I need to remove a Site Extension across ~50 Azure App Services. The az webapp command space doesn't list anything for Site Extensions: https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest
The Azure team won't touch Site Extensions: https://github.com/Azure/azure-cli/issues/7617
However, a comment shows it's possible to delete the extension, if you know the resource ID: https://github.com/Azure/azure-cli/issues/7617#issuecomment-952743871
This command does not return installed extensions:
az resource list --resource-type Microsoft.Web/sites
And this command returns nothing:
az resource list --resource-type Microsoft.Web/sites/siteextensions
So how can I get a list of installed webapp extensions with Azure CLI?
Even Iam unable to get the Extensions list with az resource list --resource-type Microsoft.Web/sites
command.
Instead of az resource list
use show az resource show
.
az resource show --resource-group 'YourRGName' --resource-type 'Microsoft.Web/sites/siteextensions' --name 'mywebapp15June/siteextensions'
I have tried to run the command in loop using Bash
.
RG="YourRGName"
AppNames=$(az webapp list --resource-group $RG --query "[].name" -o tsv)
for AppName in $AppNames; do
echo "WebApp: $AppName"
extensions=$(az resource show --resource-group $RG --resource-type Microsoft.Web/sites/siteextensions --name "$AppName/siteextensions")
echo "Site Extensions:"
echo $extensions.title
echo "=========================="
done
Output:
The webapps which has extensions installed will be listed.