我执行了以下操作,并能够创建FrontDoor rnd测试。
$test = New-AzFrontDoorBackendObject -Address bing.com -httpPort 80 -httpsPort 443 -Priority 1 -Weight 50 -BackendHostHeader bing.com -EnabledState Enabled
New-AzFrontDoorBackendPoolObject -Name "rndbackendpool" -FrontDoorName "rnd-test" -ResourceGroupName "Nexxe-RND-RahulTripathi" -Backend $test -HealthProbeSettingsName "rndHP" -LoadBalancingSettingsName "rndLB" -DefaultProfile $AzSubscription
现在,我正试图在现有的FrontDoor下创建一个后端池。
您可以参考此脚本来更新现有的Azure Front Door新前端、后端和规则。
$afd = Get-AzFrontDoor
$bpoolname= Read-Host -Prompt "Enter name for backend Pool:"
$backobject1= Read-Host -Prompt "Enter name for backend object (IP address or FQDN):"
$frontdoorname= Read-Host -Prompt "Enter Azure Front door name"
$rgname = Read-Host -Prompt "Enter Resource Group"
$routingRuleName = $bpoolname
$FrontendEndpointHostname = Read-Host -Prompt "enter FQDN of Frontend points name: "
$FrontendEndpointName = Read-Host -Prompt "enter name of Frontend point: "
$LbName = $bpoolname + "-lb01"
$probeName = $bpoolname + "-probe01"
$backEndObject1 = New-AzFrontDoorBackendObject -Address $backobject1
$HealthProbeSettingObject1 = New-AzFrontDoorHealthProbeSettingObject -Name $probeName -Protocol Https
$LoadBalancingSettingObject1 = New-AzFrontDoorLoadBalancingSettingObject -Name $LbName
$FrontendEndpointObject1 = New-AzFrontDoorFrontendEndpointObject -Name $FrontendEndpointName -HostName $FrontendEndpointHostname
$BackendPoolObject1 = New-AzFrontDoorBackendPoolObject -Name $bpoolname -FrontDoorName $frontDoorName -ResourceGroupName $rgName -Backend $backendObject1 -HealthProbeSettingsName $probeName -LoadBalancingSettingsName $LbName
$afd.HealthProbeSettings.Add($HealthProbeSettingObject1)
$afd.LoadBalancingSettings.Add($LoadBalancingSettingObject1)
$afd.FrontendEndpoints.Add($FrontendEndpointObject1)
$afd.BackendPools.Add($BackendPoolObject1)
$RoutingRuleObject1 = New-AzFrontDoorRoutingRuleObject -Name $routingRuleName -FrontDoorName $frontDoorName -ResourceGroupName $rgName -FrontendEndpointName $FrontendEndpointName -BackendPoolName $bpoolname -ForwardingProtocol HttpsOnly
$afd.RoutingRules.Add($RoutingRuleObject1)
Set-AzFrontDoor -Resourcegroupname $rgname -Name $frontdoorname -FrontendEndpoint $afd.FrontendEndpoints -BackendPool $afd.BackendPools -RoutingRule $afd.RoutingRules -LoadBalancingSetting $afd.LoadBalancingSettings -HealthProbeSetting $afd.HealthProbeSettings -Debug