title: How Do I Add Active Directory To APIM Using Terraform?
body: <p>Following <a href="https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-aad#authorize-developer-accounts-by-using-azure-ad" rel="nofollow noreferrer">this article</a> you can link Azure API Management to Users/Groups in Azure Active Directory.</p>
  
  <p>At the moment I am creating the APIM instance with <a href="https://www.terraform.io/docs/providers/azurerm/r/api_management.html" rel="nofollow noreferrer">Terraform</a></p>
  
  <pre><code>resource "azurerm_api_management" "test" {
    name                = "example-apim"
    location            = "${azurerm_resource_group.test.location}"
    resource_group_name = "${azurerm_resource_group.test.name}"
    publisher_name      = "My Company"
    publisher_email     = "company@terraform.io"
  
    sku {
      name     = "Developer"
      capacity = 1
    }
  }
  </code></pre>
  
  <p>How do I add the Active Directory Identity Provider to this?</p>