Skip to content

Commit 6eea58c

Browse files
Merge pull request #298044 from TomArcherMsft/101-azure-storage-account
101-azure-storage-account
2 parents bf91d22 + 29159a5 commit 6eea58c

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

articles/storage/common/storage-account-create.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ author: akashdubey-ms
77

88
ms.service: azure-storage
99
ms.topic: how-to
10-
ms.date: 10/15/2024
10+
ms.date: 04/10/2025
1111
ms.author: akashdubey
1212
ms.subservice: storage-common-concepts
13-
ms.custom: devx-track-azurecli, devx-track-azurepowershell, engagement-fy23, devx-track-extended-azdevcli
13+
ms.custom: devx-track-azurecli, devx-track-azurepowershell, engagement-fy23, devx-track-extended-azdevcli, devx-track-terraform
1414
---
1515

1616
# Create an Azure storage account
@@ -71,6 +71,12 @@ None.
7171
> [!NOTE]
7272
> The `azd` template includes a `.devcontainer` that already has `azd` installed, therefore you can skip the installation step if you plan to use a `devcontainer` either locally or in an environment like Codespaces.
7373
74+
# [Terraform](#tab/terraform)
75+
76+
- You need an Azure account with an active subscription. You can [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
77+
78+
- [Install and configure Terraform](/azure/developer/terraform/quickstart-configure)
79+
7480
---
7581

7682
Next, sign in to Azure.
@@ -123,7 +129,13 @@ To sign-in to a local installation of `azd` or Codespaces environment, run the [
123129

124130
`azd` will launch a browser window that you can use to sign-in to Azure.
125131

132+
133+
# [Terraform](#tab/terraform)
134+
135+
[Authenticate Terraform to Azure](/azure/developer/terraform/authenticate-to-azure)
136+
126137
---
138+
127139
## Create a storage account
128140

129141
A storage account is an Azure Resource Manager resource. Resource Manager is the deployment and management service for Azure. For more information, see [Azure Resource Manager overview](../../azure-resource-manager/management/overview.md).
@@ -505,7 +517,42 @@ Initialize and run the template for this quickstart using the following steps:
505517
506518
:::image type="content" source="media/storage-account-create/azure-developer-cli-resource-group.png" alt-text="A screenshot showing the deployed resource group and storage account.":::
507519
520+
# [Terraform](#tab/terraform)
521+
522+
The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-storage-account). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-storage-account/TestRecord.md). See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
523+
524+
1. Create a directory in which to test and run the sample Terraform code, and make it the current directory.
525+
526+
1. Create a file named `providers.tf`, and insert the following code:
527+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-storage-account/providers.tf":::
528+
529+
1. Create a file named `main.tf`, and insert the following code:
530+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-storage-account/main.tf":::
531+
532+
1. Create a file named `variables.tf`, and insert the following code:
533+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-storage-account/variables.tf":::
534+
535+
1. Create a file named `outputs.tf`, and insert the following code:
536+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-azure-storage-account/outputs.tf":::
537+
538+
> [!IMPORTANT]
539+
> If you're using the 4.x azurerm provider, you must [explicitly specify the Azure subscription ID](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide#specifying-subscription-id-is-now-mandatory) to authenticate to Azure before running the Terraform commands.
540+
>
541+
> One way to specify the Azure subscription ID without putting it in the `providers` block is to specify the subscription ID in an environment variable named `ARM_SUBSCRIPTION_ID`.
542+
>
543+
> For more information, see the [Azure provider reference documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#argument-reference).
544+
545+
1. Initialize Terraform.
546+
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
547+
548+
1. Create a Terraform execution plan.
549+
[!INCLUDE [terraform-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan.md)]
550+
551+
1. Apply a Terraform execution plan.
552+
[!INCLUDE [terraform-apply-plan.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-apply-plan.md)]
553+
508554
---
555+
509556
## Delete a storage account
510557
511558
Deleting a storage account deletes the entire account, including all data in the account. Be sure to back up any data you want to save before you delete the account.
@@ -579,7 +626,12 @@ To delete the resource group and storage account created by `azd`, use the `azd
579626
azd down
580627
```
581628

629+
# [Terraform](#tab/terraform)
630+
631+
[!INCLUDE [terraform-plan-destroy.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan-destroy.md)]
632+
582633
---
634+
583635
Alternately, you can delete the resource group, which deletes the storage account and any other resources in that resource group. For more information about deleting a resource group, see [Delete resource group and resources](../../azure-resource-manager/management/delete-resource-group.md).
584636

585637
## Create a general purpose v1 storage account

0 commit comments

Comments
 (0)