-1

I would like to create same named slots on two different environments. The difference is that on Integration I want to have autoswap enabled. I tried doing this using condition like below but this does not pass validation because I have two resources with same name.

  "resources": [
    {
      "condition": "[equals(parameters('env'), 'Integration')]",
      "apiVersion": "2018-11-01",
      "name": "staging", <----------------- HERE
      "type": "slots",
      "location": "[resourceGroup().location]",
      "identity": {
        "type": "SystemAssigned"
      },
      "dependsOn": [
        "[variables('webApiWebSiteName')]"
      ],
      "properties": {
        "siteConfig": {
          "autoSwapSlotName": "production"  <----------------- only difference
        }
      }
    },
    {
      "condition": "[equals(parameters('env'), 'Production')]",
      "apiVersion": "2018-11-01",
      "name": "staging", <----------------- HERE
      "type": "slots",
      "location": "[resourceGroup().location]",
      "identity": {
        "type": "SystemAssigned"
      },
      "dependsOn": [
        "[variables('webApiWebSiteName')]"
      ],
      "properties": {
      }
    }
  ]
Piotr Perak
  • 10,718
  • 9
  • 49
  • 86

1 Answers1

0

You could only created a web app with a name that's unique across all of Azure, because it would generate an endpoint to your website. enter image description here

About slots, you could also check the table in the link. They could hold the same name between different sites( app services), but could not hold the same name under one site. Not sure about the environment you said, if it means the develop and staging environment, the two slots are still under one app service.

Doris Lv
  • 3,083
  • 1
  • 5
  • 14
  • I'm creating one appservice per environment (with different names on each). And I try to add slot with same name to both of them. – Piotr Perak Jan 07 '21 at 14:04