Skip to content

Commit 56feaa3

Browse files
committed
improved deployment script
1 parent 1b43072 commit 56feaa3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

azure-deploy.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,33 @@
33
set -euo pipefail
44

55
# Make sure these values are correct for your environment
6-
resourceGroup="azure-sql-db-dotnet-rest-api"
7-
appName="azure-sql-db-dotnet-rest-api"
6+
resourceGroup="dm-api-02"
7+
appName="dm-api-02"
88
location="WestUS2"
99

1010
# Change this if you are using your own github repository
1111
gitSource="https://github.com/Azure-Samples/azure-sql-db-dotnet-rest-api.git"
1212

13+
# Make sure connection string variable is set
14+
if [[ -z "${ConnectionStrings__DefaultConnection:-}" ]]; then
15+
echo "Plase export Azure SQL connection string:";
16+
echo "export ConnectionStrings__DefaultConnection=\"your-connection-string-here\"";
17+
exit 1;
18+
fi
19+
20+
echo "Creating Resource Group...";
1321
az group create \
1422
-n $resourceGroup \
1523
-l $location
1624

25+
echo "Creating Application Service Plan...";
1726
az appservice plan create \
1827
-g $resourceGroup \
1928
-n "linux-plan" \
2029
--sku B1 \
2130
--is-linux
2231

32+
echo "Creating Web Application...";
2333
az webapp create \
2434
-g $resourceGroup \
2535
-n $appName \
@@ -28,8 +38,11 @@ az webapp create \
2838
--deployment-source-url $gitSource \
2939
--deployment-source-branch master
3040

41+
echo "Configuring Connection String...";
3142
az webapp config connection-string set \
3243
-g $resourceGroup \
3344
-n $appName \
3445
--settings DefaultConnection=$ConnectionStrings__DefaultConnection \
3546
--connection-string-type=SQLAzure
47+
48+
echo "Done."

0 commit comments

Comments
 (0)