-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcreate_functions.sh
More file actions
executable file
·34 lines (30 loc) · 1.01 KB
/
create_functions.sh
File metadata and controls
executable file
·34 lines (30 loc) · 1.01 KB
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
export AZURE_STORAGE_ACCOUNT=storageaccountclima8442
RESOURCE_GROUP=climate-hackathon-machine-learning-space
functionAppName=loadhotspots
region=westeurope
pythonVersion=3.7
shareName=mapdata
shareId=mapdata$RANDOM
mountPath=/mounted
export AZURE_STORAGE_KEY=$(az storage account keys list -g $RESOURCE_GROUP -n $AZURE_STORAGE_ACCOUNT --query '[0].value' -o tsv)
az functionapp create \
--name $functionAppName \
--storage-account $AZURE_STORAGE_ACCOUNT \
--consumption-plan-location $region \
--resource-group $RESOURCE_GROUP \
--os-type Linux \
--runtime python \
--runtime-version $pythonVersion \
--functions-version 2
az webapp config storage-account add \
--resource-group $RESOURCE_GROUP \
--name $functionAppName \
--custom-id $shareId \
--storage-type AzureFiles \
--share-name $shareName \
--account-name $AZURE_STORAGE_ACCOUNT \
--mount-path $mountPath \
--access-key "$AZURE_STORAGE_KEY"
az webapp config storage-account list \
--resource-group $RESOURCE_GROUP \
--name $functionAppName