0
votes

I'm trying to get the hostnames of an Azure webapp/website and add it to a variable. So far I have

    Get-AzureWebsite -Name $WebAppName1 

This returns all information about the webapp/website. Not sure how to grab only the host name.

Any guidance would be appreciated.

1

1 Answers

0
votes

You would want to save the output to a variable and examine it:

$website = Get-AzureWebsite -Name $WebAppName1 
$website | Get-Member

and look for the property you are interested in. Note that the property you are interested in may be a subproperty for another property. For a WebApp you would do this (I don't have a WebSite to demonstrate):

$webapp = Get-AzureRmWebApp -blablabla
$webapp.DefaultHostName
$webapp.EnabledHostNames