Skip to content
4 changes: 2 additions & 2 deletions modules/azure/api_management_api/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variable "api_settings" {
service_url = string,
revision = string,
basepath = string,
subscription_required = string,
subscription_required = bool,
openapi_file_path = optional(string),
wsdl_file_path = optional(string)
})
Expand Down Expand Up @@ -227,4 +227,4 @@ variable "role_assignments" {
type = list(string)
description = "Roles to validate in the JWT token's 'roles' claim for access control."
default = []
}
}
4 changes: 1 addition & 3 deletions modules/azure/event_grid_topic/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ variable "source_arm_resource_id" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
6 changes: 2 additions & 4 deletions modules/azure/event_hub/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ variable "consumer_group_name" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
workspace_id = string, // log analytics workspace ID
destination_type = optional(string), // AzureDiagnostics or Dedicated
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/log_analytics_workspace/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ variable "daily_quota_gb" {

variable "loganalytics_diagnostic_setting" {
type = object({
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
destination_type = optional(string) // AzureDiagnostics or Dedicated
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
6 changes: 0 additions & 6 deletions modules/azure/logic_app_standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ variable "log_analytics_workspace_id" {
default = null
}

variable "log_analytics_diagnostic_categories" {
type = list(string)
description = "Optional list of diagnostic categories to override the default categories."
default = []
}

variable "managed_identity_provider" {
type = object({
existing = optional(object({
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/network_security_group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ variable "subnet_ids" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/public_ip/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ variable "domain_name_label" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/service_plan/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ variable "scaling_rules" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
5 changes: 5 additions & 0 deletions modules/azure/storage_account_public/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ terraform {

provider "azurerm" {
features {}

# Use Entra ID (Azure AD) for the Storage data plane instead of Shared Key.
# Required when the target storage account has shared_access_key_enabled = false.
storage_use_azuread = var.storage_use_azuread
}

resource "azurerm_storage_account" "storage_account" {
Expand All @@ -28,6 +32,7 @@ resource "azurerm_storage_account" "storage_account" {
nfsv3_enabled = var.nfsv3_enabled
is_hns_enabled = var.is_hns_enabled
sftp_enabled = var.sftp_enabled
shared_access_key_enabled = var.shared_access_key_enabled

blob_properties {
dynamic "cors_rule" {
Expand Down
28 changes: 16 additions & 12 deletions modules/azure/storage_account_public/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,16 @@ variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
blob = optional(object({
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
destination_type = optional(string) // AzureDiagnostics or Dedicated
})),
queue = optional(object({
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
destination_type = optional(string) // AzureDiagnostics or Dedicated
})),
table = optional(object({
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
destination_type = optional(string) // AzureDiagnostics or Dedicated
}))
file = optional(object({
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
destination_type = optional(string), // AzureDiagnostics or Dedicated
destination_type = optional(string) // AzureDiagnostics or Dedicated
}))
})
description = "Specifies the log categories that have to be sent to Log analytics."
Expand All @@ -149,3 +141,15 @@ variable "sftp_enabled" {
default = false
}

variable "shared_access_key_enabled" {
type = bool
description = "Whether the storage account permits requests to be authorized with the account access key (Shared Key). Set to false to enforce Entra ID (Azure AD) authorization only."
default = true
}

variable "storage_use_azuread" {
type = bool
description = "Authenticate Storage data-plane operations (blob/queue properties) with Entra ID (Azure AD) instead of the account access key. Set to true when shared key access is disabled on the account."
default = false
}

4 changes: 4 additions & 0 deletions modules/azure/storage_blob/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ terraform {

provider "azurerm" {
features {}

# Use Entra ID (Azure AD) for the Storage data plane instead of Shared Key.
# Required when the target storage account has shared_access_key_enabled = false.
storage_use_azuread = var.storage_use_azuread
}

resource "azurerm_storage_blob" "storage_blob" {
Expand Down
7 changes: 7 additions & 0 deletions modules/azure/storage_blob/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ output "storage_blob_url" {
value = "https://${azurerm_storage_blob.storage_blob.storage_account_name}.blob.core.windows.net/${azurerm_storage_blob.storage_blob.storage_container_name}/${azurerm_storage_blob.storage_blob.name}${data.azurerm_storage_account_sas.sas_token.sas}"
sensitive = true
}

# Plain blob URL without SAS. Use together with a managed identity that has
# (at least) Storage Blob Data Reader on the account, e.g. for identity-based
# WEBSITE_RUN_FROM_PACKAGE when shared key access is disabled on the account.
output "storage_blob_url_without_sas" {
value = "https://${azurerm_storage_blob.storage_blob.storage_account_name}.blob.core.windows.net/${azurerm_storage_blob.storage_blob.storage_container_name}/${azurerm_storage_blob.storage_blob.name}"
}
6 changes: 6 additions & 0 deletions modules/azure/storage_blob/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ variable "local_source" {
default = null
}

variable "storage_use_azuread" {
type = bool
description = "Authenticate Storage data-plane operations (blob upload/read) with Entra ID (Azure AD) instead of the account access key. Set to true when shared key access is disabled on the account."
default = false
}

4 changes: 4 additions & 0 deletions modules/azure/storage_container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ terraform {

provider "azurerm" {
features {}

# Use Entra ID (Azure AD) for the Storage data plane instead of Shared Key.
# Required when the target storage account has shared_access_key_enabled = false.
storage_use_azuread = var.storage_use_azuread
}

resource "azurerm_storage_container" "storage_container" {
Expand Down
6 changes: 6 additions & 0 deletions modules/azure/storage_container/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ variable "storage_container_access_type" {
description = "Access type of the storage account."
default = "private"
}

variable "storage_use_azuread" {
type = bool
description = "Authenticate Storage data-plane operations (container create/read) with Entra ID (Azure AD) instead of the account access key. Set to true when shared key access is disabled on the account."
default = false
}
25 changes: 25 additions & 0 deletions modules/azure/storage_table_azapi/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
terraform {
required_version = "~> 1.12"

required_providers {
azapi = {
source = "Azure/azapi"
version = "~> 1.15"
}
}

backend "azurerm" {}
}

provider "azapi" {}

# Entra ID (Azure AD) native equivalent of the azurerm_storage_table module.
# Manages the table via the ARM control plane (Microsoft.Storage), so it does
# NOT require Shared Key / data-plane access and keeps working when the storage
# account has shared_access_key_enabled = false.
resource "azapi_resource" "storage_table" {
type = "Microsoft.Storage/storageAccounts/tableServices/tables@2023-01-01"
name = var.storage_table_name
parent_id = "${var.storage_account_id}/tableServices/default"
body = jsonencode({})
}
7 changes: 7 additions & 0 deletions modules/azure/storage_table_azapi/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "name" {
value = azapi_resource.storage_table.name
}

output "id" {
value = azapi_resource.storage_table.id
}
9 changes: 9 additions & 0 deletions modules/azure/storage_table_azapi/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
variable "storage_account_id" {
type = string
description = "Resource ID of the storage account that hosts the table (e.g. azurerm_storage_account.x.id)."
}

variable "storage_table_name" {
type = string
description = "Name of the storage table."
}
4 changes: 1 addition & 3 deletions modules/azure/stream_analytics/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ variable "stream_query" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/virtual_network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ variable "address_space" {

variable "loganalytics_diagnostic_setting" {
type = object({
workspace_id = string, // log analytics workspace ID
categories = optional(list(string)), // null list,means send all categories
metrics = optional(list(string)), // null list means send all metrics
workspace_id = string, // log analytics workspace ID
})
description = "Specifies the log categories that have to be sent to Log analytics."
default = null
Expand Down
Loading