Skip to content

New-AzureRmVmss show incorect message HealthProbe resource missing #6413

@DanielHWe

Description

@DanielHWe

Description

I create first a Network Load Balancer include HealthProbe etc. and then on create the according Vm Scale Set with New-AzureRmVmss, I got the message that the HealthProbe is missing. But by checking on the azure portel the HealthProbe was correctly create within the Load Balancer resource.

Script/Steps for Reproduction

# Set required Variables
$lbName = "NRP-LB"
$loc = "<My Region>"
$currentrg = "<My rg name>"
$vnetname = "<My Vnet Name>"
$vnetrg = "<Name of RG conteining my vnet>"

$vmPassword = ConvertTo-SecureString $adminPassword -AsPlainText -Force
$vmCred = New-Object System.Management.Automation.PSCredential($adminUsername, $vmPassword)

# Set Network
$vnet= Get-AzureRmVirtualNetwork -Name $vnetname -ResourceGroupName $vnetrg
$subnetMain = $vnet.Subnets[2]
$backendSubnetName = $subnetMain.Name


#Deploy Loadbalancer
$frontendIP = New-AzureRmLoadBalancerFrontendIpConfig `
     -Name LB-Frontend `
     -SubnetId $subnetMain.Id `
     -ErrorAction Stop 

$beaddresspool= New-AzureRmLoadBalancerBackendAddressPoolConfig `
     -Name "LB-backend" `
     -ErrorAction Stop

$inboundNATRule1= New-AzureRmLoadBalancerInboundNatRuleConfig `
     -Name "RDP" `
     -FrontendIpConfiguration $frontendIP `
     -Protocol TCP `
     -FrontendPort 3389 `
     -BackendPort 3389 `
     -ErrorAction Stop

$healthProbe = New-AzureRmLoadBalancerProbeConfig `
     -Name "HealthProbe" `
     -RequestPath "Default.htm" `
     -Protocol http `
     -Port 80 `
     -IntervalInSeconds 15 `
     -ProbeCount 2 `
     -ErrorAction Stop

$lbrule = New-AzureRmLoadBalancerRuleConfig `
     -Name "HTTP" `
     -FrontendIpConfiguration $frontendIP `
     -BackendAddressPool $beAddressPool `
     -Probe $healthProbe `
     -Protocol Tcp `
     -FrontendPort 80 `
     -BackendPort 80

$nrplb = New-AzureRmLoadBalancer `
     -ResourceGroupName $currentrg `
     -Name $lbName `
     -Location $loc `
     -FrontendIpConfiguration $frontendIP `
     -InboundNatRule $inboundNATRule1 `
     -LoadBalancingRule $lbrule `
     -BackendAddressPool $beAddressPool `
     -Probe $healthProbe 

#Deploy VM Scale Set ==> Error
New-AzureRmVmss `
  -Credential $vmCred `
  -ResourceGroupName $currentrg `
  -Location $loc `
  -VMScaleSetName $vmssName `
  -PublicIpAddressName $frontendIP.Name `
  -LoadBalancerName  $lbName `
  -UpgradePolicy "Automatic" `
  -ErrorAction Stop `
  -VirtualNetworkName $vnetname `
  -SubnetName $backendSubnetName `

Module Version

6.2.1

Environment Data

Name Value


PSVersion 5.1.16299.431
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.431
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Debug Output

WARNUNG: The output object type of this cmdlet will be modified in a future release.

New-AzureRmVmss : Resource /subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Network/loadBal
ancers/NRP-LB/loadBalancingRules/HTTP referenced by resource /subscriptions/XXX/resourceGroups/XXX/p
roviders/Microsoft.Network/loadBalancers/NRP-LB/probes/HealthProbe was not found. Please make sure that the referenced resource exists, and 
that both resources are in the same region.
In D:\scripts\create_loadBalancer_and_vmss.ps1:228 Zeichen:1
+ New-AzureRmVmss `
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureRmVmss], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.NewAzureRmVmss

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions