forked from AzureCosmosDB/CosmicWorks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-sandbox.sh
39 lines (31 loc) · 840 Bytes
/
init-sandbox.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
37
38
39
#!/bin/bash
deploymentName="CosmicWorks-$RANDOM"
ResourceGroupName=$deploymentName
az deployment group create \
--resource-group $resourceGroupName \
--name $deploymentName \
--template-file azuredeploy.json
uri=$(az deployment group show \
--resource-group $resourceGroupName \
--name $deploymentName \
--query "properties.outputs.uri.value" \
--output tsv)
key=$(az deployment group show \
--resource-group $resourceGroupName \
--name $deploymentName \
--query "properties.outputs.key.value" \
--output tsv)
rm -f "appSettings.json"
appSettings=$(cat << EOF
{
"uri": "$uri",
"key": "$key"
}
EOF
)
echo "$appSettings" > "appSettings.json"
echo "Resource Group Name" $resourceGroupName
echo "Deployment Name" $deploymentName
echo "URI" $uri
echo "Key" $key
echo "Setup complete"