Skip to content

Instantly share code, notes, and snippets.

@nordineb
Created October 26, 2016 10:39
Show Gist options
  • Save nordineb/04c18a5243f2b532482c753e00732a59 to your computer and use it in GitHub Desktop.
Save nordineb/04c18a5243f2b532482c753e00732a59 to your computer and use it in GitHub Desktop.
Login With Service Principal
$AzureAccountPassword = "xxxxxxxxxxxxxxxxxxxxxxxxx"
$AzureAccountUsername = "xxxxxxxxxxxxxxxxxxxxxxxxx"
$AzureAccountTenantId = "xxxxxxxxxxxxxxxxxxxxxxxxx"
$secpasswd = ConvertTo-SecureString -AsPlainText $AzureAccountPassword -Force
$mycreds = New-Object System.Management.Automation.PsCredential($AzureAccountUsername,$secpasswd )
Login-AzureRmAccount -ServicePrincipal -Credential $mycreds -TenantId $AzureAccountTenantId
Get-AzureWebsite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment