Created
August 10, 2020 14:37
-
-
Save dansecops/3eac17b810dd8f6c70ab72acf27b5101 to your computer and use it in GitHub Desktop.
Az-Connect using Service Principal
This file contains hidden or 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
| $azureApplicationId ="<app registration ID>" | |
| $azureTenantId= "<tenant ID>" | |
| $secret = "<secret>" | |
| $azureSecret = ConvertTo-SecureString "$secret" -AsPlainText -Force | |
| $psCred = New-Object System.Management.Automation.PSCredential($azureApplicationId , $azureSecret) | |
| Clear-AzContext -Force | |
| Connect-AzAccount -Credential $psCred -TenantId $azureTenantId -ServicePrincipal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment