-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_function.sh
More file actions
25 lines (19 loc) · 860 Bytes
/
create_function.sh
File metadata and controls
25 lines (19 loc) · 860 Bytes
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
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "You need to provide one argument - some random uniqe value"
else
RESOURCE_GROUP=pawelbogdanresourceGroup$1
STORAGE_NAME=pawelbogdanstorage$1
APP_NAME=ExamplePythonServerlessFunction$1
# Create a reource group
az group create --name ${RESOURCE_GROUP} --location westeurope
# Create an Azure Storage account
az storage account create --name ${STORAGE_NAME} --location westeurope \
--resource-group ${RESOURCE_GROUP} --sku Standard_LRS
# Create a function app in Azure
az functionapp create --resource-group ${RESOURCE_GROUP} --os-type Linux \
--consumption-plan-location westeurope --runtime python \
--name ${APP_NAME} --storage-account ${STORAGE_NAME}
echo ${APP_NAME} > app_name.txt
fi