-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsql-server.bicep
40 lines (36 loc) · 1.33 KB
/
sql-server.bicep
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
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@description('Admin username for the SQL Server resource.')
param adminUsername string
@description('Admin password for the SQL Server resource.')
@secure()
param adminPassword string
@description('Whether to allow Azure IPs to access the SQL server resource. Defaults to true.')
param allowAzureIps bool = true
resource sqlServer 'Microsoft.Sql/servers@2023-08-01-preview' = {
name: name
location: location
tags: tags
properties: {
administratorLogin: adminUsername
administratorLoginPassword: adminPassword
}
}
resource sqlServerAzureFirewallRules 'Microsoft.Sql/servers/firewallRules@2023-08-01-preview' = if (allowAzureIps) {
parent: sqlServer
name: 'AllowAllWindowsAzureIps'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '0.0.0.0'
}
}
@description('The deployed SQL Server resource.')
output resource resource = sqlServer
@description('ID for the deployed SQL Server resource.')
output id string = sqlServer.id
@description('Name for the deployed SQL Server resource.')
output name string = sqlServer.name