Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,6 @@ MigrationBackup/
.DS_Store
.idea
src/Database/Prototype/Output
deploy/clouds/digital-ocean/.terraform/providers/registry.terraform.io
deploy/clouds/digital-ocean/terraform.tfstate
deploy/clouds/digital-ocean/.terraform.lock.hcl
33 changes: 33 additions & 0 deletions deploy/microsoft-azure/azure-cli/aks/create-aks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
echo "\r\n====> Create AKS in Microsoft Azure"
echo "Running create-dns.sh script.."
set -e

LOCATION=${LOCATION}
RG=${RG}
NODECOUNT=${NODECOUNT-1}
NODESIZE=${NODESIZE-Standard_F2s}

echo "================================"
echo "\$LOCATION: $LOCATION"
echo "\$RG: $RG"
echo "\$AKS_NAME: $AKS_NAME"
echo "\$NODECOUNT: $NODECOUNT"
echo "\$NODESIZE: $NODESIZE"
echo "================================"

az aks create \
--resource-group $RG \
--name $AKS_NAME \
--vm-set-type VirtualMachineScaleSets \
--node-count $NODECOUNT \
--load-balancer-sku standard \
--node-vm-size $NODESIZE \
--generate-ssh-keys \
--location $LOCATION

az aks get-credentials \
--name $AKS_NAME \
--resource-group $RG

echo "AKS is created: COMPLETED \r\n"
29 changes: 29 additions & 0 deletions deploy/microsoft-azure/azure-cli/aks/delete-aks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
echo "\r\n====> DELETE AKS in Microsoft Azure"
echo "Running delete-dns.sh script.."
set -e

LOCATION=${LOCATION}
RG=${RG}
NODECOUNT=${NODECOUNT-1}
NODESIZE=${NODESIZE-Standard_F2s}

echo "================================"
echo "\$LOCATION: $LOCATION"
echo "\$RG: $RG"
echo "\$AKS_NAME: $AKS_NAME"
echo "\$NODECOUNT: $NODECOUNT"
echo "\$NODESIZE: $NODESIZE"
echo "================================"

# Verify if we want to proceed
read -p "Are you sure you wish to delete an AKS Cluster [y/N]?"
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
exit
fi

az aks delete \
--resource-group $RG \
--name $AKS_NAME

echo "AKS is deleted: COMPLETED \r\n"
36 changes: 36 additions & 0 deletions deploy/microsoft-azure/azure-cli/blob/create-blob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
echo "\r\n====> Create BLOB Stogare in Microsoft Azure"
echo "Running create-blob.sh script.."
# https://markheath.net/post/manage-blob-storage-azure-cli
set -e

LOCATION=${LOCATION}
RG=${RG}

echo "================================"
echo "\$DOMAIN_NAME: $DOMAIN_NAME"
echo "\$RG: $RG"
echo "================================"


storageAccount="o2nextgen"

# create our resource group
az group create -n $RG -l $LOCATION

# create a storage account
az storage account create -n $storageAccount -g $RG -l $LOCATION --sku Standard_LRS

# az storage container create -n o2-storage --resource-group $RG --public-access blob
# az storage container delete --name o2-storage
# az ad signed-in-user show --query objectId -o tsv | az role assignment create \
# --role "Storage Blob Data Contributor" \
# --assignee @- \
# --scope "/subscriptions/<subscription>/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/<storage-account>"

# az storage container create \
# --account-name "<storage-account>" \
# --name <container> \
# --auth-mode login

echo "Created BLOB Storage: COMPLETED \r\n"
13 changes: 13 additions & 0 deletions deploy/microsoft-azure/azure-cli/blob/delete-blob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
echo "\r\n====> Delete BLOB Storage in Microsoft Azure"
echo "Running delete-blob.sh script.."
set -e

echo "================================"
echo "\$DOMAIN_NAME: $DOMAIN_NAME"
echo "\$RG: $RG"
echo "================================"

az storage container delete --name o2-storage

echo "Deleted BLOB Storage: COMPLETED \r\n"
Loading