Adding app settings to existing Function App creates a new storage account
See original GitHub issueCreating a new storage account is an unintended consequence of calling
functionApp.Update()
.WithAppSetting("key", "value")
.Apply();
This also causes the currently deployed functions to be lost since the function app is now pointing at a new storage account.
The offending code is in FunctionAppImpl.cs Line 163-166
I think the root cause of this issue is that the currentStorageAccount is never populated with the actual storage account that is associated with the function app
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Storage considerations for Azure Functions
Storage accounts created as part of the function app create flow in the Azure portal are guaranteed to work with the new function...
Read more >Azure Function App create cannot select existing storage ...
Yes, at present, by design, during creation of the Function app via Azure Portal, you cannot change the storage account, though the portal...
Read more >AzureWebJobsStorage, the secret you don't need in your ...
By default when you create a Function App with its storage account from Azure Portal, the setting AzureWebJobsStorage is automatically ...
Read more >Creating your first Azure Function App
Navigate to the Azure Portal in your cloud account and click the Function App service. Click Create Function App. You can now create...
Read more >Azure Functions with Managed Identity Storage Access
Step 1: Enable Managed Identity for Azure Function App · Step 2: Grant Access to Azure Storage · Step 3: Configure the Function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There’s a simple workaround for app settings, and possibly other properties that are inherited from web apps. This works because a Function App is just a special Web App, so we can use those methods instead:
Interestingly enough, the WebApp.List* methods don’t show function apps, but they can be retrieved through the Get* methods.
Fixed by https://github.com/Azure/azure-libraries-for-net/pull/761