terraform/website/source/docs/backends/types/azure.html.md

53 lines
1.5 KiB
Markdown
Raw Normal View History

2017-02-15 19:47:30 +01:00
---
2017-02-15 21:19:38 +01:00
layout: "backend-types"
page_title: "Backend Type: azure"
sidebar_current: "docs-backends-types-standard-azure"
2017-02-15 19:47:30 +01:00
description: |-
2017-02-15 21:19:38 +01:00
Terraform can store state remotely in Azure Storage.
2017-02-15 19:47:30 +01:00
---
# azure
2017-02-15 21:19:38 +01:00
**Kind: Standard (with no locking)**
2017-02-15 19:47:30 +01:00
2017-02-15 21:19:38 +01:00
Stores the state as a given key in a given bucket on [Microsoft Azure Storage](https://azure.microsoft.com/en-us/documentation/articles/storage-introduction/).
2017-02-15 19:47:30 +01:00
2017-02-15 21:19:38 +01:00
## Example Configuration
2017-02-15 19:47:30 +01:00
2017-02-15 21:19:38 +01:00
```hcl
terraform {
backend "azure" {
storage_account_name = "abcd1234"
container_name = "tfstate"
key = "prod.terraform.tfstate"
}
}
2017-02-15 19:47:30 +01:00
```
2017-02-15 21:19:38 +01:00
Note that for the access credentials we recommend using a
[partial configuration](/docs/backends/config.html).
2017-02-15 19:47:30 +01:00
## Example Referencing
```hcl
# setup remote state data source
data "terraform_remote_state" "foo" {
backend = "azure"
config {
storage_account_name = "terraform123abc"
container_name = "terraform-state"
key = "prod.terraform.tfstate"
}
}
```
## Configuration variables
The following configuration options are supported:
* `storage_account_name` - (Required) The name of the storage account
* `container_name` - (Required) The name of the container to use within the storage account
* `key` - (Required) The key where to place/look for state file inside the container
* `access_key` / `ARM_ACCESS_KEY` - (Required) Storage account access key
* `lease_id` / `ARM_LEASE_ID` - (Optional) If set, will be used when writing to storage blob.