-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modules] Configure privateDnsZoneGroups on sqlServer (#1900)
* publicNetworkAccess * privateDNSResourceIds * readme * vnet rules * readme * version * pe login * readme * newVnetRule1 * virtualNetworkSubnetId
- Loading branch information
Showing
8 changed files
with
284 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"name": { | ||
"value": "<<namePrefix>>-az-sqlsrv-pe-001" | ||
}, | ||
"administratorLogin": { | ||
"value": "adminUserName" | ||
}, | ||
"administratorLoginPassword": { | ||
"reference": { | ||
"keyVault": { | ||
"id": "/subscriptions/<<subscriptionId>>/resourceGroups/<<resourceGroupName>>/providers/Microsoft.KeyVault/vaults/adp-<<namePrefix>>-az-kv-x-001" | ||
}, | ||
"secretName": "administratorLoginPassword" | ||
} | ||
}, | ||
"privateEndpoints": { | ||
"value": [ | ||
{ | ||
"subnetResourceId": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-001/subnets/<<namePrefix>>-az-subnet-x-005-privateEndpoints", | ||
"service": "sqlServer", | ||
"privateDnsZoneGroup": { | ||
"privateDNSResourceIds": [ | ||
"/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.database.windows.net" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
"version": "0.4" | ||
"version": "0.5" | ||
} |
48 changes: 48 additions & 0 deletions
48
modules/Microsoft.Sql/servers/virtualNetworkRules/deploy.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@description('Required. The name of the Server Virtual Network Rule.') | ||
param name string | ||
|
||
@description('Optional. Allow creating a firewall rule before the virtual network has vnet service endpoint enabled.') | ||
param ignoreMissingVnetServiceEndpoint bool = false | ||
|
||
@description('Required. The resource ID of the virtual network subnet.') | ||
param virtualNetworkSubnetId string | ||
|
||
@description('Conditional. The name of the parent SQL Server. Required if the template is used in a standalone deployment.') | ||
param serverName string | ||
|
||
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') | ||
param enableDefaultTelemetry bool = true | ||
|
||
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { | ||
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' | ||
properties: { | ||
mode: 'Incremental' | ||
template: { | ||
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' | ||
contentVersion: '1.0.0.0' | ||
resources: [] | ||
} | ||
} | ||
} | ||
|
||
resource server 'Microsoft.Sql/servers@2022-02-01-preview' existing = { | ||
name: serverName | ||
} | ||
|
||
resource virtualNetworkRule 'Microsoft.Sql/servers/virtualNetworkRules@2022-02-01-preview' = { | ||
name: name | ||
parent: server | ||
properties: { | ||
ignoreMissingVnetServiceEndpoint: ignoreMissingVnetServiceEndpoint | ||
virtualNetworkSubnetId: virtualNetworkSubnetId | ||
} | ||
} | ||
|
||
@description('The name of the deployed virtual network rule.') | ||
output name string = virtualNetworkRule.name | ||
|
||
@description('The resource ID of the deployed virtual network rule.') | ||
output resourceId string = virtualNetworkRule.id | ||
|
||
@description('The resource group of the deployed virtual network rule.') | ||
output resourceGroupName string = resourceGroup().name |
48 changes: 48 additions & 0 deletions
48
modules/Microsoft.Sql/servers/virtualNetworkRules/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Sql Servers VirtualNetworkRules `[Microsoft.Sql/servers/virtualNetworkRules]` | ||
|
||
This module deploys a Sql Server Virtual Network Rule. | ||
|
||
## Navigation | ||
|
||
- [Resource Types](#Resource-Types) | ||
- [Parameters](#Parameters) | ||
- [Outputs](#Outputs) | ||
- [Cross-referenced modules](#Cross-referenced-modules) | ||
|
||
## Resource Types | ||
|
||
| Resource Type | API Version | | ||
| :-- | :-- | | ||
| `Microsoft.Sql/servers/virtualNetworkRules` | [2022-02-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Sql/2022-02-01-preview/servers/virtualNetworkRules) | | ||
|
||
## Parameters | ||
|
||
**Required parameters** | ||
| Parameter Name | Type | Description | | ||
| :-- | :-- | :-- | | ||
| `name` | string | The name of the Server Virtual Network Rule. | | ||
| `virtualNetworkSubnetId` | string | The resource ID of the virtual network subnet. | | ||
|
||
**Conditional parameters** | ||
| Parameter Name | Type | Description | | ||
| :-- | :-- | :-- | | ||
| `serverName` | string | The name of the parent SQL Server. Required if the template is used in a standalone deployment. | | ||
|
||
**Optional parameters** | ||
| Parameter Name | Type | Default Value | Description | | ||
| :-- | :-- | :-- | :-- | | ||
| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via the Customer Usage Attribution ID (GUID). | | ||
| `ignoreMissingVnetServiceEndpoint` | bool | `False` | Allow creating a firewall rule before the virtual network has vnet service endpoint enabled. | | ||
|
||
|
||
## Outputs | ||
|
||
| Output Name | Type | Description | | ||
| :-- | :-- | :-- | | ||
| `name` | string | The name of the deployed virtual network rule. | | ||
| `resourceGroupName` | string | The resource group of the deployed virtual network rule. | | ||
| `resourceId` | string | The resource ID of the deployed virtual network rule. | | ||
|
||
## Cross-referenced modules | ||
|
||
_None_ |
4 changes: 4 additions & 0 deletions
4
modules/Microsoft.Sql/servers/virtualNetworkRules/version.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
"version": "0.1" | ||
} |