Creating Virtual Network in multiregion and Created Azure LB for Loadbalancing - azure

I am trying to create Virtual Network in multiregion and Created Azure LB for Loadbalancing in Azure Cloud. It looks like we can loadbalance only same availability set VMs. Can we use Azure LB to load balance a multi region virtual network VMs?

I have never heard of multiple-region virtual networks. VNet is scoped to a single region/location.
If you want to load balancer multi-region VMs, you can look at Cross-region load balancer (Preview). In this case, Azure Standard Load Balancer supports cross-region load balancing.
Reference: https://learn.microsoft.com/en-us/azure/load-balancer/cross-region-overview

Related

How to add multiple Azure VMSS to one basic tier Azure load balancer?

I am using VMSS with basic tier load balancer and public IP address. When I am doing application update, I want to create new VMSS to make sure it is not affecting the old VMSS. Now I am creating new VMSS with new IP and load balancer. However, I do not want the IP to change. Is there any way to create a new VMSS connecting to an existing basic tier load balancer?
You cannot add multiple Azure VMSS to one Basic tier Azure load balancer.
Azure Basic load balancer only supports virtual machines in a single availability set or virtual machine scale set (this is a single VMSS).
Reference : https://learn.microsoft.com/en-us/azure/load-balancer/skus
However, Standard load balancer supports any virtual machines or virtual machine scale sets (multiple) in a single virtual network.
So, you can easily configure a VMSS with an existing Standard SKU load balancer using the Azure portal:
https://learn.microsoft.com/en-us/azure/load-balancer/configure-vm-scale-set-portal

Connecting App Service to Load Balanced cluster in different Resource Groups

I have 2 separate resource groups in Azure:
Contains some Services including a Linux App Service hosting Python Django
Contains an ElasticSearch cluster which I created using the ARM template from here
I want to connect from the App service in (1) to the ElasticSearch service load balancer in (2)
I tried to create a virtual network peering using
az network vnet peering create -g $webResourceGroup -n web2es --vnet-name vnet --remote-vnet $remote_vnet --allow-vnet-access
where $webResourceGroup => (1) and $remote_vnet => (2)
However, when I try to do an HTTP request to the ElasticSearch Service, it just does not work.
How do I fix or troubleshoot this?
There are some requirements and constraints for virtual network peering.
Resources in one virtual network cannot communicate with the front-end
IP address of a Basic internal load balancer in a globally peered
virtual network. Support for Basic Load Balancer only exists within
the same region. Support for Standard Load Balancer exists for both,
VNet Peering and Global VNet Peering. Services that use a Basic load
balancer which will not work over Global VNet Peering are documented
here.
So, if the peered VNets are in a different region, you cannot connect to resources that are behind a Basic Load Balancer through the Front End IP of the Load Balancer. This restriction does not exist for a Standard Load Balancer. From the parameters, you will see that loadBalancerInternalSku or loadBalancerExternalSku is by default basic, you should use a standard load balancer.
Also, you should have integrated your app with an Azure Virtual Network. Please note that you cannot reach resources across global peering connections(VNets are located in different regions) when you are using Regional VNet Integration which requires the app and the VNet must be in the same region. If so, you need to use Gateway required VNet Integration and VNet peering with gateway transit.
If possible, you could create all resources like VNet, app service, cluster in the same region. Then you do not need a VPN gateway for your VNet Integration. This may have fewer limitations and easier to deploy in your scenario.
Hope this could help you.

Can we have a single application gateway for all VMSS created in different regions?

Can we have a single Application Gateway for all VMSS created in different regions?
If yes please share the possible options.
As the comment mentioned, we could not have a single Application gateway for all VMSS created in a different region since Application Gateway is always deployed in a virtual network subnet and it directly supports to deploy the VMSS as the backends in the same region and virtual network as the Application gateway.
As a workaround, you could use a public IP address as the backend for communicating with instances outside of the virtual network as long as there is IP connectivity. Read more details about backend pools. So you may use a public-facing load balancer associated with the VMSS.
Furthermore, you also could use Traffic Manager to distribute traffic across multiple Application Gateways in different datacenters. Or use Azure Front Door Service provides a scalable and secure entry point for fast delivery of your global web applications.

Can't Access Azure Application Gateway through peered VNET

I have two peered VNETs in Azure and I also have an Application Gateway in one of them. I have a couple VMs inside both VNETs and I want to access the Application Gateway from the VMs by its private IP (which is set up). This works from the VNET that the gateway resides in but I can't access it from the other peered network. I can access all the VMs between the networks by their private IPs no problem. What can I be missing? (I am not really that familiar with networking, so it can be something basic...).
Thank you for any suggestion!
You can check if the two peered virtual networks are located in a different region.
If you are using a Global Vnet peering(Vnet to Vnet region is different), there are some limitations that you can not use Global Vnet peering to communicate with VIPs of load balancers in another region. Application Gateway is actually a layer-7 load balancer.
Resources in one virtual network cannot communicate with the IP
address of an Azure internal load balancer in the peered virtual
network. The load balancer and the resources that communicate with it
must be in the same virtual network.
References: How to setup Global VNet peering in Azure
APIM is a service based on Azure Load balancer. For Stv1 APIM Azure uses Basic Load balancer which does not allow traffic via global peering.
[Refer this][1]
In order to facilitate traffic via global peering need to use stv2 APIM.[Refer this][2]
[1]: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-peering?tabs=peering-portal#requirements-and-constraints
[2]: https://learn.microsoft.com/en-us/azure/api-management/virtual-network-concepts?tabs=stv1#network-resource-requirements

Azure load balancer: NAT redirect RDP to VM, and load balance HTTP to availability set?

It looks like you can't NAT as well as load balance unless it's to the same destination. Once I created the NAT rule (so I can RDP to the load balancer over a custom port, and then that's redirected to my management VM), I cannot create the backend pool to use for HTTP load balancing. I go to backend pools and click create and it already fills in "associated with " and I cannot change that to my web VMs availability set.
I've also tried creating the backend pool first, for which I select the web VM availability set, but then when I create a NAT rule I cannot point to the management VM, only to the availability set/specific VM in that set.
What am I missing? Is there a solution besides recreating the management VM and putting it in the web VM availability set?
I've also tried creating the backend pool first, for which I select
the web VM availability set, but then when I create a NAT rule I
cannot point to the management VM, only to the availability
set/specific VM in that set.
All of these are by design behavior. LB only work for an availability set or a single VM.
Is there a solution besides recreating the management VM and putting
it in the web VM availability set?
No, if you want to use LB to connect to the management VM, we should recreate it and add this VM to that availability set.
If you just want this VM can connect to those VMs behind that LB, we can create this VM in that Vnet, then use management VM's public IP address to login this VM, and use private IP address to connect to those VMs.

Resources