Azure Classroomnotes 19/May/2023

Azure Database operations using CLI

  • Create an Azure SQL for mysql using CLI with reusable script
  • Refer Here for the script created
    Preview
  • Exercise: Try Creating a flexible server for postgres
  • Create an Azure Cosmosdb with noSQL API using CLI with reusable script
#!/bin/bash

assign_default_if_empty() {
    value=$1
    default=$2
    if [[ -z $value ]]; then
        echo $default
    else
        echo $value
    fi
}

LOCATION=$(assign_default_if_empty $1 'eastus')
RESOURCE_GROUP=$(assign_default_if_empty $2 'cosmosdemo')
COSMOS_ACC_NAME=$(assign_default_if_empty $3 'qtcosomosdbdemo')

az group create --location $LOCATION --name $RESOURCE_GROUP

az cosmosdb create --name $COSMOS_ACC_NAME \
    --resource-group $RESOURCE_GROUP

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

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