Skip to content
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

Deploying a function app overwrites the WEBSITE_CONTENTSHARE value #1090

Open
duncanworthy opened this issue Jan 23, 2024 · 1 comment
Open

Comments

@duncanworthy
Copy link
Contributor

duncanworthy commented Jan 23, 2024

I'm attempting to use the add_slot and zip_deploy_slot on the functions builder, but when I deploy, the value of WEBSITE_CONTENTSHARE is being set to the function app name without any suffix.

Once the staging slot is swapped to production and another deployment to staging takes place, both slots have the same WEBSITE_CONTENTSHARE value, which means that the deployment supposedly to staging has actually overwritten the files running on the production slot, completely defeating the purpose of having a staging slot.

The behaviour regading the WEBSITE_CONTENTSHARE value should follow Azure's defaults which is to use the function app name suffixed with a hyphen and then a series of 8 or 12 random alphanumeric characters to ensure uniqueness between slots.
Furthermore, the value should be set on resource creation and then never modified on subsequent deployment, otherwise it could cause new fileshares to be created in the storage account each time if the suffix value changed.

@ninjarobot
Copy link
Collaborator

@duncanworthy do you have a working example or a template that shows the issue and the expected behavior / template instead?

I believe the issue is here since it's not giving the share name any randomness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants