File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Modules/CIPPCore/Public/Authentication Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,14 @@ function Get-CippApiAuth {
66
77 $SubscriptionId = Get-CIPPAzFunctionAppSubId
88
9- # Get auth settings via REST
10- $uri = " https://management.azure.com/subscriptions/$SubscriptionId /resourceGroups/$RGName /providers/Microsoft.Web/sites/$ ( $FunctionAppName ) /config/authsettingsV2/list?api-version=2020-06-01"
11- $response = New-CIPPAzRestRequest - Uri $uri - Method POST - ErrorAction Stop
12- $AuthSettings = $response.properties
9+ try {
10+ # Get auth settings via REST
11+ $uri = " https://management.azure.com/subscriptions/$SubscriptionId /resourceGroups/$RGName /providers/Microsoft.Web/sites/$ ( $FunctionAppName ) /config/authsettingsV2/list?api-version=2020-06-01"
12+ $response = New-CIPPAzRestRequest - Uri $uri - Method POST - ErrorAction Stop
13+ $AuthSettings = $response.properties
14+ } catch {
15+ Write-Warning " Failed to get auth settings via REST: $ ( $_.Exception.Message ) "
16+ }
1317
1418 if (! $AuthSettings -and $env: WEBSITE_AUTH_V2_CONFIG_JSON ) {
1519 $AuthSettings = $env: WEBSITE_AUTH_V2_CONFIG_JSON | ConvertFrom-Json - ErrorAction SilentlyContinue
You can’t perform that action at this time.
0 commit comments