File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,14 @@ param (
8383 # List of CIDR ranges to add to specific resource firewalls, e.g. @(10.100.0.0/16, 10.200.0.0/16)
8484 [Parameter ()]
8585 [ValidateCount (0 , 399 )]
86+ [Validatescript ({
87+ foreach ($range in $PSItem ) {
88+ if ($range -like ' */31' -or $range -like ' */32' ) {
89+ throw " Firewall IP Ranges cannot contain a /31 or /32 CIDR"
90+ }
91+ }
92+ return $true
93+ })]
8694 [array ] $AllowIpRanges = @ (),
8795
8896 [Parameter ()]
@@ -128,9 +136,9 @@ $azsdkPipelineSubnetMap = @{
128136
129137$poolSubnet = ' '
130138if ($env: Pool ) {
131- $poolSubnet = $azsdkPipelineSubnetMap [$env: Pool ]
139+ $poolSubnet = $azsdkPipelineSubnetMap [$env: Pool ]
132140} else {
133- Write-Warning " Pool environment variable is not defined! Subnet allowlisting will not work and live test resources may be non-compliant."
141+ Write-Warning " Pool environment variable is not defined! Subnet allowlisting will not work and live test resources may be non-compliant."
134142}
135143
136144if (! $ServicePrincipalAuth ) {
@@ -877,7 +885,7 @@ try {
877885 } elseif (! $CI ) {
878886 Write-Host " Enabling access to '$ ( $account.Name ) ' from client IP"
879887 $clientIp ?? = Retry { Invoke-RestMethod - Uri ' https://icanhazip.com/' } # cloudflare owned ip site
880- Retry { Update-AzStorageAccountNetworkRuleSet - ResourceGroupName $ResourceGroupName - Name $account.Name - IPRule @ { Action = ' allow ' ; IPAddressOrRange = $clientIp } | Out-Null }
888+ Retry { Add-AzStorageAccountNetworkRule - ResourceGroupName $ResourceGroupName - Name $account.Name - IPAddressOrRange $clientIp | Out-Null }
881889 }
882890 }
883891 }
Original file line number Diff line number Diff line change 6868 -DeleteAfterHours '${{ parameters.DeleteAfterHours }}' `
6969 @subscriptionConfiguration `
7070 -AdditionalParameters ${{ parameters.ArmTemplateParameters }} `
71+ -AllowIpRanges ('$(azsdk-corp-net-ip-ranges)' -split ',') `
7172 -CI `
7273 -Force `
7374 -Verbose | Out-Null
8990 -DeleteAfterHours '${{ parameters.DeleteAfterHours }}' `
9091 @subscriptionConfiguration `
9192 -AdditionalParameters ${{ parameters.ArmTemplateParameters }} `
93+ -AllowIpRanges ('$(azsdk-corp-net-ip-ranges)' -split ',') `
9294 -CI `
9395 -ServicePrincipalAuth `
9496 -Force `
You can’t perform that action at this time.
0 commit comments