File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Modules/CIPPCore/Public/Entrypoints Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,14 @@ Function Invoke-ExecListAppId {
37
37
Write-Information " ERROR: Could not set context to subscription $SubscriptionId ."
38
38
}
39
39
$keyvaultname = ($env: WEBSITE_DEPLOYMENT_ID -split ' -' )[0 ]
40
- $env: ApplicationID = (Get-AzKeyVaultSecret - AsPlainText - VaultName $keyvaultname - Name ' ApplicationID' ).SecretValueText
41
- $env: TenantID = (Get-AzKeyVaultSecret - AsPlainText - VaultName $keyvaultname - Name ' TenantID' ).SecretValueText
40
+ try {
41
+ $env: ApplicationID = (Get-AzKeyVaultSecret - AsPlainText - VaultName $keyvaultname - Name ' ApplicationID' ).SecretValueText
42
+ $env: TenantID = (Get-AzKeyVaultSecret - AsPlainText - VaultName $keyvaultname - Name ' TenantID' ).SecretValueText
43
+ } catch {
44
+ Write-LogMessage - message " Failed to retrieve secrets from KeyVault: $keyvaultname " - LogData (Get-CippException - Exception $_ ) - Sev ' Error'
45
+ $env: ApplicationID = (Get-CippException - Exception $_ )
46
+ $env: TenantID = (Get-CippException - Exception $_ )
47
+ }
42
48
}
43
49
$Results = @ {
44
50
applicationId = $env: ApplicationID
You can’t perform that action at this time.
0 commit comments