Description
AzureServices is a Storage firewall exception for specific operations by Microsoft’s listed trusted services. The service still needs permission to access the data.
Potential impact
A missing exception can interrupt a backup or diagnostic-log delivery that depends on it. An unnecessary exception broadens network access.
Remediation
Set bypass to include AzureServices only if the service and operation require it. Grant the least data access needed and verify the actual backup or log delivery. Keep None if no exception is needed.
Examples
Both examples retain default_action = "Deny" and the same IP and subnet rules. The second adds the trusted-service network exception.
Before
hcl
resource "azurerm_storage_account" "example" {
name = "storageaccountname"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
network_rules {
default_action = "Deny"
bypass = ["None"]
ip_rules = ["100.0.0.1"]
virtual_network_subnet_ids = [azurerm_subnet.example.id]
}
}
After
hcl
resource "azurerm_storage_account" "example" {
name = "storageaccountname"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
network_rules {
default_action = "Deny"
bypass = ["AzureServices"]
ip_rules = ["100.0.0.1"]
virtual_network_subnet_ids = [azurerm_subnet.example.id]
}
}