From 1af73d8e2c7237ab179fc661963819481df4d60a Mon Sep 17 00:00:00 2001 From: Vladimir Lazarenko Date: Thu, 28 Jan 2021 23:50:39 +0100 Subject: [PATCH] Fix a crash in azurerm_storage_account_datasource It crashes if the name passed to it is an empty string. Fixes #10369 --- .../internal/services/storage/storage_account_data_source.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/storage/storage_account_data_source.go b/azurerm/internal/services/storage/storage_account_data_source.go index bce8713fca40..2f8a387029ab 100644 --- a/azurerm/internal/services/storage/storage_account_data_source.go +++ b/azurerm/internal/services/storage/storage_account_data_source.go @@ -26,8 +26,9 @@ func dataSourceStorageAccount() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: ValidateStorageAccountName, }, "resource_group_name": azure.SchemaResourceGroupNameForDataSource(),