From 7ed560621a0b2ed22703f34ef4181a5e36b21276 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:47:08 -0800 Subject: [PATCH] Fix storage private endpoint names Use the endpoint string directly instead of indexing it. Add blob and file private endpoint fixtures for the previously untested path. Drafted by Copilot with GPT-6.1 Sol. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- modules/storage/v1/.tests/main.tests.bicep | 28 ++++++++++++++++++++++ modules/storage/v1/main.bicep | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/modules/storage/v1/.tests/main.tests.bicep b/modules/storage/v1/.tests/main.tests.bicep index d48062a..b10ff4b 100644 --- a/modules/storage/v1/.tests/main.tests.bicep +++ b/modules/storage/v1/.tests/main.tests.bicep @@ -15,3 +15,31 @@ module test_required_params '../main.bicep' = { } } } + +// Test blob storage with a private endpoint +module test_blob_private_endpoint '../main.bicep' = { + name: 'test_blob_private_endpoint' + params: { + name: 'sttest002' + location: location + subnetId: resourceId('Microsoft.Network/virtualNetworks/subnets', 'vnet-test', 'snet-test') + tags: { + env: 'test' + } + } +} + +// Test file storage with a private endpoint +module test_file_private_endpoint '../main.bicep' = { + name: 'test_file_private_endpoint' + params: { + name: 'sttest003' + location: location + storageKind: 'FileStorage' + sku: 'Premium_LRS' + subnetId: resourceId('Microsoft.Network/virtualNetworks/subnets', 'vnet-test', 'snet-test') + tags: { + env: 'test' + } + } +} diff --git a/modules/storage/v1/main.bicep b/modules/storage/v1/main.bicep index b8f4906..dd9d4e5 100644 --- a/modules/storage/v1/main.bicep +++ b/modules/storage/v1/main.bicep @@ -396,9 +396,9 @@ resource managementPolicies 'Microsoft.Storage/storageAccounts/managementPolicie @sys.description('Create or update a Private Endpoint for the Storage Account.') module pe '.bicep/pe.bicep' = [for endpoint in endpoints: { - name: 'pend-${storageAccountName}-${endpoint[0]}-001' + name: 'pend-${storageAccountName}-${endpoint}-001' params: { - name: 'pend-${storageAccountName}-${endpoint[0]}-001' + name: 'pend-${storageAccountName}-${endpoint}-001' location: location resourceId: storageAccount.id groupId: endpoint