I'm currently trying to implement the following storage key rotation architecture from microsoft documentation in our tenant but we have a policy that storage accounts shall not have public network access enabled. (https://learn.microsoft.com/en-us/azure/key-vault/secrets/tutorial-rotation-dual?tabs=azure-cli).
The architecture is basically, as far as I understand, where an access key for a Storage Account is saved in a Key Vault with an expiration date and when it nearly expires a event grid event filters this event and sends it to the function app, which rotates the key and saves the new key in the key vault again.
But as I mentioned we have a policy that storage accounts should not have public network access enabled. This means the storage account, which stores the logs and triggers for the function app should also not have Enabled from all networks
ticked.
Therefore I changed the network setting for the storage account that the function app uses to store logs and triggers from Enabled from all networks
to Enabled from selected virtual networks and IP addresses
. But when I make this change, the EventGrid fails to deliver the event to the function app.
I have tried to create a vnet, create a private endpoint for the storage account, host the function app in a premium app plan and create a vnet integration in the function app. Further, I have also added Microsoft.EventGrid/systemTopics
as Resource instances in the storage account under Networking and the following entries in the function app configuration (according to this link: https://github.com/mcollier/azure-functions-private-storage):
WEBSITE_VNET_ROUTE_ALL to 1
WEBSITE_CONTENTOVERVNET to 1
WEBSITE_DNS_SERVER to 168.63.129.16
But Event Grid still fails to deliver the event to the function app. I suspect that the function app is not available for the EventGrid System Topic. When I go into the Function app this is shown:
But I'm not certain where to problem lies, since I don't really understand how EventGrid is communicating with Azure Functions. Can someone help? Does somebody know how I can implement the architecture without public network access enabled on the storage account?
Thanks and best regards!