-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.azcli
28 lines (20 loc) · 1.17 KB
/
deploy.azcli
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
# create resource group and set defaults
az group create --name stickerApp-RG --location westus
az configure --defaults group=stickerApp-RG location=westus
# create a linux machine
az appservice plan create --name stickerApp-Plan --is-linux --sku S1
# create the site
az webapp create --name stickerapp-cdias --plan stickerApp-Plan
# create database and get the connection string
az documentdb create --kind MongoDB --name stickerapp-mongodb
az documentdb list-connection-strings --name stickerapp-mongodb
# configure settings
az webapp config appsettings set --name stickerapp-cdias --settings PORT=3000 MONGODB_URL=mongodb://stickerapp-mongodb:HilFiU22yQ3Ez4TSLkDzFzac1ceCorsSMjSyBdjzM4To0AcAaC6AIUen4DVRQsK1bIoNFFIUN4rMb6GMIcPDbw==@stickerapp-mongodb.documents.azure.com:10255/?ssl=true
# deploy the container
az webapp config container set --name stickerapp-cdias --docker-custom-image-name chrisdias/stickerapp:latest
# view running site
az webapp browse --name stickerapp-cdias
# cleanup
az webapp delete --name stickerApp-cdias --resource-group stickerApp-RG
az appservice plan delete --name stickerApp-Plan --resource-group stickerApp-RG --yes
az group delete --name stickerApp-RG