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

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.

Related

why Extra subnet for VNET integration for app services

Why do we have to create a new subnet or add the app service to an empty subnet in our vnet?
I don't understand the reasoning since I'm trying to use my app service (function app) as a reverse proxy to access the resources in the vnet.
By default, the Azure function is a PaaS as the other Azure Platform-as-a-Services that have inbound and outbound traffic over the Internet. We can host our applications without the need to worry about the maintenance of the servers and their operating systems.
To use Azure Functions to connect to resources in an Azure virtual network, we can use the VNet integration feature. To use this feature, we need to create a subnet in the virtual network for your function app to use. VNet Integration must be configured to use an empty subnet. It doesn't matter that your functions use a different subnet than your VM. The virtual network automatically routes traffic between the two subnets. Read Connect your function app to the virtual network
The extra empty subnet is used to hosting your app instance. To let the app instance outbound traffic work like from a VNet, Azure mounts NICs with assigned private IP addresses in that subnet. With VNet integration, your function app is connected to both the internet and your virtual network.
For more information, you may read How regional VNet Integration works and How gateway-required VNet Integration works
For an app to access resources in a Virtual Network, it needs to be either part of that network, or use a VPN gateway, which in turn can be used access resources inside the Virtual Network.
App Services provides 2 methods to communicate with resources in the Virtual Network:
Regional VNet Integration
Gateway-Required VNet Integration
With Regional VNet Integration, the infrastructure allocates a private IP interface on the VM that is hosting your Web App. This interface is allocated an IP address from the integrated subnets address prefix. This interface is later used to communicate with the VNet hosted resources. This is in a way similar to how IaaS VM work, however the limitation of this interface is that it can be only used for making outbound connections.
This way, if the ASP is configured to scale out to multiple VM's then each VM is allocated a corresponding private IP interface. However, the allocation of these IP address is limited to the subnets Address prefix. Nancy has already included this in her post. App Services have overlapped recycling so during scale up/maintenance, the App Service Plan may run on twice the number of VM's to ensure minimal downtime. However this also means, that the Integrated Subnet should have sufficient addresses available, so that these allocations can happen.
The IP Address of this interface is exposed via the environment variable WEBSITE_PRIVATE_IP. Here is a screenshot of my Kudu Console
If your site is running on multiple instances, then you can use the Instance menu to toggle through the instances.
With Gateway-required VNet Integration, there is a pre-requisite of provisioning a Virtual Network route-based gateway configured with an SSTP point-to-site VPN. In this case, the VM's hosting the Web App download the VPN package on the respective VM's to setup a VPN, and this is used to connect to the resources in the Virtual Network.
Even here, you can use the WEBSITE_PRIVATE_IP environment variable to see the IP Address used by the VPN client on the App Service VM.
HTH,
Kaushal

Azure Load Balancing Solution - Application Gateway or Azure Load Balancer

Note: I'm still in learning phase.
Question: For the scenario described below, in the Load Balancing Settings for the two VMs for the FrontEnd subnet should I choose Application Gateway or Azure Load Balancer?
In Azure portal, when I create the VMs for FrontEnd, the Networking tab of the wizard, gives me two choices shown below:
Why the confusion:
For Load Balancing Internet Traffic to VMs, this tutorial does not choose Application Gateway. But the 5th bullet of the following scenario seems to indicate I should choose Application Gateway
Scenario
This tutorial from official Azure team describes designing an infrastructure for a simple online store as follows:
The above configuration incorporates:
A cloud-only virtual network with two subnets (FrontEnd and BackEnd)
Azure Managed Disks with both Standard and Premium disks
Four availability sets, one for each tier of the online store
The virtual machines for the four tiers
An external load balanced set for HTTPS-based web traffic from the Internet to the web servers
An internal load balanced set for unencrypted web traffic from the web servers to the application servers
A single resource group
you can use both, its a matter of your needs. load balancer just forwards traffic to your vms, while application gateway can do path based routing, ssl offloading, has WAF capabilities, and so on. But it costs a lot more and is clunky.
Looking at the bullet points you've listed, your case will work with both of these solutions.
ps. Like Rahul mentioned, load balancer works on level 4 and is not HTTP aware, Application Gateway is a level 7 load balancer.

Azure Container Services (AKS) - Exposing containers to other VNET resources

