We can host the function app mainly in two ways.
Azure Function VNET integration is supported by Premium Azure functions, App Service Plan minimum Basic tier and of course App Service Environment. When we create an azure function without any VNET integration, it will have a public IP address and it will be exposed to the internet.
Inbound traffic is controlled using Accessing Restrictions and Private Link.
Access Restrictions: You can use access restrictions to define a priority-ordered list of IP addresses that are allowed or denied access to your app. When there are one or more entries, an implicit “deny all” exists at the end of the list. IP restrictions work with all function-hosting options.
What is a Private Link? Azure PaaS services are shared services and they are available over public IP addresses. Private Link enables us to connect to Azure PaaS services(storage, SQL, logic apps, service bus, event grids etc..) without opening to the Internet. A private link will give a private IP address to the Azure PaaS service and traffic will go through the Microsoft backbone network. So, No internet exposure.
Outbound IP restrictions are available in a Premium plan, App Service Plan, or App Service Environment. You can configure outbound restrictions for the virtual network where your App Service Environment is deployed.
When you integrate a function app in a Premium plan or an App Service plan with a virtual network, the app can still make outbound calls to the internet by default. By integrating your function app with a virtual network with Route All enabled, you force all outbound traffic to be sent into your virtual network, where network security group rules can be used to restrict traffic.
The above architecture demonstrates the steps involved at a high level.
Create a simple azure function that retrieves the data from the Azure storage table.
Inbound Traffic
Outbound Traffic
The video above will give you a step by step walk though of these steps - watch it here
Legal Stuff