New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WEBSITE_CONTENTSHARE should not be used accroding to support #36458
Comments
@danielstocker Thank you so much for bringing this to our attention. I have this assigned to the service lead to be investigated further and will make an update when we have greater clarity. |
@Mike-Ubezzi-MSFT @mike-urnun-msft Thanks for looking into this. Do you need any more information to progress this? |
@danielstocker can you provide more background about what was your original issue which leads to this discovery? I am not sure to properly understand the implication to set it improperly (what you mentioned as an |
Hi @ggirard07, No problem. Let me summarise. If we export a Functions template from the Marketplace (export template on the last page) we get WEBSITE_CONTENTSHARE as a standard app setting. If we use this, then the following situation can happen.
The customer in this particular case then pointed to this article https://nascent.blog/2017/06/27/azure-functions-slots-arm-templates-snags-2-redeploy-causes-unwanted-swap/ This suggests that the setting should be set as a slot setting to fix the behaviour. While this does fix the behaviour in my tests, it seems wrong, because it should not work. Below is a table of what happened in my tests. (after making it a slot setting) My (and the customer's) perception is that the slots should not swap at all anymore, but as described in the article, it still works anyway. I raised this internally as well and people found inconsistent behaviour when changing app settings. (Hence why this is highlighted in my testing grid) For a colleague testing it, updating the app settings, made the slot settings re-apply thus again causing an unintended swap. This then finally (sorry about the lengthy response) led me to raise the support case where the outcome was "just do not set the setting at all". Hope this helps. |
@danielstocker definitively an important information, especially to understand how the slots and swapping are working for Functions vs a traditional webapp with webjobs. |
Hi @ggirard07 and thanks for reading through my diatribe. So what's the way forward from here? :) |
@ggirard07 @ggailey777 @mike-urnun-msft Is more information required to create some documentation clarity around this behaviour? I'm working with a customer who is considering stopping to use function slots because they are unsure about the official guidance around this scenario. Thanks for your help |
@danielstocker Just so that I am clear on what you think will address the documentation issues related to this:
Do you think that would be sufficient? cc. @mattchenderson |
Hi @ggailey777 |
Isn't |
If it isn't applied then the runtime will generate one for you, i think. |
I deployed an ARM with a Consumption-plan and a Function App with a section Microsoft.Web/sites/config named appsettings and the following properties
The deployment returned the following error:
After I also removed parameter WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, the deployment went without any errors. So, there seems to be some required relation between those two settings. |
We have been seeing the exact behavior @tjgalama has described and are also wondering where the file shares with the function packages are stored. Our function apps also include a timer triggered function, so we specify the I have checked in Kudu for clues and it looks like all the files that needs to be there are in the file system (wherever that is, checked on Maybe important to mention, our apps are set up with |
Following some advice, we had set |
We have noticed this same issue over the past few days and need guidance on how to proceed. We have also been following the approach of setting the WEBSITE_CONTENTSHARE as a slot setting to get around the unintentional swap issue but now can't deploy due to this error. I have tried retroactively removing both this and the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING settings to move towards what appears to be the recommended approach of not using either, but these deployments would also fail. |
Remove it and let the runtime pick a name. Thid is how I do it. |
I have tried so many combinations of these properties now and I recently managed to wipe everything in my function. What would be the negative consequence of always setting both WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE in ARM and using different values in WEBSITE_CONTENTSHARE for different slots, ie "share1", "share2" etc? |
In our setup we only modify the staging slot from the ARM template (leaving the production slot untouched) and then perform an automatic swap after code deployment. We sorted this issue using this setup:
This ensures that each new deployment gets a valid but unique WEBSITE_CONTENTSHARE string which doesnt interfer with the primary (production) slot. |
@shubDhond Can we also have some guidance on what to do when the deployment is via Linux docker container on Elastic Premium - it seems to require the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENSHARE to host the Kudu environment even it's not being used for the functions themselves; if the file share doesn't exist then the host doesn't even start (can provide support ticket references if needed) |
@akoz0r is this the same thing as it should work out of the box? That each release to the slot gets its own unique CONTENTSHARE folder? |
Here is a (currently) working ARM Template for Consumption plan when
You have to provide the appsettings in the functionapp's properties/siteConfig/appSettings object instead of using the |
app plan kind: Linux I'm getting this error when doing a swap slot
Looking on azure for diagnosis of the failure: Though according to the docs: I am running a consumption based function app on Linux. This app setting should not apply to the function app I am deploying. Why am I getting the error above during performing a swap slot? Any help would be appreciated. |
Note, when modifying an existing function, and you get Bad Request, try using a valid storage account file name, i.e. lowercase! Also, not sure this is intended, but after moving to File storage, it only affects slot 0. slot 1+ will need the connection string and share name added as well! For now we are not proceeding to do this as our slot is a staging slot, and by moving to a storage account file share, we are unable to list the function and run them manually! Staging does not need to be scaled at this time, though it would be nice to list and run functions anywhere. |
Refer docs: https://docs.microsoft.com/en-gb/azure/azure-functions/functions-infrastructure-as-code#windows (It says do not set WEBSITE_CONTENTSHARE in a banner marked as important) Refer github discussion: MicrosoftDocs/azure-docs#36458 (comment)
I'm using the Portal and not a template. Deleting Consumption plan. Windows. What can I do about this? Swapping can't work for me right now. |
@danielstocker, I have removed WEBSITE_CONTENTSHARE from my arm template. However, still below behavior observed when I run arm template (even without any change) and then deploy function app code(which you mentioned as point 5)
Would like to mention that its not swap rather its clear deployment on production slot (getting 404 error)when i run full pipeline (ARM template and then deploy code). Please suggest |
@danielstocker, Any suggestion on this issue. |
@realrubberduckdev or @ggailey777 may be more able to comment here. While I created the original issue over a year ago, I have not actively worked on this problem for some time. Based on your description @manish1653 I can’t comment on what the expected behavior is today as the components involved have all moved on. (several years of code changes) It might be more sensible to create a fresh issue referencing my summary. |
Thank you @danielstocker. @realrubberduckdev,@ggailey777 - Do I need to create a new ticket for this problem? |
@manish1635 your description sounds similar to what @danielstocker has described above. Although I agree that, given the length of this thread, it is possibly easier for anyone investigating if you create a fresh new issue with steps on how to reproduce this. Referencing this issue will help I think. Good luck :-) |
Hi @realrubberduckdev, Created a new issue: #82452 |
I am also facing this issue using a Premium plan where
This approach also suffers from the same problem upon redeployment. How do you know when to set production slot with
Wouldn't this mean the storage account will start piling up with several file shares, unless you manually go in and delete the unused ones? |
yup! |
I finally figured this issue out with using these 2 settings: WEBSITE_CONTENTSHARE and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. Here's what i did to make it work
"WEBSITE_CONTENTOVERVNET": "1" Also, set "vnetRouteAllEnabled": true in both slot and main site to ensure traffic goes through your vnet. Hope it helps! |
@hb66772-home Won't WEBSITE_CONTENTSHARE and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING be replaced with nothing during the swap if you don't set it in the slot settings? |
using the latest provider v2.97.0 I can see these two values are set correctly for a elastic premium plan. great. I also tested on a dedicated plan, P1v2 and P1v3 , the settings are not applied to main production slot, however they are created for the staging slot? ( azurerm_function_app_slot ) has the same coding not been applied? |
I have the following code:
With this, I see the functions in production slot getting removed during deployment. What am I missing? |
My |
The docs should now be correct and hopefully helpful on this issue. Please reopen or create a new issue if you find that is not the case. #please-close |
Hi there,
I raised support case 119071321000245, where the support engineer advised that WEBSITE_CONTENTSHARE should not be set at all in ARM deployments, as it should be managed by the function runtime. Not setting it seems to avoid an issue where an unintentional swap may occur during a redeployment. (see case information for details)
If this is the official guidance, should we add a note on this page to let people know?
Also, should WEBSITE_CONTENTSHARE be excluded when exporting AppService templates? (via Portal or PowerShell)
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: