Skip to content

Commit

Permalink
Change storage account key lookup in stress bicep template
Browse files Browse the repository at this point in the history
  • Loading branch information
benbp committed Oct 3, 2024
1 parent c517a5b commit 851d948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion tools/stress-cluster/cluster/azure/cluster/storage.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ resource fileshare 'Microsoft.Storage/storageAccounts/fileServices/shares@2021-0
}

output name string = storage.name
output key string = storage.listKeys().keys[0].value
output fileShareName string = fileShareName
12 changes: 10 additions & 2 deletions tools/stress-cluster/cluster/azure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,24 @@ module containerRegistry 'cluster/acr.bicep' = {
}
}

var storageName = 'stressdebug${resourceSuffix}'

module storage 'cluster/storage.bicep' = {
name: 'storage'
scope: group
params: {
storageName: 'stressdebug${resourceSuffix}'
storageName: storageName
fileShareName: 'stressfiles${resourceSuffix}'
location: clusterLocation
}
}

// Get storage account reference for key lookup (avoid key as secret output from storage module)
resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
name: storageName
scope: group
}

var appInsightsInstrumentationKeySecretName = 'appInsightsInstrumentationKey-${resourceSuffix}'
// Value is in dotenv format as it will be appended to stress test container dotenv files
var appInsightsInstrumentationKeySecretValue = 'APPINSIGHTS_INSTRUMENTATIONKEY=${appInsights.outputs.instrumentationKey}\n'
Expand All @@ -120,9 +128,9 @@ var appInsightsConnectionStringSecretValue = 'APPLICATIONINSIGHTS_CONNECTION_STR
// See https://docs.microsoft.com/azure/aks/azure-files-volume#create-a-kubernetes-secret
// See https://docs.microsoft.com/azure/aks/azure-files-csi
var debugStorageKeySecretName = 'debugStorageKey-${resourceSuffix}'
var debugStorageKeySecretValue = storage.outputs.key
var debugStorageAccountSecretName = 'debugStorageAccount-${resourceSuffix}'
var debugStorageAccountSecretValue = storage.outputs.name
var debugStorageKeySecretValue = '${storageAccount.listKeys().keys[0].value}'

module keyvault 'cluster/keyvault.bicep' = {
name: 'keyvault'
Expand Down

0 comments on commit 851d948

Please sign in to comment.