title: Terraform explicitly pass multiple provider
body: <p>I use terraform for all the infra needs.</p>
  <p>All my configuration is stored in Azure KV in say Subscription &quot;DEVOPS&quot;. All my infra for testing is created in Subscription &quot;Staging&quot;</p>
  <p>Following is my TF code</p>
  <pre><code>variable name {}
  variable location {}
  variable tags {}
   
  provider &quot;azurerm&quot; {
      subscription_id = &quot;Staging&quot;
      features()
  }
  
  provider &quot;azurerm&quot; {
      subscription_id = &quot;DEVOPS&quot;
      features()
      alias = &quot;devopskv&quot;
  }
  
  module &quot;resource_group&quot; {
    source = &quot;../modules/azure-resource-group&quot;
  
      name     = var.name
      location = var.location
      tags     = var.tags
      
      providers = {
          azurerm = azurerm
          azurerm.devopskv = azurerm.devopskv
      }   
  }
  
  ## Module
  
  
  
  data &quot;azurerm_key_vault&quot; &quot;kv&quot; {
    name                = &quot;my-kv&quot;
    resource_group_name = &quot;my-kv-rg&quot;
    provider            = azurerm.devopskv
  }
  
  data &quot;azurerm_key_vault_secret&quot; &quot;name&quot; {
    name         = var.name
    key_vault_id = data.azurerm_key_vault.kv.id
    provider     = azurerm.devopskv
  }
  
  resource &quot;azurerm_resource_group&quot; &quot;resource_group&quot; {
    name     = data.azurerm_key_vault_secret.name.value
    location = var.location
    tags     = var.tags
  }
  
  </code></pre>
  <p><strong>Output expected:</strong>
  RG created in Staging subscription Staging with name fetched from KV residing in DEVOPS Subscription.</p>
  <p><strong>Actual Output:</strong>
  error:
  Resource group &quot;my-kv-rg&quot; is not found.</p>
  <p><strong>Trace Details:</strong>
  TF is trying to fetch the KV &quot;my-kv&quot; from subscription &quot;Staging&quot; and not &quot;DEVOPS&quot;.</p>
  <p>what is wrong on above ?</p>