Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6848af2

Browse files
committed
Merge branch 'v6.0'
2 parents 4aa85f9 + a719e1c commit 6848af2

File tree

9 files changed

+122
-71
lines changed

9 files changed

+122
-71
lines changed

‎api/ToDoHandlerEFCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
6464
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
6565
=> optionsBuilder
6666
.LogTo(Console.WriteLine, LogLevel.Information)
67-
.EnableSensitiveDataLogging()
67+
//.EnableSensitiveDataLogging()
6868
.EnableDetailedErrors();
6969

7070
public DbSet<Todo> Todos { get; set; }

‎azure-deploy.arm.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"repositoryToken": "[parameters('repositoryToken')]",
4343
"buildProperties": {
4444
"appLocation": "[parameters('appLocation')]",
45-
"apiLocation": "[parameters('apiLocation')]"
45+
"apiLocation": "[parameters('apiLocation')]",
46+
"appArtifactLocation": "dist"
4647
}
4748
},
4849
"sku": {

‎azure-deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ az group create \
3131

3232
echo "Deploying Static Web App...";
3333
az deployment group create \
34-
--name "swa-deploy-5.0" \
34+
--name "swa-deploy-6.0" \
3535
--resource-group $resourceGroup \
3636
--template-file azure-deploy.arm.json \
3737
--parameters \
3838
name=$appName \
3939
location=$location \
4040
repositoryToken=$gitToken \
4141
repositoryUrl=$gitSource \
42-
branch="v5.0" \
42+
branch="v6.0" \
4343
appLocation="./client" \
4444
apiLocation="./api" \
4545
azureSQL="$azureSQL"

‎cleanup.v6.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ rm -rf ./client/node_modules
1212
rm -rf ./client/dist
1313

1414
# cleanup DATABASE
15-
rm -rf ./database/deploy/bin
16-
rm -rf ./database/deploy/obj
15+
rm -rf ./database/deploy
1716

1817
# cleanup TEST
1918
rm -rf ./test

‎client/src/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const API = "/api/ef/todo";
1+
const API = "/api/todo";
22

33
export default API;

‎database/azure-create-sql-db.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,23 @@ else
1212
exit 1
1313
fi
1414

15-
echo "Creating Resource Group...";
16-
az group create \
17-
-n $resourceGroup \
18-
-l $location
19-
20-
echo "Deploying Azure SQL Database...";
21-
pwd1=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 6 ; echo`
22-
pwd2=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 6 ; echo`
23-
adminPwd="${pwd1}_${pwd2}"
24-
adminName="db_admin"
2515
azureSQLDB="todo_v6"
26-
azureSQLServer=$(az deployment group create \
16+
azureSQLSRV=`az sql server list -g $resourceGroup --query '[0].name' -o tsv`
17+
echo "(Server: '$azureSQLSRV', Location: '$location', Resource Group: '$resourceGroup')"
18+
azureSQLServerName=$(az deployment group create \
2719
--name "sql-db-deploy-6.0" \
2820
--resource-group $resourceGroup \
2921
--template-file azure-sql-db.arm.json \
3022
--parameters \
23+
databaseServer=$azureSQLSRV \
3124
databaseName=$azureSQLDB \
3225
location=$location \
33-
databaseAdministratorLogin=$adminName \
34-
databaseAdministratorLoginPassword=$adminPwd \
3526
--query properties.outputs.databaseServer.value \
3627
-o tsv \
3728
)
3829

3930
echo "Azure SQL Database available at";
4031
echo "- Location: $location"
41-
echo "- Server: $azureSQLServer"
32+
echo "- Server: $azureSQLServerName"
4233
echo "- Database: $azureSQLDB"
43-
echo "- Admin Login: $adminName"
44-
echo "- Admin Password: $adminPwd"
4534
echo "Done."

‎database/azure-create-sql-srv.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Load values from .env file
5+
FILE="../.env"
6+
if [[ -f $FILE ]]; then
7+
echo "Loading from $FILE"
8+
eval $(egrep "^[^#;]" $FILE | tr '\n' '0円' | xargs -0 -n1 | sed 's/^/export /')
9+
else
10+
echo "Enviroment file not detected."
11+
echo "Please make sure there is a .env file in the sample root folder and run the script again."
12+
exit 1
13+
fi
14+
15+
echo "Creating Resource Group...";
16+
az group create \
17+
-n $resourceGroup \
18+
-l $location
19+
20+
echo "Deploying Azure SQL Logical Server...";
21+
pwd1=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 6 ; echo`
22+
pwd2=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 6 ; echo`
23+
adminPwd="${pwd1}_${pwd2}"
24+
adminName="db_admin"
25+
azureSQLServer=$(az deployment group create \
26+
--name "sql-srv-deploy-6.0" \
27+
--resource-group $resourceGroup \
28+
--template-file azure-sql-srv.arm.json \
29+
--parameters \
30+
location=$location \
31+
databaseAdministratorLogin=$adminName \
32+
databaseAdministratorLoginPassword=$adminPwd \
33+
--query properties.outputs.databaseServer.value \
34+
-o tsv \
35+
)
36+
37+
echo "Azure SQL Database available at";
38+
echo "- Location: $location"
39+
echo "- Server: $azureSQLServer"
40+
echo "- Admin Login: $adminName"
41+
echo "- Admin Password: $adminPwd"
42+
echo "Done."

‎database/azure-sql-db.arm.json

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
},
88
"databaseServer": {
99
"type": "string",
10-
"defaultValue": "[uniqueString(resourceGroup().id)]",
1110
"metadata": {
1211
"description": "Azure SQL Database server"
1312
}
@@ -17,65 +16,21 @@
1716
"metadata": {
1817
"description": "Azure SQL Database name"
1918
}
20-
},
21-
"databaseAdministratorLogin": {
22-
"type": "string",
23-
"defaultValue": "db_admin",
24-
"metadata": {
25-
"description": "Azure SQL Database admin user name"
26-
}
27-
},
28-
"databaseAdministratorLoginPassword": {
29-
"type": "securestring",
30-
"defaultValue": "AzUR3SqL_PAzzw0rd!",
31-
"metadata": {
32-
"description": "Azure SQL Database admin password"
33-
}
34-
}
19+
}
3520
},
36-
"resources": [
37-
{
38-
"type": "Microsoft.Sql/servers",
39-
"apiVersion": "2021年02月01日-preview",
40-
"name": "[parameters('databaseServer')]",
41-
"location": "[parameters('location')]",
42-
"kind": "v12.0",
43-
"properties": {
44-
"administratorLogin": "[parameters('databaseAdministratorLogin')]",
45-
"administratorLoginPassword": "[parameters('databaseAdministratorLoginPassword')]",
46-
"version": "12.0",
47-
"minimalTlsVersion": "1.2",
48-
"publicNetworkAccess": "Enabled",
49-
"restrictOutboundNetworkAccess": "Disabled"
50-
}
51-
},
21+
"resources": [
5222
{
5323
"type": "Microsoft.Sql/servers/databases",
5424
"apiVersion": "2021年02月01日-preview",
5525
"name": "[concat(parameters('databaseServer'), '/', parameters('databaseName'))]",
56-
"location": "[parameters('location')]",
57-
"dependsOn": [
58-
"[resourceId('Microsoft.Sql/servers', parameters('databaseServer'))]"
59-
],
26+
"location": "[parameters('location')]",
6027
"sku": {
6128
"name": "GP_Gen5",
6229
"capacity": 2
6330
},
6431
"properties":{
6532
"highAvailabilityReplicaCount": 0
6633
}
67-
},
68-
{
69-
"type": "Microsoft.Sql/servers/firewallRules",
70-
"apiVersion": "2021年02月01日-preview",
71-
"name": "[concat(parameters('databaseServer'), '/AllowAllWindowsAzureIps')]",
72-
"dependsOn": [
73-
"[resourceId('Microsoft.Sql/servers', parameters('databaseServer'))]"
74-
],
75-
"properties": {
76-
"startIpAddress": "0.0.0.0",
77-
"endIpAddress": "0.0.0.0"
78-
}
7934
}
8035
],
8136
"outputs": {

‎database/azure-sql-srv.arm.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"location": {
6+
"type": "string"
7+
},
8+
"databaseServer": {
9+
"type": "string",
10+
"defaultValue": "[uniqueString(resourceGroup().id)]",
11+
"metadata": {
12+
"description": "Azure SQL Database server"
13+
}
14+
},
15+
"databaseAdministratorLogin": {
16+
"type": "string",
17+
"defaultValue": "db_admin",
18+
"metadata": {
19+
"description": "Azure SQL Database admin user name"
20+
}
21+
},
22+
"databaseAdministratorLoginPassword": {
23+
"type": "securestring",
24+
"defaultValue": "AzUR3SqL_PAzzw0rd!",
25+
"metadata": {
26+
"description": "Azure SQL Database admin password"
27+
}
28+
}
29+
},
30+
"resources": [
31+
{
32+
"type": "Microsoft.Sql/servers",
33+
"apiVersion": "2021年02月01日-preview",
34+
"name": "[parameters('databaseServer')]",
35+
"location": "[parameters('location')]",
36+
"kind": "v12.0",
37+
"properties": {
38+
"administratorLogin": "[parameters('databaseAdministratorLogin')]",
39+
"administratorLoginPassword": "[parameters('databaseAdministratorLoginPassword')]",
40+
"version": "12.0",
41+
"minimalTlsVersion": "1.2",
42+
"publicNetworkAccess": "Enabled",
43+
"restrictOutboundNetworkAccess": "Disabled"
44+
}
45+
},
46+
{
47+
"type": "Microsoft.Sql/servers/firewallRules",
48+
"apiVersion": "2021年02月01日-preview",
49+
"name": "[concat(parameters('databaseServer'), '/AllowAllWindowsAzureIps')]",
50+
"dependsOn": [
51+
"[resourceId('Microsoft.Sql/servers', parameters('databaseServer'))]"
52+
],
53+
"properties": {
54+
"startIpAddress": "0.0.0.0",
55+
"endIpAddress": "0.0.0.0"
56+
}
57+
}
58+
],
59+
"outputs": {
60+
"databaseServer": {
61+
"type": "string",
62+
"value": "[parameters('databaseServer')]"
63+
}
64+
}
65+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /