Skip to content

Commit 1fb0374

Browse files
authored
Create AccessKeyVaultWithSP.ps1
1 parent c5b423d commit 1fb0374

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

AccessKeyVaultWithSP.ps1

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$ApplicationId = "" # AppID for the Service Princiapl that has Key Vault Secrets User role
2+
$CertificateThumbprint = "" #
3+
$TenantID = "" # The tenant ID for the Service Princiapl that has Key Vault Secrets User role
4+
5+
Connect-AzAccount -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -Tenant $TenantID
6+
7+
$KeyVaultName = "" # The name of your key vault
8+
$KeyVaultSecretName = "" # The name of the secret in the above key vualt
9+
10+
$Key = Get-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName
11+
$Key.SecretValueText # Prints the secret value in clear text

0 commit comments

Comments
 (0)