Hi Fabio Henrique Micai Gonzaga •,
Thank you for reaching out to Microsoft Q&A forum!
When deploying a .NET Core 6 web app to a staging deployment slot using an ARM template, warming up the staging slot is essential to ensure smooth transitions during deployment. While auto swap typically handles this automatically, when auto swap is disabled, you can follow these steps to warm up your staging slot:
Manual Warm-Up:
You can manually warm up your staging slot by calling the endpoint yourself. This involves sending requests to the staging slot’s URL to initialize the application and load any necessary resources.
To do this, create a script or use a tool (such as **`curl`** or **`Invoke-WebRequest`** in PowerShell) to send HTTP requests to your staging slot’s URL. These requests should simulate typical user interactions (e.g., accessing different pages, invoking APIs, etc.).
Keep in mind that this approach requires manual intervention and monitoring.
**Automated Warm-Up (Recommended)**:
While auto swap handles warm-up during production slot swaps, you can achieve similar behavior for your staging slot by automating the process.
Consider implementing an Azure Function or Logic App that periodically sends requests to your staging slot’s URL. You can schedule these requests to occur at specific intervals (e.g., every few minutes).
The requests should hit various endpoints within your application to ensure that all components are initialized. For example, you can request the home page, API endpoints, and any other critical routes.
By automating this warm-up process, you ensure that your staging slot remains responsive and ready for traffic.
**Additional Considerations**:
If your web app is hosted in IIS (which is likely the case), set the following configurations:
Set the **start mode** of the app pool to **“AlwaysRunning”**.
Set the **Idle time-out** to **0** to prevent the app pool from shutting down due to inactivity.
Enable **preload** by setting **“preload enabled”** to **true** on the web site.
These settings help keep your application warm and responsive even when there’s no incoming traffic.
Remember that warm-up is crucial to minimize cold start delays and ensure optimal performance when transitioning to the staging slot. Choose the approach that best fits your deployment process and monitoring requirements1