mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +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:
@@ -193,6 +193,12 @@ Function GenerateResourcesAndImage {
|
||||
$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
|
||||
|
||||
if ([string]::IsNullOrEmpty($AzureClientId)) {
|
||||
|
||||
Reference in New Issue
Block a user