Created
April 21, 2015 20:16
-
-
Save RaccoonDev/1e65d93ae1f006803fd2 to your computer and use it in GitHub Desktop.
Add-AzureAccount with stored credentials
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
<# | |
# Create PWD File with this command: | |
# Read-Host -AsSecureString | ConvertFrom-SecureString | out-file <<<PATH_TO_FILE>>> | |
You can find instructions how to add deployment user to your subscription here: | |
http://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/ | |
#> | |
$pwdFilePath = "<<<PATH_TO_FILE>>>" | |
if(!(Test-Path $pwdFilePath)) { throw "PWD File not found"; } | |
$username = "<<<AZURE_USER_NAME>>>"; | |
$password = cat $pwdFilePath | ConvertTo-SecureString; | |
$deploymentCreds = New-Object System.Management.Automation.PSCredential($username, $password); | |
Add-AzureAccount -Credential $deploymentCreds; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment