Skip to content

Instantly share code, notes, and snippets.

@Merlus Merlus/AsgCreateRules.ps1 Secret
Last active Nov 15, 2017

Embed
What would you like to do?
ASG - Create Security Rules
$webRule = New-AzureRmNetworkSecurityRuleConfig `
-Name "AllowHttps" `
-Access Allow `
-Protocol Tcp `
-Direction outbound `
-Priority 1500 `
-SourceApplicationSecurityGroupId $webAsg.id `
-SourcePortRange * `
-DestinationAddressPrefix VirtualNetwork `
-DestinationPortRange 443
$sqlRule = New-AzureRmNetworkSecurityRuleConfig `
-Name "AllowSql" `
-Access Allow `
-Protocol Tcp `
-Direction outbound `
-Priority 1000 `
-SourceApplicationSecurityGroupId $sqlAsg.id `
-SourcePortRange * `
-DestinationAddressPrefix VirtualNetwork `
-DestinationPortRange 1433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.