gpt4 book ai didi

Azure - 如何通过主机名/计算机名称查找 Azure 服务名称?

转载 作者:行者123 更新时间:2023-12-03 03:33:21 24 4
gpt4 key购买 nike

我从日志中获得了主机名/计算机名称。我想知道什么服务正在运行。有什么方法可以通过主机名/机器名回溯服务名称吗?

我尝试搜索所有查询,尝试使用 kudu 但可以看到我选择的服务的主机名。无法反向搜索

最佳答案

完成解决方法后,没有直接命令可以获取带有主机名的 azure 应用服务,但我找到了一种使用主机名获取应用服务详细信息的替代方法:

Get-Azurermwebapp 带有相应资源组名称的命令。

Get-Azurermwebapp 命令,不支持通过参数直接检索主机名。为此,我将信息提供给一个变量并用它来检索。

 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

注意:如果您需要查看任何 AzureVM 内运行的所有服务及其状态,请使用 Get-service :

get-service -computername <VMName>

enter image description here

enter image description here

引用MsDoc

关于Azure - 如何通过主机名/计算机名称查找 Azure 服务名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74215766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com