Skip to content

Commit e81e859

Browse files
authored
Merge pull request #3 from North-Seattle-College/development
Update fork
2 parents ce596d9 + 59a0451 commit e81e859

34 files changed

+2212
-16882
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/AzureDeploy.yml

-27
This file was deleted.

.github/workflows/deployAzureFunctions.yaml renamed to .github/workflows/deploy-apis.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ jobs:
3434
with:
3535
app-name: ${{ secrets.AZURE_FUNCTIONAPP_NAME }} # this is the name of the function established in the env portion
3636
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} # this is the path established in the env portion
37-
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} # this is the secret we've created on GitHub that contains the details necessary to push to Azure
37+
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} # this is the secret we've created on GitHub that contains the details necessary to push to Azure
38+
39+
# This file was used as reference for deployment of the function app
40+
# (getting values for app-name and publish-profile for the function app)
41+
# Feb-10-2021

.github/workflows/deploy-ui.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# deploy to blob storage =>
2+
name: Build and deploy the app to the Azure Blob Storage
3+
4+
on:
5+
push:
6+
branches:
7+
- development
8+
env:
9+
AZURE_WEBAPP_PACKAGE_PATH: ui/react-ui
10+
NODE_VERSION: '10.x'
11+
12+
jobs:
13+
build-and-deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@main
17+
- name: Set up Node.js version
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{env.NODE_VERSION}}
21+
- name: npm install and build
22+
run: |
23+
cd ${{env.AZURE_WEBAPP_PACKAGE_PATH}}
24+
npm install
25+
npm run build
26+
- name: Upload To Azure Blob Storage
27+
uses: bacongobbler/[email protected]
28+
with:
29+
source_dir: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}/build
30+
container_name: $web
31+
connection_string: ${{secrets.BLOB_STORAGE_CONNECTION_STRING}}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@ DS_Store
117117

118118
# ignore .vscode
119119
.vscode/
120+
121+
package-lock.json
122+

Automation/SQL/azureDeploy.json

+119-73
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,136 @@
11
{
2-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3-
"contentVersion": "1.0.0.0",
4-
"parameters": {
5-
"serverName": {
6-
"type": "string",
7-
"defaultValue": "[concat('nsc-sqlsrv-', resourceGroup().location, '-acbc')]",
8-
"metadata": {
9-
"description": "The name of the SQL logical server."
10-
}
11-
},
12-
"location": {
13-
"type": "string",
14-
"defaultValue": "westus2",
15-
"metadata": {
16-
"description": "Location for all resources."
17-
}
18-
},
19-
"administratorLogin": {
20-
"type": "string",
21-
"metadata": {
22-
"description": "The administrator username of the SQL logical server."
23-
}
24-
},
25-
"administratorLoginPassword": {
26-
"type": "securestring",
27-
"metadata": {
28-
"description": "The administrator password of the SQL logical server."
29-
}
30-
},
31-
"allowAzureIPs": {
32-
"defaultValue": true,
33-
"type": "bool",
34-
"metadata": {
35-
"description": "Allow Azure services to access server."
36-
}
37-
}
38-
},
39-
"variables": {},
40-
"resources": [
41-
{
42-
"type": "Microsoft.Sql/servers",
43-
"apiVersion": "2020-02-02-preview",
44-
"name": "[parameters('serverName')]",
45-
"location": "[parameters('location')]",
46-
"properties": {
47-
"administratorLogin": "[parameters('administratorLogin')]",
48-
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
49-
"version": "12.0",
50-
"publicNetworkAccess": "Enabled"
51-
}
52-
},
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"serverName": {
6+
"type": "string",
7+
"defaultValue": "[concat('nsc-sqlsrv-dev-', resourceGroup().location, '-thursday')]",
8+
"metadata": {
9+
"description": "The name of the SQL logical server."
10+
}
11+
},
12+
"location": {
13+
"type": "string",
14+
"defaultValue": "westus2",
15+
"metadata": {
16+
"description": "Location for all resources."
17+
}
18+
},
19+
"administratorLogin": {
20+
"type": "string",
21+
"metadata": {
22+
"description": "The administrator username of the SQL logical server."
23+
}
24+
},
25+
"administratorLoginPassword": {
26+
"type": "securestring",
27+
"metadata": {
28+
"description": "The administrator password of the SQL logical server."
29+
}
30+
},
31+
"allowAzureIPs": {
32+
"defaultValue": true,
33+
"type": "bool",
34+
"metadata": {
35+
"description": "Allow Azure services to access server."
36+
}
37+
},
38+
"sqlDBName": {
39+
"type": "string",
40+
"defaultValue": "[concat('nsc-sqldb-dev-', resourceGroup().location, '-thursday')]",
41+
"metadata": {
42+
"description": "The name of the SQL Database."
43+
}
44+
},
45+
"createdBy": {
46+
"type": "string",
47+
"metadata": {
48+
"description": "Indicate who is creating the resource."
49+
}
50+
},
51+
"creatorsEmail": {
52+
"type": "string",
53+
"metadata": {
54+
"description": "Indicate creator's email address."
55+
}
56+
},
57+
"resourceTags": {
58+
"type": "object",
59+
"defaultValue": {
60+
"NCSYear": 2021,
61+
"NSCCohort": "Thursday",
62+
"Owner": "[parameters('createdBy')]",
63+
"OwnerEmail": "[parameters('creatorsEmail')]"
64+
}
65+
}
66+
},
67+
"variables": {},
68+
"resources": [
5369
{
54-
"type": "Microsoft.Sql/servers/auditingPolicies",
55-
"apiVersion": "2014-04-01",
56-
"name": "[concat(parameters('serverName'), '/Default')]",
70+
"type": "Microsoft.Sql/servers",
71+
"apiVersion": "2020-02-02-preview",
72+
"name": "[parameters('serverName')]",
5773
"location": "[parameters('location')]",
58-
"dependsOn": [
59-
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
60-
],
74+
"tags": "[parameters('resourceTags')]",
6175
"properties": {
62-
"auditingState": "Disabled"
76+
"administratorLogin": "[parameters('administratorLogin')]",
77+
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
78+
"version": "12.0",
79+
"publicNetworkAccess": "Enabled"
6380
}
6481
},
6582
{
66-
"type": "Microsoft.Sql/servers/firewallRules",
67-
"condition": "[parameters('allowAzureIPs')]",
68-
"apiVersion": "2015-05-01-preview",
69-
"name": "[concat(parameters('serverName'), '/AllowAllWindowsAzureIps')]",
83+
"type": "Microsoft.Sql/servers/databases",
84+
"apiVersion": "2020-08-01-preview",
85+
"name": "[concat(parameters('serverName'), '/', parameters('sqlDBName'))]",
86+
"location": "[parameters('location')]",
87+
"sku": {
88+
"name": "Standard",
89+
"tier": "Standard"
90+
},
91+
"tags": "[parameters('resourceTags')]",
7092
"dependsOn": [
7193
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
72-
],
73-
"properties": {
74-
"startIpAddress": "0.0.0.0",
75-
"endIpAddress": "0.0.0.0"
76-
}
94+
]
7795
},
7896
{
79-
"type": "Microsoft.Sql/servers/securityAlertPolicies",
80-
"apiVersion": "2020-02-02-preview",
97+
"type": "Microsoft.Sql/servers/auditingPolicies",
98+
"apiVersion": "2014-04-01",
8199
"name": "[concat(parameters('serverName'), '/Default')]",
100+
"location": "[parameters('location')]",
82101
"dependsOn": [
83102
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
84103
],
104+
"tags": "[parameters('resourceTags')]",
85105
"properties": {
86-
"state": "Enabled"
106+
"auditingState": "Disabled"
87107
}
88-
}
89-
]
90-
}
108+
},
109+
{
110+
"type": "Microsoft.Sql/servers/firewallRules",
111+
"condition": "[parameters('allowAzureIPs')]",
112+
"apiVersion": "2015-05-01-preview",
113+
"name": "[concat(parameters('serverName'), '/AllowAllWindowsAzureIps')]",
114+
"dependsOn": [
115+
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
116+
],
117+
"tags": "[parameters('resourceTags')]",
118+
"properties": {
119+
"startIpAddress": "0.0.0.0",
120+
"endIpAddress": "0.0.0.0"
121+
}
122+
},
123+
{
124+
"type": "Microsoft.Sql/servers/securityAlertPolicies",
125+
"apiVersion": "2020-02-02-preview",
126+
"name": "[concat(parameters('serverName'), '/Default')]",
127+
"dependsOn": [
128+
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
129+
],
130+
"tags": "[parameters('resourceTags')]",
131+
"properties": {
132+
"state": "Enabled"
133+
}
134+
}
135+
]
136+
}

