Skip to content

Commit 9aad3ac

Browse files
committed
improved readme and script
1 parent f50fa05 commit 9aad3ac

File tree

4 files changed

+17
-58
lines changed

4 files changed

+17
-58
lines changed

CHANGELOG.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to [project-title]
1+
# Contributing
22

33
This project welcomes contributions and suggestions. Most contributions require you to agree to a
44
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ It will care of everything for you:
139139

140140
Enjoy!
141141

142-
## Contributing
142+
# Contributing
143143

144144
This project welcomes contributions and suggestions. Most contributions require you to agree to a
145145
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
@@ -152,3 +152,5 @@ provided by the bot. You will only need to do this once across all repos using o
152152
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
153153
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
154154
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
155+
156+
More details in the full [Contributing](./CONTRIBUTING.md) page.

azure-deploy.sh

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,11 @@ location="WestUS2"
1111
# Change this if you are using your own github repository
1212
gitSource="https://github.com/Azure-Samples/azure-sql-db-node-rest-api.git"
1313

14-
# Read values from local.settings.json
15-
export db_server=`cat local.settings.json | jq .Values.db_server -r`
16-
if [[ -z "${db_server:-}" ]]; then
17-
echo "Please make sure you have 'db_server' set in your local.settings.json file";
18-
exit 1;
19-
fi
20-
21-
export db_database=`cat local.settings.json | jq .Values.db_database -r`
22-
if [[ -z "${db_database:-}" ]]; then
23-
echo "Please make sure you have 'db_database' set in your local.settings.json file";
24-
exit 1;
25-
fi
26-
27-
export db_user=`cat local.settings.json | jq .Values.db_user -r`
28-
if [[ -z "${db_user:-}" ]]; then
29-
echo "Please make sure you have 'db_user' set in your local.settings.json file";
30-
exit 1;
31-
fi
32-
33-
export db_password=`cat local.settings.json | jq .Values.db_password -r`
34-
if [[ -z "${db_password:-}" ]]; then
35-
echo "Please make sure you have 'db_password' set in your local.settings.json file";
36-
exit 1;
14+
# Check that local.settings.json exists
15+
settingsFile="./local.settings.json"
16+
if ! [ -f $settingsFile ]; then
17+
echo "$settingsFile does not exists. Please create it."
18+
exit
3719
fi
3820

3921
echo "Creating Resource Group...";
@@ -72,26 +54,14 @@ az functionapp create \
7254
--runtime node \
7355
--runtime-version 10 \
7456

75-
7657
echo "Configuring Connection String...";
77-
az functionapp config appsettings set \
78-
-g $resourceGroup \
79-
-n $appName \
80-
--settings "db_server=$db_server"
81-
82-
az functionapp config appsettings set \
83-
-g $resourceGroup \
84-
-n $appName \
85-
--settings "db_database=$db_database"
86-
87-
az functionapp config appsettings set \
88-
-g $resourceGroup \
89-
-n $appName \
90-
--settings "db_user=$db_user"
91-
92-
az functionapp config appsettings set \
93-
-g $resourceGroup \
94-
-n $appName \
95-
--settings "db_password=$db_password"
58+
settings=(db_server db_database db_user db_password)
59+
for i in "${settings[@]}"
60+
do
61+
v=`cat local.settings.json | jq .Values.$i -r`
62+
c="az functionapp config appsettings set -g $resourceGroup -n $appName --settings $i='$v'"
63+
#echo $c
64+
eval $c
65+
done
9666

9767
echo "Done."

0 commit comments

Comments
 (0)