diff --git a/azure/table_azure_storage_account.go b/azure/table_azure_storage_account.go index a6f5aa8d..40f3ac1a 100644 --- a/azure/table_azure_storage_account.go +++ b/azure/table_azure_storage_account.go @@ -324,9 +324,15 @@ func tableAzureStorageAccount(_ context.Context) *plugin.Table { Type: proto.ColumnType_STRING, Transform: transform.FromField("Account.AccountProperties.PrimaryEndpoints.Web"), }, + { + Name: "status_of_primary", + Description: "The status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'.", + Type: proto.ColumnType_STRING, + Transform: transform.FromField("Account.AccountProperties.StatusOfPrimary"), + }, { Name: "provisioning_state", - Description: "The provisioning state of the virtual network resource.", + Description: "The provisioning state of the storage account resource.", Type: proto.ColumnType_STRING, Transform: transform.FromField("Account.AccountProperties.ProvisioningState").Transform(transform.ToString), }, @@ -342,6 +348,12 @@ func tableAzureStorageAccount(_ context.Context) *plugin.Table { Type: proto.ColumnType_STRING, Transform: transform.FromField("Account.AccountProperties.SecondaryLocation"), }, + { + Name: "status_of_secondary", + Description: "The status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'.", + Type: proto.ColumnType_STRING, + Transform: transform.FromField("Account.AccountProperties.StatusOfSecondary"), + }, { Name: "diagnostic_settings", Description: "A list of active diagnostic settings for the storage account.", diff --git a/docs/tables/azure_storage_account.md b/docs/tables/azure_storage_account.md index dbb8f8e6..ae765051 100644 --- a/docs/tables/azure_storage_account.md +++ b/docs/tables/azure_storage_account.md @@ -127,4 +127,20 @@ select jsonb_pretty(diagnostic_settings) as diagnostic_settings from azure_storage_account; -``` \ No newline at end of file +``` + +### List storage accounts with replication but unavailable secondary + +```sql +select + name, + status_of_primary, + status_of_secondary, + sku_name +from + azure_storage_account +where + status_of_primary = 'available' + and status_of_secondary != 'available' + and sku_name in ('Standard_GRS', 'Standard_RAGRS') +```