From 99772f4c61b2c3e1413d874f785ada54005bb414 Mon Sep 17 00:00:00 2001 From: alex-3sr <38663389+alex-3sr@users.noreply.github.com> Date: Wed, 22 Dec 2021 07:11:44 +0100 Subject: [PATCH] Add EnableHttpsTrafficOnly for storage (#4789) --- helpers/GenerateResourcesAndImage.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helpers/GenerateResourcesAndImage.ps1 b/helpers/GenerateResourcesAndImage.ps1 index de68ddfe..d023e103 100644 --- a/helpers/GenerateResourcesAndImage.ps1 +++ b/helpers/GenerateResourcesAndImage.ps1 @@ -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 -} +} \ No newline at end of file