Skip to content

Instantly share code, notes, and snippets.

@Panzerbjrn
Created October 20, 2022 08:33
Show Gist options
  • Save Panzerbjrn/882fd80538b592f21024be7bd0d157e7 to your computer and use it in GitHub Desktop.
Save Panzerbjrn/882fd80538b592f21024be7bd0d157e7 to your computer and use it in GitHub Desktop.
@description('The Azure region into which the resources should be deployed.')
param location string = resourceGroup().location
param CustomerID string
@description('The type of environment.')
@allowed([
'Trial'
'Small'
'Medium'
'Large'
])
param environmentType string
@description('A unique suffix to add to resource names that need to be globally unique.')
@maxLength(14)
param resourceNameSuffix string = uniqueString(resourceGroup().id)
var StorageAccountName = 'sa${CustomerID}${resourceNameSuffix}'
var containerName = 'cont${CustomerID}'
// Define the SKUs for each component based on the environment type.
var environmentConfigurationMap = {
Trial: {
StorageAccount: {
sku: {
name: 'Standard_LRS'
}
}
}
Small: {
StorageAccount: {
sku: {
name: 'Standard_LRS'
}
}
}
Medium: {
StorageAccount: {
sku: {
name: 'Standard_ZRS'
}
}
}
Large: {
StorageAccount: {
sku: {
name: 'Standard_ZRS'
}
}
}
}
resource StorageAccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: StorageAccountName
location: location
kind: 'StorageV2'
sku: environmentConfigurationMap[environmentType].StorageAccount.sku
}
resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = {
name: '${StorageAccount.name}/default/${containerName}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment