Reputation: 45
I already have a function app with several functions deployed through devops pipeline. I want to implement deployment slots to my current environment so that we can have better availability. Followed this document from Microsoft https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots After creating deployment slot. I have edited my devops release pipeline so that the build gets deployed to staging deployment slot. But the function runtime is always not reachable in deployment slot! (which usually comes when function app doesnt have storage account access for functions) I have edited my Host.JSON from
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
}
}
}
to
{
"version": "2.0",
"extensions": {
"durableTask": {
"hubName": "staging"
}
},
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
}
}
}
Added Task hubs which Microsoft has made mandatory right now to use deployment slots https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-task-hubs?tabs=csharp
But still Azure Function Runtime is not reachable. Did my research online but less documentation is available for Function App with deployment slots(that have Task Hubs). Can anyone help me where Iam getting wrong? Any lead on this is very much helpful.
Upvotes: 0
Views: 629
Reputation: 36
So we also ran into this issue. We have separate Dev and Test slots in our function app and our dev slot was throwing random 502 errors and in the portal the function often showed as "unreachable". Also if it worked, it was processing jobs really slowly (like hours instead of the few minutes it should take).
We have also been able to reproduce this situation with fresh resources and deploying code from our local machines.
The problem on our side was that we did specify Task Hubs for every specific slot, but we also had another (non-durable) function resource saving its bookkeeping in the same storage account that we were using for the Durable Function. I am pretty sure it has something to do with conflicts between functions trying to access the bookkeeping information in the storage account, but I have not had the time to confirm this.
Creating a new storage account for just this resource containing the durable function fixed the problem for us. Worst case scenario if this problem persists with the separate Task hubs, you can also consider as a workaround to assign each slot its own storage account, which is not ideal, but a way to move forward I guess..
Task Hubs state that it should be able to handle multiple hubs in one storage account, so if this happens in every scenario and if you followed all steps correctly, this might well be a bug on Microsoft's side..
Upvotes: 0
Reputation: 307
Try using the Azure CLI "az functionapp deploy" to run the deployment from your local machine to see if the same issue exists. If it aslo fails, the problem should be laying on the configurations of your application or the new created deployment slot, rather than Azure Pipelines.
Upvotes: 0