Can Azure App Services have fixed MAC addresses? - azure

I've got an Azure app service that I'd like to use to run some software that requires licensing. The license is provided via a server on our internal network. The issue being finding a way to connect to this server.
The first option is to provide a fixed license that ties to the MAC address. However I don't think this will be possible from an app service, as it does not really have a MAC address? Can I provide a VNI to it and obtain a fixed MAC address that way?
What other options are there? Can the app service be tied to a VNET that can tunnel to the on-premises resource? Should I use a VM with a VNI instead of an app service? Any resources on these kind of problems would be appreciated.

I have used Azure Relay to connect my on-prem service with my app service. Not sure if you have already considered this option.
If your requirement is to establish a connection between your on-prem service and you app service, check out this https://learn.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it
Hope this helps

You could use VNet Integration with Azure App service and Azure VPN gateway to connect to on-premise resources. VNet Integration is used only to make outbound calls from your app into your VNet. There are Regional VNet Integration and Gateway-required VNet Integration.
How regional VNet Integration works
Regional VNet Integration works by mounting virtual interfaces with
addresses in the delegated subnet. Because the from address is in your
VNet, it can access most things in or through your VNet like a VM in
your VNet would. The networking implementation is different than
running a VM in your VNet. That's why some networking features aren't
yet available for this feature.
How gateway-required VNet Integration works
Gateway-required VNet Integration is built on top of point-to-site VPN
technology. Point-to-site VPNs limit network access to the virtual
machine that hosts the app. Apps are restricted to send traffic out to
the internet only through Hybrid Connections or through VNet
Integration. When your app is configured with the portal to use
gateway-required VNet Integration, a complex negotiation is managed on
your behalf to create and assign certificates on the gateway and the
application side. The result is that the workers used to host your
apps are able to directly connect to the virtual network gateway in
the selected VNet.
For more information, you could read this blog---How to Connect Azure Web Apps To On-Premises
In addition, If you need more control of the application deployment and less scale out or in than the Azure app service. You could host your application on the Azure VM, then set up a VPN gateway in that VNet where Azure VM locate, it allows access to the on-premise resources from your Azure VM as usual in the internal network.

Related

App Service VNET integration for outbound traffic: can it reach Internet endpoints?

I deploy my web application to an App Service instance on Premium tier. My web application makes outbound requests to external resources on the Internet.
In order to secure the connection with one of these external resources so I can reach it with a private IP address, my plan is to create a Site-to-Site VPN from Azure to Oracle Cloud Infrastructure (where the external resource resides). Then, I plan to use the VNET Integration for outbound traffic and connect my App Service to my VPN.
My question is - will the web application still be able to reach the other external resources on the Internet with their public IPs? I believe the answer is related to routing tables but I can't wrap my mind around it.
Just because you integrate a Regional VNet (I'm assuming) doesn't mean the app service won't be able to make outbound connections. Pretty much like
When you integrate your app service with your VNet that has the site-to-site VPN, traffic from your app service will traverse the Azure network rather than going out to internet, assuming your app service is using an RFC1918 address for your infrastructure. If you want to secure the traffic even further, then your app service would need to be hosted inside an App Service Environment

Access on-premise server from app service

We have set up a VPN gateway and used it to connect an on-premise network with an Azure VNet. We have successfully tested a number of scenarios
communication from VMs to on-premise DBs
communication from on-premise computers (desktops and servers) to VMs (SSH etc.)
communication from on-premise computers (desktops and servers) to services with Private Link endpoints (App Serivces, DBs etc.).
The use-case we are now attempting is to access an on-premise DB from an app-service. I have integrated the app-service to the routed VNet and also added a service endpoint to this VNet. I have seen infos that this should work but it is not getting though.
A second question is what is the actual source ip of the app-service when it connects to the on-premise server. Surely not the outbound IPs? These are non-exclusive public IPs. Opening these on our VPN firewall would be a risk. In this case is the solution to also give the app service in question a private link endpoint. Will it's source IP then be the private IP of the PL?
Private Endpoint is only used for incoming flows to your Web App. Outgoing flows will not use this Private Endpoint, but you can inject outgoing flows to your network in a different subnet through the VNet integration feature. When you enable Private Endpoint to your Web App, the access restrictions configuration of the Web App is not evaluated. So in this case, I don't think you need to set the service endpoint Microsoft.Web for your web app if you have set it. Reference from using Azure private endpoint for Azure web app.
When regional VNet Integration is enabled, your app makes outbound calls to the internet through the outbound addresses that are listed in the app properties portal. Regional VNet Integration works by mounting virtual interfaces with addresses in the delegated subnet. If WEBSITE_VNET_ROUTE_ALL is set to 1, all outbound traffic can be sent into your VNet. So the source IP address will be from the integrated subnet when app service comes to the on-premise server as the #silent's comment. Reference from how regional VNet Integration works. Please note that the feature supports only one regional VNet Integration per App Service plan.

How to integrate Azure Web App with a VNet with gateway transit

I have two VNets: A and B.
VNet B has a VPN gateway and connected to an on-premise network. VNet A is peered with VNet B with transit gateway enabled. This works perfectly for virtual machines. I deploy VMs to VNet A and can access on-premise resources from there VMs.
Now I want to deploy a Web App and connect it to VNet A, so the web app will have access to on-premise resources. But to do so, I need to add a VPN gateway into the network A, which is impossible when the network is peered with another network with Use remote gateway option on. But I need this option to be on to have access to on-premise resources.
What should I do? How I can give access from Web App to on-premise resources without using App Service Environment? Is it possible?
Basically, I need the combination of these two schemes
In this case, you should integrate with VNet B from the Azure web app. Also, It will be integrated with a point-to-site VPN enabled VNet. There is a new version of the VNet Integration feature that is in preview. It doesn't depend on point-to-site VPN. From your scenario, the web app is working like " VPN clients" in a P2S connection on the second picture.
Here are some things to keep in mind before connecting your web app to a virtual network:
A target virtual network must have point-to-site VPN enabled with a
route-based gateway before it can be connected to app. The VNet must
be in the same subscription as your App Service Plan(ASP). The apps
that integrate with a VNet use the DNS that is specified for that
VNet.
Ref: https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet

How can I connect an azure app service plan to a vnet which is also connected through peering to another vnet

I am trying to seup this hub-spoke toplogy where I have a hub vnet connected to an expressroute circuit https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/hybrid-networking/hub-spoke
I have another VNET (lets call it the app vnet) set up with peering to this hub VNET where I can create a virtual machine and ping resources on the other end of just fine using the remote gateway setting on the peering.
The problem is by using remote gateway, my app vnet cannot have its own gateway, and so I cannot integrate an app service plan with the vnet.
Is there another way I could accomplish this?
I would like to suggest setting up a VNet-to-VNet VPN gateway connection instead of Vnet peering between hub vNet and app vNet. If so, Each of vNet will have their own gateway. The App vNet will be integrated with your web app. You need to ensure that the address prefixes don’t overlap among all the connected networks.
Update
Perhaps you can use the new preview VNet Integration.
There is a new version of the VNet Integration capability that doesn't
depend on Point-to-Site VPN technology. Unlike the pre-existing
feature, the new Preview feature will work with ExpressRoute and
Service Endpoints.
The new version is in Preview and has the following characteristics.
No gateway is required to use the new VNet Integration feature You can
access resources across ExpressRoute connections without any
additional configuration beyond integrating with the ExpressRoute
connected VNet. The app and the VNet must be in the same region
...
Ref: https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet#new-vnet-integration
The limitation that you are encountering is from the Vnet gateway perspective. Using remote gateway over peering handicaps one from deploying the Gateway in that Vnet.
The alternative as suggested by #nancy should do the trick. But, you will have to incur the cost of having the gateway. Secondly, this will require a co-existence set-up.
That is you will have to deploy another VPN gateway:
Change of reference:
VNET-HUB (Your hub VNET with ExR)
VNET-SPOKE1 (Current peered as referred to as your Application VNet)
Your VNET-HUB has an ExR gateway, it needs to have another VPN gateway.
Your VNET-SPOKE1 needs to have a VPN gateway deployed as well.
Allowing for the VNET-HUB to talk to the App Service Environment that you would integrate via point-to-site.
Note: The On-premise will not be able to access the App VNet as we can't have a Point-to-site co-exist with Express Route.
I hope this has provided an insight into the limitations.
References/good reads:
https://learn.microsoft.com/en-us/azure/expressroute/expressroute-routing
https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-coexist-classic
https://learn.microsoft.com/en-us/azure/expressroute/expressroute-faqs
https://learn.microsoft.com/en-us/azure/app-service/environment/app-service-app-service-environment-network-configuration-expressroute

Cannot integrate Azure Web App to Vnet

I have Web App and SQL Server VM on Vnet running on Azure.  I would like to integrate Web App to virtual network.
I'm followings https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-integrate-with-vnet#managing-the-vnet-integrations
1) I created gateway subnet and gateway.
2) I opened "App Service->Networking->VNet integration->Setup->Virtual network is visible but it is gray!
What I need to do that I can connect Web App to Vnet?
There are multiple reasons that a VNet can be grayed out including:
• the VNet is in another subscription that your account has access to
• the VNet does not have Point to Site enabled
• the VNet does not have a dynamic routing gateway
According to your steps, This issue may caused by that you might not configure a P2S address pool of your VPN gateway .
I did a test in my lab, and finally I can integrate my Web App to the Vnet.
You should to check these two point as following images:
Your VPN ponit-to-site configuration:
Your VNet connected devices:
How to Enabling Point to Site in a Resource Manager VNet:
To configure a Resource Manager VNet with a gateway and Point to Site, you can use either PowerShell as documented here, Configure a Point-to-Site connection to a virtual network using PowerShell or use the Azure portal as documented here, Configure a Point-to-Site connection to a VNet using the Azure portal. The UI to perform this capability is not yet available. Note that you need to create certificates for the Point to Site configuration. This is automatically configured when you connect your WebApp to the VNet.

Resources