Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…er-azurerm

sync with origin
  • Loading branch information
Greg Oliver committed Oct 23, 2017
2 parents ebc6ee4 + 4da5d26 commit bb50a34
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions website/docs/authenticating_via_azure_cli.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ The output (similar to below) will display one or more Subscriptions - with the
```shell
$ az account set --subscription="SUBSCRIPTION_ID"
```

Also, if you have been authenticating with a service principal and you switch to Azure CLI, you must null out the ARM_* environment variables. Failure to do so causes errors to be thrown.
32 changes: 31 additions & 1 deletion website/docs/r/role_assignment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "azurerm_role_assignment" "test" {
}
```

## Example Usage (Custom Role)
## Example Usage (Custom Role & Service Principal)

```
data "azurerm_subscription" "primary" {}
Expand Down Expand Up @@ -60,6 +60,36 @@ resource "azurerm_role_assignment" "test" {
}
```

## Example Usage (Custom Role & User)

```
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
resource "azurerm_role_definition" "test" {
role_definition_id = "00000000-0000-0000-0000-000000000000"
name = "my-custom-role-definition"
scope = "${data.azurerm_subscription.primary.id}"
permissions {
actions = ["Microsoft.Resources/subscriptions/resourceGroups/read"]
not_actions = []
}
assignable_scopes = [
"${data.azurerm_subscription.primary.id}",
]
}
resource "azurerm_role_assignment" "test" {
name = "00000000-0000-0000-0000-000000000000"
scope = "${data.azurerm_subscription.primary.id}"
role_definition_id = "${azurerm_role_definition.test.id}"
principal_id = "${data.azurerm_client_config.test.client_id}"
}
```

## Argument Reference

The following arguments are supported:
Expand Down

0 comments on commit bb50a34

Please sign in to comment.