[英]Azure Function healthcheck before slot swap?
I have a function app with a staging slot.我有一个带有暂存槽的 function 应用程序。 I'd like to be able to deploy to the staging slot, and have the app perform an auto swap to the production slot.
我希望能够部署到暂存槽,并让应用自动切换到生产槽。 In the docs for App Service, you're able to write custom warm-up, where "The swap operation waits for this custom warm-up to finish before swapping with the target slot."
在 App Service 的文档中,您可以编写自定义预热,其中“交换操作等待此自定义预热完成,然后再与目标槽交换。”
Is this possible with an Azure Function? Azure Function 可以吗? There seem to be warm-up triggers as specified here , but nothing related to the swap operation.
似乎有此处指定的预热触发器,但与交换操作无关。
My situation is on deployment to the staging slot, I'd like the swap to get a healthy response from a custom endpoint before continuing with the swap.我的情况是部署到暂存槽,我希望交换在继续交换之前从自定义端点获得健康响应。 Is this possible with Azure Functions?
这可能与 Azure 功能有关吗?
We can Create a Function App in Azure portal (or) in Visual Studio.我们可以在 Azure 门户(或)Visual Studio 中创建一个Function App 。 The swap operation can be done in Development Slot.
交换操作可以在 Development Slot 中完成。 As per my knowledge, healthy response from a custom endpoint before continuing with the swap production Slot Swap.
据我所知,在继续进行交换生产插槽交换之前,来自自定义端点的响应是健康的。 This can be done in Health Check in Monitoring within azure function you created.
这可以在您创建的azure function中的 Monitoring 中的Health Check中完成。
The azure function is created in Visual Studio by following the below steps. azure function 是按照以下步骤在 Visual Studio 中创建的。
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace WarmupSample
{
//Declare shared dependencies here
public static class Warmup
{
[FunctionName("Warmup")]
public static void Run([WarmupTrigger()] WarmupContext context,
ILogger log)
{
//Initialize shared dependencies here
log.LogInformation("Function App instance is warm 🌞🌞🌞");
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.