I am using Azure Container Services (AKS - not ACS) to stand up some API's - some of which are for public consumption, some of which are not.
For the public access route everything is as you might expect, a load-balancer service bound to a public IP is created, DNS zone contains our A record forwarding to the public IP, traffic is routed through to an NGINX controller and then onwards to the correct internal service endpoints.
Currently the preview version assigns a new VNET to place the AKS resource group within, moving forwards I will place the AKS instance inside an already existing VNET which houses other components (App Services, on an App Service Environment).
My question is how to grant access to the private APIs to other components inside the same VNET, as well as components in other VNETS?
I believe AKS supports an ILB-type load balancer, which I think might be what is required for routing traffic from other VNETS? But what about where the components reside already inside the same VNET?
Thank you in advance!
If you need to access these services from other services outside the AKS cluster, you still need an ILB to load balance across your service on the different nodes in your cluster. You can either use the ILB created by using the annotation in your service. The alternative is using NodePort and then stringing up your own way to spread the traffic across all the nodes that host the endpoints.
I would use ILB instead of trying to make your own using NodePort service types. The only thing would be perhaps using some type of API Gateway VM inside your vnet where you can define the backend Pool, that may be a solution if you are hosting API's or something through a 3rd party API Gateway hosted on an Azure VM in the same VNet.
Eddie Villalba
MCSD: Azure Solutions Architect | CKA: Certified Kubernetes Administrator

Provisioning Service Fabric behind Application Gateway

We are tying to achieve this.
From my understanding, we should place the outside interface of the SF loadbalancer on a private network and then connect to the App Gateway's LB internal interface using Azure Virtual Network Peering.
Is this doable, are there any issues with this?
Yes, it's doable. There are multiple approaches you could go with -
Deploy App Gateway pointing at sf nodes directly, like shown here - Fine Granular Microservices Load Balancing with Azure Service Fabric and Application Gateway
Deploy App Gateway pointing at SF LB
Catches:
There are limitations around
how many Backend Address Pools you could have(up to 20), and how many machines and http settings each pool could run with. So, for instance, if you have SF cluster with the thousands
of services hosted at different ports, think through using SF LB and SF Reverse Proxy.
Azure Application Gateway requires its subnet. When creating a virtual network, ensure that you leave enough address space to have multiple subnets. Once you deploy an application
gateway to a subnet, only additional application gateways can be added to the subnet.
While digging into your question, I've found out that App Gateway might not play nice with websockets under certain circumstances. Check out
Communication through Azure Application Gateway blocked for WebSocket traffic for the details.
P.S.
If SF LB of yours is public you don't need VNET peering. The same works for private SF LB and Application Gateway installed into the same VNET.
I think there is better support to abstract Service Fabric by using Azure API management instead of Application Gateway.
I presume your SF is on Azure then API management has built in support for Service fabric so you dont have to do end point resolution or get partition key etc

In Windows Azure, is it possible to have a load balanced endpoint that's only accessible by traffic from a connected virtual network?

I have a Cloud Service that is connected to a LAN through a virtual network. I have a web role that machines on the LAN will be hitting for tasks like telling the cloud service that data needs to be refreshed. It it possible to have and endpoint that's load-balanced, but that only accepts traffic through the virtual network?
Well... you have a few things to think about.
You could set up your own load balancer in a separate role, which then does the load balancing. You'd probably want two instances to deal with high availability, and if there was any stateful/sticky-session data you'd need to sync it between your two load balancers. OR...
Now: If your code needing load-balancing lived in a Virtual Machine, rather than in a web/worker role, you could take advantage of the brand-new IP-level endpoint ACL feature introduced at TechEd. With this feature, you can have an endpoint that allows/blocks traffic based on source IP address. So you could have a load-balanced endpoint balancing traffic between a few virtual machines, and you could then limit access to, say, your LAN machines, and even add your existing Cloud Service (web/worker) VIP so that your web and worker role instances could access the service, all through the endpoint without going through the VPN. This way, you'd get to take advantage of Azure's built-in load balancer, while at the same time providing secure access for your app's services.
You can see more details of endpoint ACLs here.
No. The load balancer for a cloud service is public only. You can't predict the ip addresses of the individual instances on the virtual network, so you can't even hook them into your own load balancer. Yes, you can do it with VMs (as David recommends) — but then you're doing old-school IIS, not a cloud service. I went through this in November 2012, and was unable to find a decent solution.

Resources