Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KUBERNETES_CLUSTER = myAksCluster
- RESOURCE_GROUP = myResourceGroup
- #!/usr/bin/env bash
- KUBERNETES_CLUSTER=myAksCluster
- RESOURCE_GROUP=myResourceGroup
- # Getting the name of the node resource group. -o tsv is to get the value without " "
- NODE_RESOURCE_GROUP=$(az aks show --resource-group $RESOURCE_GROUP --name $KUBERNETES_CLUSTER --query nodeResourceGroup -o tsv)
- echo "Node Resource Group:" $NODE_RESOURCE_GROUP
- # Creating Public Static IP
- PUBLIC_IP_NAME=DevelopmentStaticIp
- az network public-ip create --resource-group $NODE_RESOURCE_GROUP --name $PUBLIC_IP_NAME --allocation-method static
- # Query the ip
- PUBLIC_IP_ADDRESS=$(az network public-ip list --resource-group $NODE_RESOURCE_GROUP --query [1].ipAddress --output tsv)
- # Output
- # I want to use the value of PUBLIC_IP_ADDRESS variable in Azure DevOps variable groups of the release pipeline
- ⟩ az network public-ip list --resource-group $NODE_RESOURCE_GROUP --query [1].ipAddress -o tsv
- 10.x.x.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement