Skip to content

How create VMSS with load balancer using exsiting Vnet and subnet #27765

Description

@eliassal

Describe the bug

I tried to create a VM scale set (for a web site) by doing the following, created
1-Vnet,
2. Subnet,
3. public IP addr,
4. loadbalancer with the public IP,
5. http rule
6. then the VMSS using custom-data also
7. The full az command I used are down hereunder
When I try to access the IP , I get

The connection has timed out
The server at 20.199.112.60 is taking too long to respond.

When I create the scaleset manually in the portal with the same custom-data I can access the web site through loadbalancer IP as well as each vm instance IP. So what might be missing using azure cli? Thanks

Related command

1 - az network vnet create
--name vnet-scaleXXXXX
--resource-group scaleXXXXX
--address-prefix 10.0.0.0/16
--subnet-name subnet-scaleXXXXX
--subnet-prefixes 10.0.0.0/24

2 - az network vnet subnet create
--name Subnet-vnet-scaleXXXXX
--resource-group scaleXXXXX
--vnet-name vnet-scaleXXXXX
--address-prefix 10.0.1.0/24

3 - az network public-ip create
--resource-group scaleXXXXX
--name scaleXXXXXPubIPAddr
--sku Standard

4 - az network lb create
--resource-group scaleXXXXX
--name scaleXXXXXLB
--sku Standard
--public-ip-address scaleXXXXXPubIPAddr
--frontend-ip-name myFrontEnd
--backend-pool-name myBackEndPool

5 - az network lb probe create
--resource-group scaleXXXXX
--lb-name scaleXXXXXLB
--name myHealthProbe
--protocol tcp
--port 80

6 - az network lb rule create
--resource-group scaleXXXXX
--lb-name scaleXXXXXLB
--name myHTTPRule
--protocol tcp
--frontend-port 80
--backend-port 80
--frontend-ip-name myFrontEnd
--backend-pool-name myBackEndPool
--probe-name myHealthProbe
--disable-outbound-snat true
--idle-timeout 15
--enable-tcp-reset true

az vmss create
--name scaleXXXXXSS
--resource-group scaleXXXXX
--image Ubuntu2204
--admin-username azureuser
--admin-password Azure123456!
--instance-count 2
--vnet-name vnet-scaleXXXXX
--subnet Subnet-vnet-scaleXXXXX
--vm-sku Standard_DS1_v2
--upgrade-policy-mode Automatic
--lb scaleXXXXXLB
--public-ip-per-vm
--backend-pool-name myBackEndPool
--custom-data cloud-init.txt

Errors

The connection has timed out
The server at 20.199.112.60 is taking too long to respond.

Issue script & Debug output

No debug script

Expected behavior

Access the web site through loadbalancer

Environment Summary

azure-cli 2.53.1

core 2.53.1
telemetry 1.1.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3'
Extensions directory '/home/salam/.azure/cliextensions'

Python (Linux) 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotNetworkaz network vnet/lb/nic/dns/etc...act-observability-squadact-quality-productivity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions