Unable to Connect to Azure using Certificate thumbprint with Connect-AzAccount

83 Views Asked by At

When I am trying to connect to Azure Powershell it is throwing error.

$Thumbprint = '<<CertificateThumbprint>>'
$TenantId = '<<TenantID>>'
$ApplicationId = '<<App registration ID>>'
Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal 

Steps Performed:

  1. Created App Registration.
  2. Created KeyVault in Azure Portal.
  3. Created Certificate in Keyvault.
  4. Added above created App Registration in Access Control with All certificate access related permissions.
  5. Downloaded uploaded above created certificate in App registration and then executed above powershell script.

Below error I am getting: Connect-AzAccount: No certificate was found in the certificate store with thumbprint xxxxxxxxxxxxxxxxxxxxxxxxxx Could not find tenant id for provided tenant domain 'yyyyyyyyyyyyyyyy'. Please ensure that the provided service principal 'zzzzzzzzzzzzzzzzz' is found in the provided tenant domain.

Note: Replaced Thumbprint, App Id and tenant id with dummy values here.

I have few powershell scripts in my web application and I need to execute those scripts with out providing user name and password and other sensitive information.

0

There are 0 best solutions below