@EnterpriseArchitect , Apologies for delay in response. Here is the PS script to export the Firewalls and Virtual network rules accordingly,
For Firewall Rules,
$Firewall = Get-AzSqlServerFirewallRule -ResourceGroupName "RG-Name" -ServerName "Server-Name"
$FirewallOutput = $Firewall | ForEach-Object {
[PSCustomObject]@{
"ResourceGroupName" = $_.ResourceGroupName
"ServerName" = $_.ServerName
"StartIpAddress" = $_.StartIpAddress
"EndIpAddress" = $_.EndIpAddress
"FirewallRuleName" = $_.FirewallRuleName
}
}
$FirewallOutput | export-csv /home/subhash/data.csv -delimiter ";" -force -notypeinformation
For Virtual Network rules,
Get-AzSqlServerVirtualNetworkRule -ResourceGroupName "RG-Name" -ServerName "Server-Name"
Copy the above the script script and replace the attributes accordingly to export them to CSV files.
----------
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.