问题描述
我正尝试如下图所示设置Azure应用程序网关
$AppGW = Add-AzureRmApplicationGatewayProbeConfig -ApplicationGateway $AppGW -Name "webprobe" -Protocol "Http" -HostName $webHostname -Path "/" -Interval 60 -Timeout 300 -UnhealthyThreshold 8
$AppGW = Add-AzureRmApplicationGatewayBackendHttpSettings -ApplicationGateway $AppGW -Name "webPoolPortalSetting" -Port 80 -Protocol "Http" -CookieBasedAffinity "disabled" -Probe $webPortalProbe -RequestTimeout 180
我无法理解 Add-AzureRmApplicationGatewayProbeConfig和Add-AzureRmApplicationGatewayBackendHttpSettings 之间的区别,并且Microsoft文档没有帮助。
Add-AzureRmApplicationGatewayProbeConfig和Add-AzureRmApplicationGatewayBackendHttpSettings到底有什么作用?
解决方法
Add-AzureRmApplicationGatewayProbeConfig cmdlet将health probe添加到应用程序网关。 Add-AzureRmApplicationGatewayBackendHttpSettings cmdlet将后端HTTP settings添加到应用程序网关。他们添加了两种不同的东西。添加HTTP设置时,您需要关联用于监视后端运行状况的运行状况探针。
但是,两个cmdlet都依赖于Azure PowerShell的过时版本--- AzureRM
PowerShell。
要开始使用Az
PowerShell模块,请参阅Install Azure PowerShell。要了解如何迁移到Az
PowerShell模块,请参阅Migrate Azure PowerShell from AzureRM
to Az
。
阅读有关Azure PowerShell examples for Azure Application Gateway (AG)
的更多信息