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
  • 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 ReplyCancel 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

Exit mobile version
%%footer%%