Problem accessing event hub using azure function when hub has "Selected networks" on

Joe White 116 Reputation points
2021-10-14T07:13:27.427+00:00

I had this azure function pulling events from azure hub but was requested to secure with "Selected networks".

I've added a list of IP addresses including the azure functions' IP to the vault and to the azure event hub and that worked. but when I do the same to the storage, it won't work

140525-image.png

the azure function uses a trigger to pull events from the hub and i believe it needs the storage because it uses event jobs.

140571-image.png

Any suggestions?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,113 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
646 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,481 Reputation points
    2021-10-15T06:20:55.583+00:00

    @Joe White ,

    Thanks for reach out to us.

    The below settings needs to be added at the Function app settings if you would like to add network restriction to the storage account. Additionally service endpoints has to be enabled for Storage account. Please refer this article for more details :

    https://learn.microsoft.com/en-us/azure/azure-functions/configure-networking-how-to#restrict-your-storage-account-to-a-virtual-network

    WEBSITE_CONTENTOVERVNET = 1.
    WEBSITE_VNET_ROUTE_ALL = 1.
    WEBSITE_DNS_SERVER =168.63.129.16 (applicable when you are using Azure DNS)

    Please take a look at this article, if you would like to know about the above app settings : https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings

    Apart from the details that you mentioned, Azure function uses Storage account to store the source code, app secrets and keys. So it is critical for a function app to be able to reach the storage account.

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.