Added some funky query logic to retrieve CosmosDB Account.

This commit is contained in:
Kevin Harris 2018-02-26 16:09:43 -05:00
Родитель 1912ac4ab4
Коммит dd7054ec5e
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -12,7 +12,7 @@ There are multiple ways of accessing Kubernetes dashboard. You can access throug
* Open an RDP session to the jumpbox IP with username and password
* Run ```az login``` to authenticate with Azure in order to use Azure CLI in the Jumpbox instead of Cloud Shell
* Run ```NAME=$(az group list -o table | grep ODL | awk '{print $1}'``` in order to retrieve the name of the resource group for your Azure account and put it in the NAME variable.
* Run ```NAME=$(az group list -o table | grep ODL | awk '{print $1}')``` in order to retrieve the name of the resource group for your Azure account and put it in the NAME variable.
* Run ```CLUSTER_NAME="${NAME//_}"``` in order to retrieve the cluster name (to remove the underscore)
* Run ```az aks get-credentials -n $CLUSTER_NAME -g $NAME``` in order to get the credentials to access our managed Kubernetes cluster in Azure
* Run ```kubectl proxy```

Просмотреть файл

@ -124,8 +124,11 @@ az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenan
# Grab the name of the Cosmos DB Account.
az cosmosdb list -o table
COSMOS_DB_ACCOUNT_NAME=$(az cosmosdb list -o table --query '[].{name:name,resourceGroup:resourceGroup}' | grep "heroes" | awk '{print $1}')
# Use the name value from above and substitute into {COSMOS_DB_ACCOUNT_NAME}.
az cosmosdb update -n {COSMOS_DB_ACCOUNT_NAME} -g heroes-cosmosdb --capabilities EnableAggregationPipeline
# The Resource Group name comes from the K8S manifest file under ServiceInstance.
az cosmosdb update -n $COSMOS_DB_ACCOUNT_NAME -g heroes-cosmosdb --capabilities EnableAggregationPipeline
```
6. Validate the App Works