Created
January 21, 2022 10:40
-
-
Save PatrickKalkman/e3b62469abfab97a8f9e8f6f486d0e1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Add-AccessRestrictionsToAppServices([string] $ResourceGroupName, | |
[string] $JsonFilename, | |
[bool] $RemoveExistingRules, | |
[string[]] $AppServicesToExclude) | |
{ | |
Write-Information "Retrieving all app services in $ResourceGroupName" | |
$allAppServices = Get-AzWebApp -ResourceGroupName $ResourceGroupName | |
$confirmAppServicesToExclude = Confirm-AppServicesToExclude -AllAppServices $allAppServices -AppServicesToExclude $AppServicesToExclude | |
if (!$confirmAppServicesToExclude) | |
{ | |
$errorMessage = "Did not find one or more of the app services in the exclude list, make sure that the names are spelled correctly" | |
Write-Output $errorMessage | |
throw $errorMessage | |
} | |
Write-Information "Reading the json file with ip rules" | |
$ipRules = ReadJsonFile($JsonFilename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment