I have made my storage account private and only allow access from selected virtual networks or IP addresses.
Since then I cant run my function and it fails with the error 500 internal server error
which is not very imformative. Tried to look into Diagnostic Console for more infromative error and I found this:
[Error] System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Not really helpfull.
Im sure its related to netowkring issue. So I would like to configure Vnet on my function app. Things I tried:
Outbound traffic configuration
But I get the error saying: Failed to save subnet ERROR: Delegations of subnet "mysubnet name" cannot be chnaged from [] to [Microsoft.Web/serverFarms] because it is being used by the resource pe-kv-nll-dev-we-01.nic.888888889-80c0.......
Then I also tried to add the service endpoint that you see above Microsfot.Web
but did not work either.
Any ideas how can I do so? Im new to function apps, maybe I should add the IP address of Storage account to my function app under the Outbound addresses? if so how can I do so?
To resolve your networking issue in the Azure Function App, create the Virtual network with minimum two subnets where One is for inbound and the other is for outbound configuration:
Open your Storage Account > Networking >
Enabled from selected virtual networks and IP addresses
with subnet 1
, add your device internet IP, function app inbound IP, checkmark the exceptions section.
Outbound internet traffic
, Content Storage
fields in the configuration as shown in the above screenshot.Public Network Access
field like below:In Simple terms,
WEBSITE_VNET_ROUTE_ALL
app setting to 1
in the environment variables for the function app.Result: