Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
### Log into Azure using certificate authentication
$AzureADAppID = '49fy7934-dc71-4bdd-8804-h9742fyh93y'
$certThumbprint = (Get-ChildItem Cert:\LocalMachine\My | where {$_.Subject -match 'PowerShell_SP'}).ThumbPrint
$TenantId = '3494h480-6a11-78k0-a439-49hh8f49d0'
Login-AzureRmAccount -ServicePrincipal -TenantId $tenantId -ApplicationId $AzureADAppId -CertificateThumbprint $certThumbprint
$Subscription = (Get-AzureRmSubscription | Out-GridView -Title "Choose a Source & Target Subscription ..." -PassThru)
Select-AzureRmSubscription -SubscriptionId $Subscription.Id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment