Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. KUBERNETES_CLUSTER = myAksCluster
  2. RESOURCE_GROUP = myResourceGroup
  3.  
  4. #!/usr/bin/env bash
  5.  
  6. KUBERNETES_CLUSTER=myAksCluster
  7. RESOURCE_GROUP=myResourceGroup
  8.  
  9. # Getting the name of the node resource group. -o tsv is to get the value without " "
  10. NODE_RESOURCE_GROUP=$(az aks show --resource-group $RESOURCE_GROUP --name $KUBERNETES_CLUSTER --query nodeResourceGroup -o tsv)
  11. echo "Node Resource Group:" $NODE_RESOURCE_GROUP
  12.  
  13. # Creating Public Static IP
  14. PUBLIC_IP_NAME=DevelopmentStaticIp
  15. az network public-ip create --resource-group $NODE_RESOURCE_GROUP --name $PUBLIC_IP_NAME --allocation-method static
  16.  
  17. # Query the ip
  18. PUBLIC_IP_ADDRESS=$(az network public-ip list --resource-group $NODE_RESOURCE_GROUP --query [1].ipAddress --output tsv)
  19. # Output
  20. # I want to use the value of PUBLIC_IP_ADDRESS variable in Azure DevOps variable groups of the release pipeline
  21.  
  22. ⟩ az network public-ip list --resource-group $NODE_RESOURCE_GROUP --query [1].ipAddress -o tsv
  23. 10.x.x.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement