Azure Function App - Azure.Storage.Blobs: This request is not authorized to perform this operation

Steve Churcher 21 Reputation points
2022-05-29T10:26:44.787+00:00

I am relatively new to Azure so may be doing something very basically incorrect but this is confusing me so I would appreciate if anyone has any pointers.. I have created what I would suggest is a basic Functions APP - it has one "GET" function which links to an Azure SQL database to return data. This works fine but on occasion all of a sudden I get a "Function Host is not running" error when calling the API.

In the Azure portal, when I go in to the overview of the function app I see a big red error with a title of: "Azure Function App - Azure.Storage.Blobs: This request is not authorized to perform this operation".. From my understanding this happened just out of the blue, I am sure the app itself has been "okay" for a few weeks.

From the above error I cannot determine which storage it is even relating to, is there anywhere I can expand on the error to see more of where it is failing?

I have two storage accounts in the resource group.. both have their network access set to "Enabled from selected virtual networks and IP addresses". If I change this to "Enabled from all networks" and then set to back to "Enabled from selected virtual networks and IP addresses" this sometimes does then resolve the issue and the Functions App returns to normal.. is this an issue within the Azure infrastructure?

Today though this doesn't seem to have initially resolved the issue.. I have changed the setting back and forth a few times, and restarted the function app a few times, but then all of a sudden it decides to work again. I set the storage network access back to "Enabled from selected virtual networks and IP addresses" and everything is once again ok.. this is both confusing and frustrating!

Any pointers to help me diagnose the above would be very much appreciated.. thank you

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,299 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,714 questions
0 comments No comments
{count} votes

Accepted answer
  1. Udaiappa Ramachandran 726 Reputation points MVP
    2022-05-29T17:34:07.003+00:00

    Hello @Steve Churcher ,
    If you use the Azure functions consumption tier, you cannot enable Virtual Network, and hence you cannot use a storage account that is already in the virtual network (unless you add all public IPs of functions to allow access). If you need to check which storage account the function is connecting to, then navigate the configuration link from the function app and then check the value of AzureWebJobsStorage and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING (please refer to the screenshot)
    206502-image.png


1 additional answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,431 Reputation points
    2022-05-31T16:22:51.76+00:00

    Hi @Steve Churcher ,

    Thanks for reaching out to Q&A.

    It appears that you are on a dedicated app service plan so this SKU supports Vnet integration. There was a similar issue discussed in the following thread, even though it is for private link, the concept of vnet integration would remain the same. Please take a look at it and let me know if you have any queries or concerns.

    https://learn.microsoft.com/en-us/answers/questions/842550/function-app-to-write-data-to-storage-account-with.html?childToView=843339#answer-843339

    Please make sure you have the necessary app settings for the function app which is suggested in the above thread.