mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-18 15:56:47 +00:00
Optional passthru of AllowBlobPublicAccess (#4425)
This commit is contained in:
@@ -93,6 +93,9 @@ Function GenerateResourcesAndImage {
|
|||||||
If set, access to the VM used by packer to generate the image is restricted to the public IP address this script is run from.
|
If set, access to the VM used by packer to generate the image is restricted to the public IP address this script is run from.
|
||||||
This parameter cannot be used in combination with the virtual_network_name packer parameter.
|
This parameter cannot be used in combination with the virtual_network_name packer parameter.
|
||||||
|
|
||||||
|
.PARAMETER AllowBlobPublicAccess
|
||||||
|
The Azure storage account will be created with this option.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\virtual-environments" -ImageType Ubuntu1804 -AzureLocation "East US"
|
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\virtual-environments" -ImageType Ubuntu1804 -AzureLocation "East US"
|
||||||
#>
|
#>
|
||||||
@@ -118,7 +121,9 @@ Function GenerateResourcesAndImage {
|
|||||||
[Parameter(Mandatory = $False)]
|
[Parameter(Mandatory = $False)]
|
||||||
[Switch] $RestrictToAgentIpAddress,
|
[Switch] $RestrictToAgentIpAddress,
|
||||||
[Parameter(Mandatory = $False)]
|
[Parameter(Mandatory = $False)]
|
||||||
[Switch] $Force
|
[Switch] $Force,
|
||||||
|
[Parameter(Mandatory = $False)]
|
||||||
|
[bool] $AllowBlobPublicAccess = $False,
|
||||||
)
|
)
|
||||||
|
|
||||||
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
|
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
|
||||||
@@ -186,7 +191,7 @@ Function GenerateResourcesAndImage {
|
|||||||
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
|
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
|
||||||
$storageAccountName += "001"
|
$storageAccountName += "001"
|
||||||
|
|
||||||
New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS"
|
New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" -AllowBlobPublicAccess $AllowBlobPublicAccess
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($AzureClientId)) {
|
if ([string]::IsNullOrEmpty($AzureClientId)) {
|
||||||
# Interactive authentication: A service principal is created during runtime.
|
# Interactive authentication: A service principal is created during runtime.
|
||||||
|
|||||||
Reference in New Issue
Block a user