Last active
July 5, 2018 09:52
-
-
Save stuartleeks/21eca29239d0a4d7a86961f9971c1362 to your computer and use it in GitHub Desktop.
.azure/alias
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
[group-kill {{rg}}] | |
command = group delete -g {{rg}} --yes --no-wait | |
[get-subscription-id] | |
command = account show --query id -o tsv | |
#subscriptionId=$(az get-subscription-id) | |
[deployment-operation-summary {{rg}} {{name}}] | |
command = group deployment operation list -g {{rg}} -n {{name}} --query "[].{operationId:operationId, state:properties.provisioningState, resourceType: properties.targetResource.resourceType, resourceName:properties.targetResource.resourceName}" | |
[create-spn-for-subscription {{subscriptionId}}] | |
command = ad sp create-for-rbac --role="Contributor" --scope="/subscriptions/{{subscriptionId}}" --query "{clientId:name, secret:password}" | |
[create-spn-for-resource-group {{subscriptionId}} {{rg}}] | |
command = ad sp create-for-rbac --role="Contributor" --scope="/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}" --query "{clientId:name, secret:password}" | |
# [test] | |
# command = az group list | |
#[test {{foo}}] | |
#command = az group {% if foo == "" %} list {% else %} show --name {{foo}} {% endif %} | |
[get-storage-key {{rg}} {{account}}] | |
command = storage account keys list --resource-group {{rg}} --account-name {{account}} --output tsv --query "[0].value" | |
[get-principal-id-for-resource {{resourceName}}] | |
command = resource list --name {{resourceName}} --query [*].identity.principalId -o tsv | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment