{
  "id": "cloud/azure-app-service-deployment-slot-sticky",
  "signature": "Error: Deployment slot 'staging' is locked and cannot be swapped due to 'sticky' configuration settings",
  "signature_zh": "错误：部署槽位 'staging' 因“粘性”配置设置而被锁定，无法交换",
  "regex": "Deployment slot .* is locked and cannot be swapped due to .* sticky .* configuration",
  "domain": "cloud",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The deployment slot has slot-specific (sticky) app settings or connection strings that are not marked as slot-specific, causing the swap to fail because the settings would move with the slot.",
  "root_cause_type": "generic",
  "root_cause_zh": "部署槽位具有未标记为槽位特定的粘性应用设置或连接字符串，导致交换失败，因为这些设置会随槽位移动。",
  "versions": [
    {
      "version": "Azure App Service: Linux",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Runtime: .NET 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Azure CLI: 2.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Recreating the slot does not resolve the underlying sticky settings conflict; the new slot inherits the same configuration unless manually changed.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The portal enforces the same sticky setting rules; manual swap will fail with the same error if sticky settings are misconfigured.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting does not affect slot swap logic or configuration settings.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Mark all slot-specific settings as 'deployment slot settings' using Azure CLI: az webapp config appsettings set --resource-group myRG --name myApp --slot-settings KEY=VALUE",
      "success_rate": 0.95,
      "how": "Mark all slot-specific settings as 'deployment slot settings' using Azure CLI: az webapp config appsettings set --resource-group myRG --name myApp --slot-settings KEY=VALUE",
      "condition": "",
      "sources": []
    },
    {
      "action": "Temporarily remove all slot-specific settings from the source slot before swapping, then reapply them after swap.",
      "success_rate": 0.85,
      "how": "Temporarily remove all slot-specific settings from the source slot before swapping, then reapply them after swap.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use Azure DevOps 'Azure App Service Manage' task with 'Swap with preview' option to validate settings before full swap.",
      "success_rate": 0.9,
      "how": "Use Azure DevOps 'Azure App Service Manage' task with 'Swap with preview' option to validate settings before full swap.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 Azure CLI 将所有槽位特定设置标记为“部署槽位设置”：az webapp config appsettings set --resource-group myRG --name myApp --slot-settings KEY=VALUE",
    "在交换前临时从源槽位中移除所有槽位特定设置，交换后重新应用。",
    "使用 Azure DevOps 的“Azure App Service 管理”任务并选择“预览交换”选项，在完全交换前验证设置。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots",
  "official_doc_section": null,
  "error_code": "SlotSwapLocked",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2025-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}