function-app-arm-templates
function-app-arm-templates copied to clipboard
Deploy a function with slot sample issue due to WEBSITE_CONTENTSHARE and CI/CD. Solution is to remove WEBSITE_CONTENTSHARE from the sample
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.