Soru

Zorluk: Çok zorConfigure Azure App Services

An administrator is configuring a swap with preview for an Azure App Service web app named WebApp1. WebApp1 runs on a Premium V3 App Service plan and has a production slot and a deployment slot named staging. Regional virtual network integration is configured as follows: the production slot is integrated with VNet1/Subnet1, and the staging slot is integrated with VNet1/Subnet2. An Azure SQL database named SQLDB1 is configured with a virtual network rule that allows connections only from VNet1/Subnet1. The App Setting DbConnectionString (with the Deployment slot setting checkbox unselected) points to SQLDB1 in the production slot and to TestDB in the staging slot. The administrator initiates a swap with preview from the staging slot to the production slot. During the preview phase of the swap, what will be the behavior when the application in the staging slot attempts to connect to a database?

  1. A
    The application in the staging slot will attempt to connect to TestDB using traffic routed through VNet1/Subnet2, and the connection will succeed.
  2. B
    The application in the staging slot will attempt to connect to SQLDB1 using traffic routed through VNet1/Subnet1, and the connection will succeed.
  3. The application in the staging slot will attempt to connect to SQLDB1 using traffic routed through VNet1/Subnet2, and the connection will fail.Cevap
  4. D
    The application in the staging slot will attempt to connect to TestDB using traffic routed through VNet1/Subnet1, and the connection will fail.

Cevap

The application in the staging slot will attempt to connect to SQLDB1 using traffic routed through VNet1/Subnet2, and the connection will fail.
During the preview phase of a swap with preview, non-sticky settings (such as connection strings not marked as deployment slot settings) from the production slot are applied to the staging slot. Therefore, the application in the staging slot attempts to connect to the production database (SQLDB1). However, regional VNet integration is a sticky slot-specific setting, meaning it does not change. The staging slot continues using VNet1/Subnet2. Because the production database's firewall only permits connections from VNet1/Subnet1, the connection from Subnet2 fails.

Adım Adım Çözüm

1
Identify the behavior of a swap with preview on App Settings.
Non-sticky App Settings and connection strings from the target slot (production) are applied to the source slot (staging).
This allows validating how the staging slot code behaves when running against production-equivalent environment variables before committing to the swap.
2
Determine the connection string value in the staging slot during the preview phase.
The DbConnectionString setting in the staging slot changes from pointing to TestDB to pointing to SQLDB1.
Because the Deployment slot setting checkbox is unselected, the connection string is non-sticky and is updated to match the production setting.
3
Evaluate the regional VNet integration configuration for the staging slot during the preview phase.
The staging slot remains integrated with VNet1/Subnet2.
Regional VNet integration is a sticky (slot-specific) setting, meaning it does not swap or copy over between slots.
4
Assess the network connectivity from VNet1/Subnet2 to SQLDB1.
The connection attempt fails.
SQLDB1 has a firewall rule configured to only allow connections from VNet1/Subnet1. Since the staging slot routes traffic via VNet1/Subnet2, the firewall blocks the request.

Anahtar Kavram

Azure App Service deployment slot swap settings stickiness and network integration behavior.
Tahmini Süre:3m 0s
Bu soruyu puanla