Azure - how can I find Azure service name by hostname/machine name?

1.4k Views Asked by At

I have hostname/machine name from logs. I want to know what service is running that. is there any way I can backtrack service name by hostname/machine name?

I tried to search for all queries, tried kudu but can see hostname for the service I select. cant reverse search it

1

There are 1 best solutions below

0
Jahnavi On

After I've done workaround, there is no direct command to get azure app service with hostname, but I found an alternative to get App Service details with hostnames by using:

Get-Azurermwebapp command with the respective resource group name.

With Get-Azurermwebapp command, Direct hostname retrieval is not supported via a parameter. To do that, I gave the information to a variable and used it to retrieve.

 get-azurermwebapp -ResourceGroupName <ResourceGroupName>
 $info =  get-azurermwebapp -ResourceGroupName <ResourceGroupName> #Storing in info variable
 $info.name #retrieving Azure App service names
 $hostname = $info.enabledhostnames #retrieve enabledhostnames by passing info to $hostname
 $hostname

enter image description here

enter image description here

Note: If you need to view all services operating inside any AzureVM, together with their status, Use Get-service:

get-service -computername <VMName>

enter image description here

enter image description here

Refer MsDoc