Created
January 30, 2019 23:19
-
-
Save jkbryan/35d705bb858fe4083e106ea49985b5fd to your computer and use it in GitHub Desktop.
Use the Service Principle created previosly to connect to services - Azure AD and AzureRM as examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TenantId = "<AzureADTenantID>" | |
$ApplicationId = "<AppID>" | |
$Cert=Get-ChildItem cert:\CurrentUser\My\"<CertificateThumbprint>" | |
# Connect to Azure AD: | |
Connect-AzureAD -TenantId $TenantId -ApplicationId $ApplicationId -CertificateThumbprint $Cert.Thumbprint | |
# e.g. Get-AzureADUsers | |
# Connect to AzureRM: | |
Connect-AzureRmAccount -CertificateThumbprint $Cert.Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal | |
# e.g. Get-AzureRMResourceGroup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment