Skip to content

Commit baf275c

Browse files
committed
hosted tweaks
1 parent f4a0434 commit baf275c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/CippExtensions/Public/HIBP/Get-HIBPAuth.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ function Get-HIBPAuth {
1919
$Secret = $null
2020
}
2121

22-
if ([string]::IsNullOrEmpty($Secret) -and $ENV:WEBSITE_OWNER_NAME -like '3e625d35-bf18-4e55*' -or $ENV:WEBSITE_OWNER_NAME -like '61e84181-ff2a-4ba3*') {
22+
if ([string]::IsNullOrEmpty($Secret) -and $ENV:CIPP_HOSTED -eq 'true') {
2323
$VaultName = 'hibp-kv'
24+
if ($SubscriptionId -ne $ENV:CIPP_HOSTED_KV_SUB -and $ENV:CIPP_HOSTED_KV_SUB -match '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$') {
25+
$null = Set-AzContext -SubscriptionId $ENV:CIPP_HOSTED_KV_SUB
26+
}
2427
$Secret = Get-AzKeyVaultSecret -VaultName $VaultName -Name 'HIBP' -AsPlainText
2528
}
2629
}

0 commit comments

Comments
 (0)