Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hyphens from SHM and SRE names #1650

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ if ($dryRun.IsPresent) {
}
$result = Invoke-RemoteScript -Shell "PowerShell" -ScriptPath $script -VMName $config.dc.vmName -ResourceGroupName $config.dc.rg -Parameter $params

$null = Set-AzContext -Context $originalContext -ErrorAction Stop
$null = Set-AzContext -Context $originalContext -ErrorAction Stop
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ if ($dryRun -eq "no") {
} catch {
Write-Output "Unable to run Azure Active Directory synchronisation!"
}
}
}
10 changes: 8 additions & 2 deletions deployment/common/Configuration.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ function Get-ShmConfig {

# Storage config
# --------------
$shmStoragePrefix = "shm$($shm.id)"
if ($shm.id.Contains("-")) {
Add-LogMessage -Level Warning "The hyphen character is not allowed in storage account names and will be removed."
}
$shmStoragePrefix = "shm$($shm.id)".Replace("-", "")
$shmStorageSuffix = New-RandomLetters -SeedPhrase "$($shm.subscriptionName)$($shm.id)"
$storageRg = "$($shm.rgPrefix)_STORAGE".ToUpper()
$shm.storage = [ordered]@{
Expand Down Expand Up @@ -737,8 +740,11 @@ function Get-SreConfig {

# Storage config
# --------------
if ($config.sre.id.Contains("-")) {
Add-LogMessage -Level Warning "The hyphen character is not allowed in storage account names and will be removed."
}
$storageRg = "$($config.sre.rgPrefix)_STORAGE".ToUpper()
$sreStoragePrefix = "$($config.shm.id)$($config.sre.id)"
$sreStoragePrefix = "$($config.shm.id)$($config.sre.id)".Replace("-", "")
$sreStorageSuffix = New-RandomLetters -SeedPhrase "$($config.sre.subscriptionName)$($config.sre.id)"
$config.sre.storage = [ordered]@{
accessPolicies = [ordered]@{
Expand Down
Loading