About application setting "Azure WebJobs Storage" of function application

中島 祐 1 Reputation point
2022-03-04T05:39:05.867+00:00

s it possible to change AzureWebJobsStorage to another storage account after creating a function app?

After creating the function app by specifying the storage account A,
If you change Azure WebJobs Storage in the application settings to another storage account B and run the function app
The function app does not work properly.
An error will occur when referencing the storage account.
The program is trying to connect to storage account B according to Azure WebJobs Storage.
However, the function app seems to keep the settings for storage account A and can only connect to storage account A.

When creating a new function app, if you specify storage account B from the beginning, it will work correctly.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,932 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-03-04T14:33:26.093+00:00

    @中島 祐 ,

    Thanks for reaching out to Q&A.

    You should be able to change the storage account after creating the Function app. However you will lose the source code if you have deployed it.

    When you change the value of the AzureWebJobsStorage setting to a new storage account connections string, the new storage account should have the below containers (azure-webjobs-hosts and azure-webjobs-secrets) created by the function app. After changing the value, you will have to restart the function app for these containers to get created.

    180194-image.png

    This is applicable for function apps running on dedicated app service plan however for apps running on consumption and premium plan, there are additional settings that needs to be added
    WEBSITE_CONTENTAZUREFILECONNECTIONSTRING with storage account connection string value and WEBSITE_CONTENTSHARE with storage account fileshare name. Please note that these settings are not applicable for Linux plans.

    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.