Skip to content

Files

Latest commit

 

History

History
50 lines (39 loc) · 1.4 KB

AZU016.md

File metadata and controls

50 lines (39 loc) · 1.4 KB

Pattern: When using Queue Services for a storage account, logging should be enabled

Issue: -

Description

Storage Analytics logs detailed information about successful and failed requests to a storage service.

This information can be used to monitor individual requests and to diagnose issues with a storage service.

Requests are logged on a best-effort basis.

Resolution: Enable logging for Queue Services.

Examples

Example of incorrect code:

resource "azurerm_storage_account" "bad_example" {
    name                     = "example"
    resource_group_name      = data.azurerm_resource_group.example.name
    location                 = data.azurerm_resource_group.example.location
    account_tier             = "Standard"
    account_replication_type = "GRS"
    queue_properties  {
  }
}

Example of correct code:

resource "azurerm_storage_account" "good_example" {
    name                     = "example"
    resource_group_name      = data.azurerm_resource_group.example.name
    location                 = data.azurerm_resource_group.example.location
    account_tier             = "Standard"
    account_replication_type = "GRS"
    queue_properties  {
    logging {
        delete                = true
        read                  = true
        write                 = true
        version               = "1.0"
        retention_policy_days = 10
    }
  }
}