次の方法で共有


Microsoft。SqlServers/virtualNetworkRules 2023-08-01

Bicepリソースの定義

servers/virtualNetworkRules リソースの種類は、次を対象とする操作と共にデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの 参照してください。

リソースの形式

Microsoftを作るために。Sql/servers/virtualNetworkRulesリソースで、テンプレートに以下のBicepを追加してください。

resource symbolicname 'Microsoft.Sql/servers/virtualNetworkRules@2023-08-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    ignoreMissingVnetServiceEndpoint: bool
    virtualNetworkSubnetId: 'string'
  }
}

プロパティ値

Microsoft。Sql/servers/virtualNetworkRules

Name Description Value
name リソース名 string (必須)
Bicepでは、子リソースの親リソースを指定することができます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。

詳細については、「親リソースの外部 子リソース」を参照してください。
種類のリソースのシンボリック名: サーバー
properties リソースのプロパティ。 VirtualNetworkRuleProperties

VirtualNetworkRuleProperties

Name Description Value
ignoreMissingVnetServiceEndpoint 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 bool
virtualNetworkSubnetId 仮想ネットワーク サブネットの ARM リソース ID。 string (必須)

使用例

Bicep サンプル

ルールを展開する基本的な例Azure SQL Virtual Network。

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator password for the SQL server')
param sqlAdministratorPassword string

resource server 'Microsoft.Sql/servers@2021-02-01-preview' = {
  name: resourceName
  location: location
  properties: {
    administratorLogin: 'missadmin'
    administratorLoginPassword: null
    minimalTlsVersion: '1.2'
    publicNetworkAccess: 'Enabled'
    restrictOutboundNetworkAccess: 'Disabled'
    version: '12.0'
  }
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.7.28.0/23'
      ]
    }
    dhcpOptions: {
      dnsServers: []
    }
    subnets: []
  }
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2022-07-01' = {
  parent: virtualNetwork
  name: resourceName
  properties: {
    addressPrefix: '10.7.28.0/25'
    delegations: []
    privateEndpointNetworkPolicies: 'Enabled'
    privateLinkServiceNetworkPolicies: 'Enabled'
    serviceEndpointPolicies: []
    serviceEndpoints: [
      {
        service: 'Microsoft.Sql'
      }
    ]
  }
}

resource virtualNetworkRule 'Microsoft.Sql/servers/virtualNetworkRules@2020-11-01-preview' = {
  parent: server
  name: resourceName
  properties: {
    ignoreMissingVnetServiceEndpoint: false
    virtualNetworkSubnetId: subnet.id
  }
}

ARM テンプレート リソース定義

servers/virtualNetworkRules リソースの種類は、次を対象とする操作と共にデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの 参照してください。

リソースの形式

Microsoftを作るために。Sql/servers/virtualNetworkRulesリソースで、テンプレートに以下のJSONを追加してください。

{
  "type": "Microsoft.Sql/servers/virtualNetworkRules",
  "apiVersion": "2023-08-01",
  "name": "string",
  "properties": {
    "ignoreMissingVnetServiceEndpoint": "bool",
    "virtualNetworkSubnetId": "string"
  }
}

プロパティ値

Microsoft。Sql/servers/virtualNetworkRules

Name Description Value
apiVersion API のバージョン '2023-08-01'
name リソース名 string (必須)
properties リソースのプロパティ。 VirtualNetworkRuleProperties
リソースの種類 「Microsoft。Sql/servers/virtualNetworkRules'

VirtualNetworkRuleProperties

Name Description Value
ignoreMissingVnetServiceEndpoint 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 bool
virtualNetworkSubnetId 仮想ネットワーク サブネットの ARM リソース ID。 string (必須)

使用例

Terraform (AzAPI プロバイダー) リソース定義

servers/virtualNetworkRules リソースの種類は、次を対象とする操作と共にデプロイできます。

  • リソース グループ

各 API バージョンで変更されたプロパティの一覧については、変更ログの 参照してください。

リソースの形式

Microsoftを作るために。Sql/servers/virtualNetworkRulesリソースで、テンプレートに以下のTerraformを追加してください。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/servers/virtualNetworkRules@2023-08-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      ignoreMissingVnetServiceEndpoint = bool
      virtualNetworkSubnetId = "string"
    }
  }
}

プロパティ値

Microsoft。Sql/servers/virtualNetworkRules

Name Description Value
name リソース名 string (必須)
parent_id このリソースの親であるリソースの ID。 種類のリソースの ID: サーバー
properties リソースのプロパティ。 VirtualNetworkRuleProperties
リソースの種類 「Microsoft。Sql/servers/virtualNetworkRules@2023-08-01"

VirtualNetworkRuleProperties

Name Description Value
ignoreMissingVnetServiceEndpoint 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 bool
virtualNetworkSubnetId 仮想ネットワーク サブネットの ARM リソース ID。 string (必須)

使用例

Terraformサンプル

ルールを展開する基本的な例Azure SQL Virtual Network。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "sql_administrator_password" {
  type        = string
  description = "The administrator password for the SQL server"
  sensitive   = true
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "server" {
  type      = "Microsoft.Sql/servers@2021-02-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLogin            = "missadmin"
      administratorLoginPassword    = var.sql_administrator_password
      minimalTlsVersion             = "1.2"
      publicNetworkAccess           = "Enabled"
      restrictOutboundNetworkAccess = "Disabled"
      version                       = "12.0"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "virtualNetwork" {
  type      = "Microsoft.Network/virtualNetworks@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      addressSpace = {
        addressPrefixes = [
          "10.7.28.0/23",
        ]
      }
      dhcpOptions = {
        dnsServers = [
        ]
      }
      subnets = [
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
  lifecycle {
    ignore_changes = [body.properties.subnets]
  }
}

resource "azapi_resource" "subnet" {
  type      = "Microsoft.Network/virtualNetworks/subnets@2022-07-01"
  parent_id = azapi_resource.virtualNetwork.id
  name      = var.resource_name
  body = {
    properties = {
      addressPrefix = "10.7.28.0/25"
      delegations = [
      ]
      privateEndpointNetworkPolicies    = "Enabled"
      privateLinkServiceNetworkPolicies = "Enabled"
      serviceEndpointPolicies = [
      ]
      serviceEndpoints = [
        {
          service = "Microsoft.Sql"
        },
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "virtualNetworkRule" {
  type      = "Microsoft.Sql/servers/virtualNetworkRules@2020-11-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  body = {
    properties = {
      ignoreMissingVnetServiceEndpoint = false
      virtualNetworkSubnetId           = azapi_resource.subnet.id
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}