For Azure SQL: Get-AzureSqlDatabaseServerFirewallRule
For Azure App Service: Add-AzWebAppAccessRestrictionRule
Also see: Managing Virtual network rules on an Azure Storage account
Make sure you look at Azure Policy, as well - to audit and prevent firewall rules from being added etc, Azure Policy is your long term solution.