Alex Crawford c6ff07a29f oem/azure: normalize endpoint prefixes
Some regions lead with a '.' and others do not...
2016-06-11 09:25:58 -07:00

29 lines
653 B
Bash

getAzureEnvironment() {
azure account show --json | \
jq '.[0].environmentName' --raw-output
}
getManagementEndpoint() {
azure account env show --environment=$(getAzureEnvironment) --json | \
jq '.managementEndpointUrl' --raw-output
}
getStorageEndpointPrefix() {
prefix=$(azure account env show --environment=$(getAzureEnvironment) --json | \
jq '.storageEndpointSuffix' --raw-output)
echo "${prefix##.}"
}
getBlobStorageEndpoint() {
echo "blob.$(getStorageEndpointPrefix)"
}
getSubscriptionId() {
azure account show --json | \
jq '.[0].id' --raw-output
}
getRegions() {
azure vm location list --json | jq '.[].name' --raw-output
}