Last active
July 11, 2022 12:48
-
-
Save nyanhp/ee2367de57c40c8d3ed3eb7dab6b1233 to your computer and use it in GitHub Desktop.
Enable Power BI IP ranges on Azure SQL Firewall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enable-AllTheRules | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory)] | |
[string] | |
$ResourceGroupName, | |
[Parameter(Mandatory)] | |
[string] | |
$ServerName | |
) | |
# From https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/limits-and-config#ip-addresses | |
$rules = @( | |
@{Asia = @('13.75.36.64', '13.75.36.79'), @( '13.67.8.240', '13.67.8.255'), @( '52.175.23.169'), @( '52.187.68.19') } | |
@{Australia = @('13.70.72.192', '13.70.72.207'), @( '13.72.243.10'), @( '13.77.50.240', '13.77.50.255'), @( '13.70.136.174') } | |
@{Brazil = @('191.233.203.192', '191.233.203.207'), @( '104.214.19.48', '104.214.19.63'), @( '13.65.86.57'), @( '104.41.59.51') } | |
@{Canada = @('13.71.170.208', '13.71.170.223'), @( '13.71.170.224', '13.71.170.239'), @( '52.237.24.126'), @( '40.69.106.240', '40.69.106.255'), @( '52.242.35.152') } | |
@{Europe = @('13.69.227.208', '13.69.227.223'), @( '52.178.150.68'), @( '13.69.64.208', '13.69.64.223'), @( '52.174.88.118'), @( '137.117.161.181') } | |
@{India = @('104.211.81.192', '104.211.81.207'), @( '52.172.211.12'), @( '40.78.194.240', '40.78.194.255'), @( '13.71.125.22'), @( '104.211.146.224', '104.211.146.239'), @( '104.211.189.218') } | |
@{Japan = @('13.78.108.0', '13.78.108.15'), @( '13.71.153.19'), @( '40.74.100.224', '40.74.100.239'), @( '104.215.61.248') } | |
@{SouthAmerica = @('191.233.203.192', '191.233.203.207'), @( '104.214.19.48', '104.214.19.63'), @( '13.65.86.57'), @( '104.41.59.51') } | |
@{UnitedKingdom = @('51.140.148.0', '51.140.148.15'), @( '51.140.80.51'), @( '51.140.211.0', '51.140.211.15'), @( '51.141.47.105') } | |
@{UnitedStates = @('13.89.171.80', '13.89.171.95'), @( '52.173.245.164'), @( '40.71.11.80', '40.71.11.95'), @( '40.71.249.205'), @( '40.70.146.208', '40.70.146.223'), @( '52.232.188.154'), @( '52.162.107.160', '52.162.107.175'), @( '52.162.242.161'), @( '40.112.243.160', '40.112.243.175'), @( '104.42.122.49') } | |
@{UnitedStatesEA = @('13.71.195.32', '13.71.195.47'), @( '52.161.102.22'), @( '13.66.140.128', '13.66.140.143'), @( '52.183.78.157') } | |
) | |
foreach ($rule in $rules) | |
{ | |
$count = 0 | |
[string]$rulename = $rule.Keys[0] | |
foreach ($iprange in $rule[$rulename]) | |
{ | |
$name = "$rulename$count" | |
$count++ | |
if (Get-AzSqlServerFirewallRule @PSBoundParameters -FirewallRuleName $name) { continue } | |
New-AzSqlServerFirewallRule @PSBoundParameters -FirewallRuleName $($name) -StartIpAddress $($iprange[0]) -EndIpAddress $($iprange[-1]) | |
} | |
} | |
} | |
Enable-AllTheRules -ResourceGroupName '<Your RG here>' -ServerName '<Your !!LOWERCASE!! servername here>' |
do you have similar for azure storage account, enable US
People, this was used to make a point - there is no programmatically accessible source for this. I don't intend to parse through the linked article https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/limits-and-config#ip-addresses which points here https://docs.microsoft.com/en-us/power-platform/admin/online-requirements#ip-addresses-required even one more time.
No worries, I figured it out. Have a great day!
v/r
James Thomas
IT Architect Cloud Computing Services
North Carolina Department of Information Technology
919-754-6261 (Office)
***@***.******@***.***>
Slow internet? No internet? We need to know.
Take the 5-minute survey<https://www.ncbroadband.gov/broadband-nc/north-carolina-broadband-survey>. No internet? Call 919-790-0553 to take the survey.
Cybersecurity is everyone’s responsibility. Do your part. Be cybersmart.
[Logo Description automatically generated]<http://it.nc.gov/>
[Icon Description automatically generated]<https://www.facebook.com/NCDIT/>
[A picture containing ax, clipart Description automatically generated]<https://twitter.com/NCDIT>
[Arrow Description automatically generated]<https://www.youtube.com/channel/UC7IReBUC0aJWV5sUPOOsdjA/videos>
[A picture containing text, clipart Description automatically generated]<https://www.linkedin.com/company/ncdit/>
Email correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties.
From: Jan-Hendrik Peters [MSFT] ***@***.***>
Sent: Monday, July 11, 2022 8:01 AM
To: nyanhp ***@***.***>
Cc: Thomas, James E. ***@***.***>; Comment ***@***.***>
Subject: [External] Re: nyanhp/WhyIsntItEasier.ps1
CAUTION: External email. Do not click links or open attachments unless you verify. Send all suspicious email as an attachment to Report ***@***.***>
@nyanhp commented on this gist.
…________________________________
People, this was used to make a point - there is no programmatically accessible source for this. I don't intend to parse through the linked article https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/limits-and-config#ip-addresses<https://urldefense.com/v3/__https:/docs.microsoft.com/en-us/powerapps/maker/canvas-apps/limits-and-config*ip-addresses__;Iw!!HYmSToo!cFs_P_RWLGPM27gqUGlXkGCpFJPtZGqmhL1ZZnroo2utokAT6VduPMhhYudv2UudEGeqMKHWKKdETsMXd9YTanQRzIt9$> which points here https://docs.microsoft.com/en-us/power-platform/admin/online-requirements#ip-addresses-required<https://urldefense.com/v3/__https:/docs.microsoft.com/en-us/power-platform/admin/online-requirements*ip-addresses-required__;Iw!!HYmSToo!cFs_P_RWLGPM27gqUGlXkGCpFJPtZGqmhL1ZZnroo2utokAT6VduPMhhYudv2UudEGeqMKHWKKdETsMXd9YTangRg5pW$> even one more time.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/gist.github.com/ee2367de57c40c8d3ed3eb7dab6b1233*gistcomment-4227632__;Iw!!HYmSToo!cFs_P_RWLGPM27gqUGlXkGCpFJPtZGqmhL1ZZnroo2utokAT6VduPMhhYudv2UudEGeqMKHWKKdETsMXd9YTath6-rhP$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ARQW7HUZUEJBFNKVPEE53JDVTQEGRANCNFSM4RUFLE5Q__;!!HYmSToo!cFs_P_RWLGPM27gqUGlXkGCpFJPtZGqmhL1ZZnroo2utokAT6VduPMhhYudv2UudEGeqMKHWKKdETsMXd9YTanzpOsFx$>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
________________________________
Email correspondence to and from this address may be subject to the North Carolina Public Records Law and may be disclosed to third parties by an authorized state official.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are these IPs are static. I want to enable ips from my Powerbi North Europe region. I need to know if they are static.