From 0220431634f0ac6a6f4611eab3af302e3dc888dc Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Wed, 16 Jun 2021 17:32:18 +0100 Subject: [PATCH] Refresh readme and docs homepage --- README.md | 19 ++++++++++++++----- docs/index.md | 12 ++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e0421671d8..14b8f74992 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,22 @@ ## Usage Example ``` -# Configure the Azure AD Provider +# Configure Terraform +terraform { + required_providers { + azuread = { + source = "hashicorp/azuread" + version = "~> 2.0.0" + } + } +} + +# Configure the Azure Active Directory Provider provider "azuread" { - version = "~> 1.0.0" # 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: https://terraform.io/docs/providers/azuread/ + # See official docs for more info: https://registry.terraform.io/providers/hashicorp/azuread/latest/docs # client_id = "..." # client_secret = "..." @@ -42,12 +51,12 @@ resource "azuread_service_principal" "example" { # Create a user resource "azuread_user" "example" { user_principal_name = "ExampleUser@${data.azuread_domains.example.domains.0.domain_name}" - display_name = "ExampleUser" + display_name = "Example User" password = "..." } ``` -Further [usage documentation](https://www.terraform.io/docs/providers/azuread/) is available on the Terraform website. +Further [usage documentation](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs) is available on the Terraform website. ## Developer Requirements diff --git a/docs/index.md b/docs/index.md index 66e3824dfc..91ffbcff36 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,6 +22,11 @@ provider "azuread" { tenant_id = "00000000-0000-0000-0000-000000000000" } +# Retrieve domain information +data "azuread_domains" "example" { + only_initial = true +} + # Create an application resource "azuread_application" "example" { display_name = "ExampleApp" @@ -31,6 +36,13 @@ resource "azuread_application" "example" { resource "azuread_service_principal" "example" { application_id = azuread_application.example.application_id } + +# Create a user +resource "azuread_user" "example" { + user_principal_name = "ExampleUser@${data.azuread_domains.example.domains.0.domain_name}" + display_name = "Example User" + password = "..." +} ``` ## Authenticating to Azure Active Directory