File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 33set -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 "
88location=" WestUS2"
99
1010# Change this if you are using your own github repository
1111gitSource=" 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..." ;
1321az group create \
1422 -n $resourceGroup \
1523 -l $location
1624
25+ echo " Creating Application Service Plan..." ;
1726az appservice plan create \
1827 -g $resourceGroup \
1928 -n " linux-plan" \
2029 --sku B1 \
2130 --is-linux
2231
32+ echo " Creating Web Application..." ;
2333az 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..." ;
3142az 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."
You can’t perform that action at this time.
0 commit comments