-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlServer.bicep
More file actions
73 lines (63 loc) · 1.76 KB
/
sqlServer.bicep
File metadata and controls
73 lines (63 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@description('Name of the Azure SQL logical server')
param sqlServerName string
@description('Azure region for all resources')
param location string
@description('SQL administrator login name')
param sqlAdminLogin string
@description('SQL administrator password')
@secure()
param sqlAdminPassword string
@description('Name of the API database')
param apiDbName string
@description('Name of the IdentityServer database')
param identityDbName string
resource sqlServer 'Microsoft.Sql/servers@2023-05-01-preview' = {
name: sqlServerName
location: location
properties: {
administratorLogin: sqlAdminLogin
administratorLoginPassword: sqlAdminPassword
minimalTlsVersion: '1.2'
publicNetworkAccess: 'Enabled'
}
}
// Allow Azure services to connect (required for App Service)
resource allowAzureServices 'Microsoft.Sql/servers/firewallRules@2023-05-01-preview' = {
parent: sqlServer
name: 'AllowAllWindowsAzureIps'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '0.0.0.0'
}
}
resource apiDatabase 'Microsoft.Sql/servers/databases@2023-05-01-preview' = {
parent: sqlServer
name: apiDbName
location: location
sku: {
name: 'Basic'
tier: 'Basic'
capacity: 5
}
properties: {
collation: 'SQL_Latin1_General_CP1_CI_AS'
maxSizeBytes: 2147483648 // 2 GB
}
}
resource identityDatabase 'Microsoft.Sql/servers/databases@2023-05-01-preview' = {
parent: sqlServer
name: identityDbName
location: location
sku: {
name: 'Basic'
tier: 'Basic'
capacity: 5
}
properties: {
collation: 'SQL_Latin1_General_CP1_CI_AS'
maxSizeBytes: 2147483648 // 2 GB
}
}
output sqlServerFqdn string = sqlServer.properties.fullyQualifiedDomainName
output apiDbName string = apiDbName
output identityDbName string = identityDbName