Created
June 29, 2018 11:05
-
-
Save pjbgf/9bc4a2d24dddd401c80e2b8edc96f054 to your computer and use it in GitHub Desktop.
Get all PaaS Host Names from the current Azure subscription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# return all web sites | |
az resource list --resource-type "Microsoft.Web/sites" --query "[].id" --output tsv | | |
# query azure for each resource | |
xargs az resource show --ids | | |
# define output | |
jq -r '.[].siteProperties.properties // .[].properties | .enabledHostNames[] // .hostNames | match("^((?!scm).)*$").string' | |
# return all cloud services | |
az resource list --resource-type "Microsoft.ClassicCompute/domainNames" --query "[].id" --output tsv | | |
# query azure for each resource | |
xargs az resource show --ids | | |
# define output | |
jq -r '.[].properties | .hostNames' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment