Azure Classroom Series – 22/Jan/2021

Querying/Filtering Azure CLI Results

  • JMES Path is a way to filter the json. In Azure cli JMES Path expression can be applied using –query
  • Refer Here for JMES Path Tutorial
  • Lets take some sample json and query them
{
    "name": "Azure",
    "faculty": "Khaja",
    "Duration": 75
    
}
  • To Fetch the value of name the JMES Path Expression is name Preview
  • Other Json
[
    {
        "name": "Azure",
        "faculty": "Khaja",
        "Duration": 75
    },
    {
        "name": "AWS",
        "faculty": "Khaja",
        "Duration": 75
    },
    {
        "name": "DevOps",
        "faculty": "Khaja",
        "Duration": 90
    }
]
  • Write a JMES Expression to get all the course names Preview
  • Write a JMES Expression to get all the course names and duration Preview Preview
  • Write a JMES Expression to get all the course names where duration is 75
[?Duration==75].name
  • Json
[
    {
        "name": "Azure",
        "faculty": "Khaja",
        "Duration": 75,
        "Certifications": {
            "Admin": "AZ-104",
            "Developer": "AZ-204",
            "Architect" : ["AZ-300", "AZ-301"]
        }
    },
    {
        "name": "AWS",
        "faculty": "Khaja",
        "Duration": 75,
        "Certifications": {
            "Admin": "SysOps",
            "Developer": "AWS Developer Associate",
            "Architect" : ["Solutions Architect Associate", "Solutions Architect Professional"]
        }

    },
    {
        "name": "DevOps",
        "faculty": "Khaja",
        "Duration": 90,
        "Certifications": {
            "Ansible": "Redhat Ansible",
            "Docker": "Docker",
            "Kuberentes" : ["CKA", "CKAD"],
            "Jenkins": "Certified Jenkins Engineer"
        }
    }
]
  • Write a jmes query to display all certifications for all the courses Preview

  • Lets write a cli to query all the resource groups

az group list
  • Query to fetch all the resource groups in centralindia Preview
  • Query to fetch all the resource group names, tags of eastus location Preview
  • Query to fetch all the azure sql server names
  • Refer Here for the change set

Azure SQL Database Management using Azure Powershell

  • Ensure Powershell Extension is installed Preview
  • Ensure Azure Powershell is installed
  • Now login into azure using cmdlet “`Connect-AzAccount“
  • Powershell cmdlets will be in the form of <verb>-<noun>. To know more Refer Here Preview
  • If we need to search for azure Cmd lets the format <verb>-Az<noun> Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube