Add EnableHttpsTrafficOnly for storage (#4789)

This commit is contained in:
alex-3sr
2021-12-22 07:11:44 +01:00
committed by GitHub
parent 6e09f7e132
commit 99772f4c61

View File

@@ -123,7 +123,9 @@ Function GenerateResourcesAndImage {
[Parameter(Mandatory = $False)]
[Switch] $Force,
[Parameter(Mandatory = $False)]
[bool] $AllowBlobPublicAccess = $False
[bool] $AllowBlobPublicAccess = $False,
[Parameter(Mandatory = $False)]
[bool] $EnableHttpsTrafficOnly = $False
)
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
@@ -191,7 +193,7 @@ Function GenerateResourcesAndImage {
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
$storageAccountName += "001"
New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" -AllowBlobPublicAccess $AllowBlobPublicAccess
New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" -AllowBlobPublicAccess $AllowBlobPublicAccess -EnableHttpsTrafficOnly $EnableHttpsTrafficOnly
if ([string]::IsNullOrEmpty($AzureClientId)) {
# Interactive authentication: A service principal is created during runtime.
@@ -266,4 +268,4 @@ Function GenerateResourcesAndImage {
-var "install_password=$($InstallPassword)" `
-var "allowed_inbound_ip_addresses=$($AgentIp)" `
$builderScriptPath
}
}