Automation/SQL/azureDeploy.ps1

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# Creates resource group and Azure SQL logical server
22

33
param(
4-
# Login parameters
5-
[string] [Parameter(Mandatory=$true)] $tenantId,
6-
[string] [Parameter(Mandatory=$true)] $applicationId,
7-
[string] [Parameter(Mandatory=$true)] $secret,
8-
[string] [Parameter(Mandatory=$true)] $subscriptionId,
9-
# Azure SQL server parameters
10-
[string] [Parameter(Mandatory=$true)] $location,
11-
[string] [Parameter(Mandatory=$true)] $resourceGroupName,
12-
[string] [Parameter(Mandatory=$true)] $serverName,
13-
[string] [Parameter(Mandatory=$true)] $administratorLogin,
14-
[string] [Parameter(Mandatory=$true)] $administratorLoginPassword
4+
# Login parameters
5+
[string] [Parameter(Mandatory=$true)] $tenantId,
6+
[string] [Parameter(Mandatory=$true)] $applicationId,
7+
[string] [Parameter(Mandatory=$true)] $secret,
8+
[string] [Parameter(Mandatory=$true)] $subscriptionId,
9+
# Azure SQL server parameters
10+
[string] [Parameter(Mandatory=$true)] $location,
11+
[string] [Parameter(Mandatory=$true)] $resourceGroupName,
12+
[string] [Parameter(Mandatory=$true)] $serverName,
13+
[string] [Parameter(Mandatory=$true)] $administratorLogin,
14+
[string] [Parameter(Mandatory=$true)] $administratorLoginPassword,
15+
# Azure SQL db parameters
16+
[string] [Parameter(Mandatory=$false)] $sqlDBName,
17+
# Tag parameters
18+
[string] [Parameter(Mandatory=$true)] $createdBy,
19+
[string] [Parameter(Mandatory=$true)] $creatorsEmail
1520
)
16-
1721
[securestring] $administratorLoginPassword = ConvertTo-SecureString $administratorLoginPassword -AsPlainText -Force
1822

1923
# Log in and set the SubscriptionId in which to create these objects
@@ -31,14 +35,15 @@ if (!$resourceGroupExists) {
3135
New-AzResourceGroup -Name $resourceGroupName -Location "$location" -Force
3236
Write-Host "Created resource group $resourceGroupName"
3337
} else {
34-
Write-Host "Resource group already exists."
38+
Write-Host "Resource group $resourceGroupName already exists."
3539
}
3640

3741
# Deploy template
38-
Write-host "Creating primary server..."
42+
Write-host "Creating primary server and db..."
3943
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName `
4044
-TemplateFile $pathToAzSqlTemplate -administratorLogin $administratorLogin `
41-
-administratorLoginPassword $administratorLoginPassword
45+
-administratorLoginPassword $administratorLoginPassword -serverName $serverName `
46+
-sqlDBName $sqlDBName -location $location -createdBy $createdBy -creatorsEmail $creatorsEmail
4247

4348

4449
# Clear deployment

0 commit comments

Comments
 (0)