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 3
3
set -euo pipefail
4
4
5
5
# 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 "
8
8
location=" WestUS2"
9
9
10
10
# Change this if you are using your own github repository
11
11
gitSource=" https://github.com/Azure-Samples/azure-sql-db-dotnet-rest-api.git"
12
12
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..." ;
13
21
az group create \
14
22
-n $resourceGroup \
15
23
-l $location
16
24
25
+ echo " Creating Application Service Plan..." ;
17
26
az appservice plan create \
18
27
-g $resourceGroup \
19
28
-n " linux-plan" \
20
29
--sku B1 \
21
30
--is-linux
22
31
32
+ echo " Creating Web Application..." ;
23
33
az webapp create \
24
34
-g $resourceGroup \
25
35
-n $appName \
@@ -28,8 +38,11 @@ az webapp create \
28
38
--deployment-source-url $gitSource \
29
39
--deployment-source-branch master
30
40
41
+ echo " Configuring Connection String..." ;
31
42
az webapp config connection-string set \
32
43
-g $resourceGroup \
33
44
-n $appName \
34
45
--settings DefaultConnection=$ConnectionStrings__DefaultConnection \
35
46
--connection-string-type=SQLAzure
47
+
48
+ echo " Done."
You can’t perform that action at this time.
0 commit comments