windows – Azure Standart Load Balancer, Scale Set, Custom data

I am trying configure Standart Load balancer with Azure Scale Set within Custom data script.

The VMs in ScaleSet is Ubuntu 18.04.

The aviability zones also cheked in scaleset. In LB also zone-redundant option selected.

This is a my Custom data script:

apt-get update -y && apt-get upgrade -y
apt-get install -y nginx
echo “Hello World from host” $HOSTNAME “!” | sudo tee -a /var/www/html/index.html

After deploying Scale Set im checking boot logs and see that instances could not update package or install nginx. There is connection time out error.

But i do the same configs with BASIC LOAD BALANCER it works fine.

Maybe somebody knows why Scale Set instances behave like this with Standart Load Balancer ?