- Reuse attributes (location, id, name) from existing resources.
- Avoid duplicating configuration values across stacks or pipelines.
- Keep Terraform operations non-destructive for resources managed elsewhere.
Running Terraform in the configuration directory
Initialize the working directory:
st_name is declared):
azurerm_storage_container):
The argument
storage_account_name on azurerm_storage_container is deprecated in favor of storage_account_id. Use storage_account_id = data.azurerm_storage_account.storage.id to be future-proof.terraform apply, confirm the blob container appears under the storage account’s Blob containers in the Azure portal. The screenshot below shows the Storage Account overview and navigation to Storage browser / Blob containers.

- Use data sources to read existing infrastructure and expose attributes for use in resources and modules.
- Define data sources with
data "<provider>_<type>" "<name>" { ... }and reference attributes withdata.<provider>_<type>.<name>.<attribute>. - Prefer provider-recommended attributes (e.g.,
storage_account_id) to avoid deprecated arguments. - Common issues are usually due to undeclared variables or incorrect resource/type names—declare variables and verify resource names against the provider documentation.
- Terraform documentation: https://www.terraform.io/docs
- AzureRM provider docs: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
- Azure portal: https://portal.azure.com