Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AzureSqlPasS - Add Firewall Rule
<#
https://docs.microsoft.com/en-us/powershell/module/azurerm.sql/new-azurermsqlserverfirewallrule
#>
# Init variables
$resourceGroupName = "ResourceGroupName"
$serverName = "ServerName"
$firewallRuleName = "ServerFirewallRuleName"
# Add firewall rules
$newAzureRmSqlServerFirewallRuleSplat = @{
ServerName = $serverName
StartIpAddress = "IpAddressStart"
EndIpAddress = "IpAddressEnd"
ResourceGroupName = $resourceGroupName
FirewallRuleName = $firewallRuleName
}
$null = New-AzureRmSqlServerFirewallRule @newAzureRmSqlServerFirewallRuleSplat
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.