title: The Terraform CLI get a Error: ID was missing the `slots` element
body: <p>I am executing <code>terraform.exe apply</code> on windows and receive the error:</p>
  <pre><code>azurerm_subnet.subnet: Refreshing state... [id=&lt;...&gt;]
  azurerm_app_service_plan.service_plan: Refreshing state... [id=&lt;...&gt;]
  azurerm_app_service.app: Refreshing state... [id=&lt;...&gt;]
  azurerm_app_service_virtual_network_swift_connection.test: Refreshing state... [id=&lt;...&gt;]
  azurerm_app_service_slot.production: Refreshing state... [id=&lt;...&gt;]
  azurerm_app_service_slot.staging: Refreshing state... [id=&lt;...&gt;]
  
  Error: ID was missing the `slots` element
  </code></pre>
  <p>I am attempting to build an Azure WebApp with different slots and docker images with terraform. It should deploy an Azure WebApp with different slots based on Dockerfile images.</p>
  <p>The first run is without an error. I receive the error when I refresh the resources.</p>
  <p>I am using azurerm provider version 2.1.0 and the azurerm backend.</p>
  <p>See the following terraform file:</p>
  <pre><code>terraform {
    backend &quot;azurerm&quot; {
      resource_group_name  = &quot;...&quot;
      storage_account_name = &quot;...&quot;
      container_name       = &quot;...&quot;
      key                  = &quot;...&quot;
  
      subscription_id      = &quot;...&quot;
      tenant_id            = &quot;...&quot;
  
      sas_token            = &quot;....&quot;
    }
  }
  
  provider &quot;azurerm&quot; {
    version = &quot;~&gt;2.1.0&quot;
    features {}
  }
  
  variable &quot;environment&quot; {
    default = &quot;production&quot;
  }
  variable &quot;resource_group&quot; {}
  variable &quot;location&quot; {
    default = &quot;West Europe&quot;
  }
  variable &quot;app_name&quot; {}
  variable &quot;network&quot; {}
  variable &quot;subnet_prefix&quot; {}
  
  resource &quot;azurerm_app_service_plan&quot; &quot;service_plan&quot; {
    name                = var.app_name
    location            = var.location
    resource_group_name = var.resource_group
  
    kind = &quot;Linux&quot;
    reserved = true
  
    sku {
      tier = &quot;Standard&quot;
      size = &quot;S1&quot;
    }
  
    tags = {
      Environment = var.environment
      Cost        = &quot;€0,081/Stunde&quot;
    }
  }
  
  resource &quot;azurerm_app_service&quot; &quot;app&quot; {
    name                = var.app_name
    location            = var.location
    resource_group_name = var.resource_group
    app_service_plan_id = azurerm_app_service_plan.service_plan.id
    depends_on = [azurerm_app_service_plan.service_plan]
  
    site_config {
      linux_fx_version = &quot;DOCKER|&lt;...&gt;.azurecr.io/&lt;...&gt;:0.0.1-95&quot;
      always_on        = &quot;true&quot;
    }
  
    app_settings = {
      ...
    }
  
    storage_account {
      access_key = &quot;...&quot;
      account_name = &quot;...&quot;
      name = &quot;certs&quot;
      share_name = &quot;certs&quot;
      type = &quot;AzureBlob&quot;
      mount_path = &quot;/var/certs&quot;
    }
  
    tags = {
      Environment = var.environment
    }
  }
  
  resource &quot;azurerm_app_service_slot&quot; &quot;production&quot; {
    name                = var.app_name
    app_service_name    = azurerm_app_service.app.name
    location            = azurerm_app_service.app.location
    resource_group_name = var.resource_group
    app_service_plan_id = azurerm_app_service_plan.service_plan.id
  
    depends_on = [azurerm_app_service.app]
  
    site_config {
      linux_fx_version = &quot;DOCKER|&lt;...&gt;.azurecr.io/&lt;...&gt;:0.0.1-95&quot;
      always_on        = &quot;true&quot;
  
    }
  
    app_settings = {
      &quot;SOME_KEY&quot; = &quot;some-value&quot;
    }
  }
  
  resource &quot;azurerm_app_service_slot&quot; &quot;staging&quot; {
    name                = &quot;staging&quot;
    app_service_name    = azurerm_app_service.app.name
    location            = azurerm_app_service.app.location
    resource_group_name = var.resource_group
    app_service_plan_id = azurerm_app_service_plan.service_plan.id
  
    depends_on = [azurerm_app_service.app]
  
    site_config {
      linux_fx_version = &quot;DOCKER|&lt;...&gt;.azurecr.io/&lt;...&gt;:latest&quot;
      always_on        = &quot;true&quot;
    }
  }
  
  resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {
    name                 = var.app_name
    resource_group_name  = var.resource_group
    virtual_network_name = var.network
    address_prefix       = var.subnet_prefix
  
    delegation {
      name = var.app_name
  
      service_delegation {
        name    = &quot;Microsoft.Web/serverFarms&quot;
        actions = [
          &quot;Microsoft.Network/networkinterfaces/*&quot;,
          &quot;Microsoft.Network/virtualNetworks/subnets/action&quot;,
          &quot;Microsoft.Network/virtualNetworks/subnets/join/action&quot;,
          &quot;Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action&quot;,
          &quot;Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action&quot;
        ]
      }
    }
  }
  
  resource &quot;azurerm_app_service_virtual_network_swift_connection&quot; &quot;test&quot; {
    app_service_id = azurerm_app_service.app.id
    subnet_id      = azurerm_subnet.subnet.id
    depends_on = [
      azurerm_app_service.app,
      azurerm_subnet.subnet
    ]
  }
  </code></pre>
  <p>What does a missing slots element mean in this context?</p>