forked from cjoakim/azure-cosmosdb-altgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision-webapp-aci1.ps1
43 lines (34 loc) · 3.42 KB
/
provision-webapp-aci1.ps1
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
37
38
39
40
41
42
43
# az CLI script to create an Azure Container Instance (ACI) for the altgraph_web_app
# using Docker image cjoakim/azure-cosmosdb-altgraph-v2 at Docker Hub.
# See https://hub.docker.com/repository/docker/cjoakim/azure-cosmosdb-altgraph-v2
# Chris Joakim, Microsoft, November 2022
# Parameters - change these per your Azure environment
$subscription=$Env:AZURE_SUBSCRIPTION_ID
$resource_group='chjoakimagaci'
$resource_name='chjoakimagaci1'
$azure_location='eastus'
# Parameters - standard
$container_name="cjoakim/azure-cosmosdb-altgraph-v2:latest"
#echo 'logging in...'
#az login
echo "az account set to subscription: $subscription"
az account set --subscription $subscription
echo 'az account show...'
az account show
echo 'az group delete...'
az group delete --name $resource_group --yes
echo 'az group create...'
az group create --location $azure_location --name $resource_group
echo 'az container create...'
az container create `
--resource-group $resource_group `
--name $resource_name `
--image $container_name `
--cpu 2 `
--memory 8.0 `
--dns-name-label $resource_name `
--ports 8080 `
--os-type Linux `
--restart-policy Always `
--environment-variables AZURE_REDISCACHE_HOST=$Env:AZURE_REDISCACHE_HOST AZURE_REDISCACHE_PORT=$Env:AZURE_REDISCACHE_PORT AZURE_REDISCACHE_KEY=$Env:AZURE_REDISCACHE_KEY AZURE_COSMOSDB_SQL_URI=$Env:AZURE_COSMOSDB_SQL_URI AZURE_COSMOSDB_SQL_RW_KEY1=$Env:AZURE_COSMOSDB_SQL_RW_KEY1 AZURE_COSMOSDB_SQL_DB=$Env:AZURE_COSMOSDB_SQL_DB AZURE_COSMOSDB_SQL_MAX_DEG_PAR=-1 JAVA_OPTS='-Xms4096m -Xmx4096m' > tmp\aci1_create.json
az container show --resource-group $resource_group --name $resource_name > tmp\aci1_show.json