Last active
June 13, 2017 09:04
-
-
Save gravejester/0bc73d1ca65d2203aeef02c6a46bc2ec to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
SP_NAME=$1 | |
SP_PW=$2 | |
SP_TENANT=$3 | |
# Authenticate to Azure | |
if [ -z "$SP_NAME" ] || [ -z "$SP_PW" ] || [ -z "$SP_TENANT" ] | |
then | |
LOGIN_RESULT=$(az login) | |
else | |
LOGIN_RESULT=$(az login --username $SP_NAME --password $SP_PW --tenant $SP_TENANT --service-principal 2> /dev/null) | |
fi | |
if [ -z "$LOGIN_RESULT" ] | |
then | |
echo "Failed to authenticate to Azure!" | |
else | |
echo "Authenticated to Azure" | |
fi | |
# YOUR CODE GOES HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment