Skip to content
Terraform provider for Azure Active Directory
Branch: master
Clone or download
tf-release-bot TeamCity
tf-release-bot and TeamCity Cleanup after v0.3.1 release
Latest commit d8e6074 Apr 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github intial commit of the AzureAD Terraform Provider Jan 8, 2019
azuread Ignore order for reply_urls (#61) Apr 12, 2019
examples/service-principal Adding an example of provisioning a Service Principal Jan 9, 2019
scripts
vendor Upgrade to terraform v0.12-early4 SDK (#56) Apr 18, 2019
version
website update doc for 0.2.0 relaese (#76) Apr 17, 2019
.gitignore
.golangci.yml linting: enable goimports (#54) Feb 27, 2019
.travis.yml Updating the build tooling for go modules Jan 22, 2019
CHANGELOG.md Cleanup after v0.3.1 release Apr 18, 2019
GNUmakefile fix build: update google go get cookie & switch to golangci for linti… Feb 6, 2019
LICENSE intial commit of the AzureAD Terraform Provider Jan 8, 2019
README.md intial commit of the AzureAD Terraform Provider Jan 8, 2019
go.mod Upgrade to terraform v0.12-early4 SDK (#56) Apr 18, 2019
go.sum Upgrade to terraform v0.12-early4 SDK (#56) Apr 18, 2019
main.go intial commit of the AzureAD Terraform Provider Jan 8, 2019
staticcheck.conf update linting to use staticcheck instead of unused and megacheck Jan 22, 2019

README.md

Terraform Provider for Azure Active Directory

General Requirements

  • Terraform 0.10.x
  • Go 1.11.x (to build the provider plugin)

Windows Specific Requirements

For GNU32 Make, make sure its bin path is added to PATH environment variable.*

For Git Bash for Windows, at the step of "Adjusting your PATH environment", please choose "Use Git and optional Unix tools from Windows Command Prompt".*

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-azuread

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone git@github.com:terraform-providers/terraform-provider-azuread

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-azuread
$ make build

Using the provider

# Configure the Microsoft Azure AD Provider
provider "azuread" {
  # NOTE: Environment Variables can also be used for Service Principal authentication
  # Terraform also supports authenticating via the Azure CLI too.
  # see here for more info: http://terraform.io/docs/providers/azuread/index.html

  # subscription_id = "..."
  # client_id       = "..."
  # client_secret   = "..."
  # tenant_id       = "..."
}

# Create an application
resource "azuread_application" "example" {
  name = "ExampleApp"
}

# Create a service principal
resource "azuread_service_principal" "example" {
  application_id = "${azuread_application.example.application_id}"
}

Further usage documentation is available on the Terraform website.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.9+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-azuread
...

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

The following ENV variables must be set in your shell prior to running acceptance tests:

  • ARM_CLIENT_ID
  • ARM_CLIENT_SECRET
  • ARM_SUBSCRIPTION_ID
  • ARM_TENANT_ID
  • ARM_TEST_LOCATION
  • ARM_TEST_LOCATION_ALT

Note: Acceptance tests create real resources, and often cost money to run.

$ make testacc
You can’t perform that action at this time.