mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 11:37:00 +00:00
Limit storageaccount name length to 24 characters (#5396)
* Limit storageaccount name length to 24 characters * Check if the length of storageAccountName is more than 24
This commit is contained in:
@@ -192,6 +192,12 @@ Function GenerateResourcesAndImage {
|
||||
# Resource group names may contain special characters, that are not allowed in the storage account name
|
||||
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
|
||||
$storageAccountName += "001"
|
||||
|
||||
|
||||
# Storage Account Name can only be 24 characters long
|
||||
if ($storageAccountName.Length -gt 24){
|
||||
$storageAccountName = $storageAccountName.Substring(0, 24)
|
||||
}
|
||||
|
||||
New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" -AllowBlobPublicAccess $AllowBlobPublicAccess -EnableHttpsTrafficOnly $EnableHttpsTrafficOnly
|
||||
|
||||
@@ -268,4 +274,4 @@ Function GenerateResourcesAndImage {
|
||||
-var "install_password=$($InstallPassword)" `
|
||||
-var "allowed_inbound_ip_addresses=$($AgentIp)" `
|
||||
$builderScriptPath
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user