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

Deploy a function with slot sample issue due to WEBSITE_CONTENTSHARE and CI/CD. Solution is to remove WEBSITE_CONTENTSHARE from the sample #14

Open
OscarArguedasB opened this issue Feb 15, 2024 · 0 comments

Comments

@OscarArguedasB
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ X ] bug report -> please search issues before submitting
- [ ] feature request
- [ X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Deploy the ARM template that creates slots: https://github.com/Azure-Samples/function-app-arm-templates/tree/main/function-app-deployment-slot
According to the documentation: https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentshare
"Not setting WEBSITE_CONTENTSHARE is the recommended approach for an ARM template deployment."

If a anyone use the sample on a CI/CD deployment and then they perform a swap between the slots, the staging content share will be always used to deploy new code.

Behavior:
Deploy to staging->Swap->The code is now in production, old code goes to staging->We perform another deployment running incremental mode->The slot content share is staging again, the code is deploy to this content share->Swap->Code is updated on prod but never on staging

Any log messages given by the failure

N/A

Expected/desired behavior

Deploy to staging->Swap->The code is now in production, old code goes to staging->We perform another deployment running incremental mode->The slot content share keeps as the previous value since we are not specifying it on the ARM template, the code gets deployed to staging->Swap->Code is updated on prod and current prod code goes to staging

Mention any other details that might be useful

azuredeploy.json file

remove:
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[variables('slotContentShareName')]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(parameters('functionAppName'))]"
},


Thanks! We'll be in touch soon.

OscarArguedasB added a commit to OscarArguedasB/function-app-arm-templates that referenced this issue Feb 15, 2024
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

1 participant