I have resources spread across multiple regions (Central US and Europe) in Azure
environment.
- Function 1 - Central US
- Function 2 - Europe
- Virtual Network and Virtual Machine - Europe
I am able to connect function 2
and virtual machine
using feature called VNET integration
as mentioned in https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-vnet
But, I am not able to connect function1
to virtual machine
because these are cross region connection.
How can I solve this issue? Do I need to add VNET
in central US
, then do VNET Peering?
Even though VNET-VNET (Virtual Network Gateway) connection established. I am using the premium azure function. Unable to find the VNET belongs to another region in the dropdown :(
Solution Found
In order for function app to communicate with Virtual machine privately, function app needs to be integrated with VNET to be able to reach VM.
The function app running on Elastic premium plan that only gives a single option of VNET integration which is Regional VNET integration: https://learn.microsoft.com/en-us/azure/azure-functions/functions-networking-options#matrix-of-networking-features
Function should be into App Service Plan (Dedicated Plan). Function app is having full access to Point-to-Site VPN connection and Regional VNET integration. I was using Consumption plan and which is also one of the issues.