Azure Storage Table Entity

This page shows how to write Terraform for Storage Table Entity and write them securely.

azurerm_storage_table_entity (Terraform)

The Table Entity in Storage can be configured in Terraform with the resource name azurerm_storage_table_entity. The following sections describe 9 examples of how to use the resource and its parameters.

Example Usage from GitHub

storage.tf#L22
resource "azurerm_storage_table_entity" "demotableentry1" {
  storage_account_name = azurerm_storage_account.data.name
  table_name           = azurerm_storage_table.demo.name

  partition_key = "AAA"
  row_key       = "BBB"
storage.tf#L22
resource "azurerm_storage_table_entity" "demotableentry1" {
  storage_account_name = azurerm_storage_account.data.name
  table_name           = azurerm_storage_table.demo.name

  partition_key = "AAA"
  row_key       = "BBB"
storage.tf#L22
resource "azurerm_storage_table_entity" "demotableentry1" {
  storage_account_name = azurerm_storage_account.data.name
  table_name           = azurerm_storage_table.demo.name

  partition_key = "AAA"
  row_key       = "BBB"
main.tf#L1
resource "azurerm_storage_table_entity" "subscription" {
  storage_account_name = var.storage
  table_name           = var.table

  partition_key = var.partition_key
  row_key       = var.row_key
main.tf#L7
resource "azurerm_storage_table_entity" "this" {
  entity               = var.entity
  partition_key        = var.partition_key
  row_key              = var.row_key
  storage_account_name = var.storage_account_name
  table_name           = var.table_name
r-queries.tf#L6
resource "azurerm_storage_table_entity" "queries" {
  for_each = local.log_queries

  storage_account_name = module.function.storage_account_name
  table_name           = azurerm_storage_table.queries.name

main.tf#L7
resource "azurerm_storage_table_entity" "this" {
  entity               = var.entity
  partition_key        = var.partition_key
  row_key              = var.row_key
  storage_account_name = var.storage_account_name
  table_name           = var.table_name
4-table.tf#L21
resource "azurerm_storage_table_entity" "storage_table_entity_configuration_prod" {
  storage_account_name = azurerm_storage_account.storage_account.name
  table_name           = azurerm_storage_table.storage_table_configuration.name

  partition_key = "global"
  row_key       = "prod"
main.tf#L148
resource "azurerm_storage_table_entity" "config" {
    storage_account_name = azurerm_storage_account.scalingstorageaccount.name
    table_name = azurerm_storage_table.scalingconfig.name
    partition_key = "partition1"
    row_key = var.sapsid
    for_each = var.scalingconfig

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an Entity within a Table in an Azure Storage Account.

Tips: Best Practices for The Other Azure Storage Resources

In addition to the azurerm_storage_account, Azure Storage has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_storage_account

Ensure to use HTTPS connections

It is better to use HTTPS instead of HTTP, which could be vulnerable to person-in-the-middle attacks.

risk-label

azurerm_storage_account_network_rules

Ensure to allow Trusted Microsoft Services to bypass

It is better to allow Trusted Microsoft Services to bypass. They are not able to access storage account unless rules are set to allow them explicitly.

Review your Azure Storage settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure Storage Table Entity?

Azure Storage Table Entity is a resource for Storage of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Storage Table Entity?

For Terraform, the fortunkam/webapp-serviceendpoint, fortunkam/webapp-privatelink and fortunkam/asev3-firewall-appgateway source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.