forked from scotty-c/hippo-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-azure.sh
executable file
·36 lines (25 loc) · 941 Bytes
/
deploy-azure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
set -o pipefail
read -p "Enter the subscription to use: " SUB
read -p "Enter the resource group for the vm: " RS
read -p "Enter the name for the vm: " NAME
az account set --subscription "$SUB"
curl -L -o cloud-init.txt 'https://raw.githubusercontent.com/scotty-c/hipo-dev/main/cloud-init.yaml'
az vm create \
--resource-group "$RS" \
--name $NAME \
--image Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest \
--size Standard_B2S \
--custom-data cloud-init.txt \
--admin-username ubuntu \
--ssh-key-values ~/.ssh/id_rsa.pub
az vm open-port --port 5001 --resource-group $RS --name $NAME
IP=$(az vm show -d --resource-group $RS --name $NAME --query publicIps -o tsv
)
echo "Access your vm with ssh ubuntu@$IP"
echo ""
echo "To access the Hippo dashboard https://$IP:5001"
echo ""
echo "Please note the dashboard will take a few minutes as we are building it from source"
rm cloud-init.txt