Microsoft。SqlVirtualMachine sqlVirtualMachines 2023-10-01

Bicep リソース定義

sqlVirtualMachines リソースの種類は、次をターゲットとする操作と共にデプロイできます。

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

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

使用例

Bicep サンプル

Microsoft SQL 仮想マシンのデプロイの基本的な例。

param location string = 'westeurope'
@secure()
@description('The administrator password for the SQL virtual machine')
param vmAdminPassword string
param resourceName string = 'acctest0001'

resource publicIPAddress 'Microsoft.Network/publicIPAddresses@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  sku: {
    name: 'Basic'
    tier: 'Regional'
  }
  properties: {
    ddosSettings: {
      protectionMode: 'VirtualNetworkInherited'
    }
    idleTimeoutInMinutes: 4
    ipTags: []
    publicIPAddressVersion: 'IPv4'
    publicIPAllocationMethod: 'Dynamic'
  }
}

resource sqlvirtualMachine 'Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01' = {
  name: 'azapi_resource.virtualMachine.name'
  location: 'azapi_resource.virtualMachine.location'
  properties: {
    sqlServerLicenseType: 'PAYG'
    virtualMachineResourceId: virtualMachine.id
    enableAutomaticUpgrade: true
    leastPrivilegeMode: 'Enabled'
    sqlImageOffer: 'SQL2017-WS2016'
    sqlImageSku: 'Developer'
    sqlManagement: 'Full'
  }
}

resource virtualMachine 'Microsoft.Compute/virtualMachines@2024-07-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    osProfile: {
      adminUsername: 'testadmin'
      adminPassword: vmAdminPassword
      allowExtensionOperations: true
      computerName: 'winhost01'
      secrets: []
      windowsConfiguration: {
        timeZone: 'Pacific Standard Time'
        enableAutomaticUpdates: true
        patchSettings: {
          patchMode: 'AutomaticByOS'
          assessmentMode: 'ImageDefault'
        }
        provisionVMAgent: true
      }
    }
    storageProfile: {
      dataDisks: []
      imageReference: {
        offer: 'SQL2017-WS2016'
        publisher: 'MicrosoftSQLServer'
        sku: 'SQLDEV'
        version: 'latest'
      }
      osDisk: {
        diskSizeGB: 127
        managedDisk: {
          storageAccountType: 'Premium_LRS'
        }
        name: 'acctvm-250116171212663925OSDisk'
        osType: 'Windows'
        writeAcceleratorEnabled: false
        caching: 'ReadOnly'
        createOption: 'FromImage'
        deleteOption: 'Detach'
      }
    }
    hardwareProfile: {
      vmSize: 'Standard_F2s'
    }
    networkProfile: {
      networkInterfaces: [
        {
          properties: {
            primary: false
          }
          id: networkInterface.id
        }
      ]
    }
  }
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.0.0.0/16'
      ]
    }
  }
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2022-07-01' = {
  name: resourceName
  parent: virtualNetwork
  properties: {
    addressPrefix: '10.0.0.0/24'
    networkSecurityGroup: {
      id: networkSecurityGroup.id
    }
  }
}

resource networkInterface 'Microsoft.Network/networkInterfaces@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    disableTcpStateTracking: false
    dnsSettings: {
      dnsServers: []
    }
    enableAcceleratedNetworking: false
    enableIPForwarding: false
    ipConfigurations: [
      {
        type: 'Microsoft.Network/networkInterfaces/ipConfigurations'
        name: 'testconfiguration1'
        properties: {
          privateIPAddressVersion: 'IPv4'
          privateIPAllocationMethod: 'Dynamic'
          publicIPAddress: {
            id: publicIPAddress.id
          }
          subnet: {
            id: subnet.id
          }
          primary: true
          privateIPAddress: '10.0.0.4'
        }
      }
    ]
    nicType: 'Standard'
    auxiliaryMode: 'None'
    auxiliarySku: 'None'
  }
}

resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    securityRules: [
      {
        name: 'MSSQLRule'
        properties: {
          access: 'Allow'
          destinationAddressPrefix: '*'
          destinationAddressPrefixes: []
          destinationPortRange: '1433'
          destinationPortRanges: []
          direction: 'Inbound'
          priority: 1001
          protocol: 'Tcp'
          sourceAddressPrefix: '167.220.255.0/25'
          sourceAddressPrefixes: []
          sourcePortRange: '*'
          sourcePortRanges: []
        }
      }
    ]
  }
}

Microsoft SQL 仮想マシンのデプロイの sqlbestpracticesassessment の例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator password for the virtual machine')
param adminPassword string

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.0.0.0/16'
      ]
    }
  }
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2022-07-01' = {
  name: resourceName
  parent: virtualNetwork
  properties: {
    addressPrefix: '10.0.0.0/24'
    networkSecurityGroup: {
      id: networkSecurityGroup.id
    }
  }
}

resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    securityRules: [
      {
        name: 'MSSQLRule'
        properties: {
          access: 'Allow'
          destinationAddressPrefix: '*'
          destinationAddressPrefixes: []
          destinationPortRange: '1433'
          destinationPortRanges: []
          direction: 'Inbound'
          priority: 1001
          protocol: 'Tcp'
          sourceAddressPrefix: '167.220.255.0/25'
          sourceAddressPrefixes: []
          sourcePortRange: '*'
          sourcePortRanges: []
        }
      }
    ]
  }
}

resource publicIPAddress 'Microsoft.Network/publicIPAddresses@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  sku: {
    name: 'Basic'
    tier: 'Regional'
  }
  properties: {
    ddosSettings: {
      protectionMode: 'VirtualNetworkInherited'
    }
    idleTimeoutInMinutes: 4
    ipTags: []
    publicIPAddressVersion: 'IPv4'
    publicIPAllocationMethod: 'Dynamic'
  }
}

resource virtualMachine 'Microsoft.Compute/virtualMachines@2024-07-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    osProfile: {
      adminUsername: 'testadmin'
      adminPassword: adminPassword
      allowExtensionOperations: true
      computerName: 'winhost01'
      secrets: []
      windowsConfiguration: {
        timeZone: 'Pacific Standard Time'
        enableAutomaticUpdates: true
        patchSettings: {
          patchMode: 'AutomaticByOS'
          assessmentMode: 'ImageDefault'
        }
        provisionVMAgent: true
      }
    }
    storageProfile: {
      dataDisks: []
      imageReference: {
        offer: 'SQL2017-WS2016'
        publisher: 'MicrosoftSQLServer'
        sku: 'SQLDEV'
        version: 'latest'
      }
      osDisk: {
        diskSizeGB: 127
        managedDisk: {
          storageAccountType: 'Premium_LRS'
        }
        name: 'acctvm-250116171212663925OSDisk'
        osType: 'Windows'
        writeAcceleratorEnabled: false
        caching: 'ReadOnly'
        createOption: 'FromImage'
        deleteOption: 'Detach'
      }
    }
    hardwareProfile: {
      vmSize: 'Standard_F2s'
    }
    networkProfile: {
      networkInterfaces: [
        {
          properties: {
            primary: false
          }
          id: networkInterface.id
        }
      ]
    }
  }
}

resource extension 'Microsoft.Compute/virtualMachines/extensions@2024-07-01' = {
  name: 'AzureMonitorWindowsAgent'
  location: 'westeurope'
  parent: virtualMachine
  properties: {
    autoUpgradeMinorVersion: true
    enableAutomaticUpgrade: true
    publisher: 'Microsoft.Azure.Monitor'
    suppressFailures: false
    type: 'AzureMonitorWindowsAgent'
    typeHandlerVersion: '1.0'
  }
}

resource workspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    features: {
      disableLocalAuth: false
      enableLogAccessUsingOnlyResourcePermissions: true
      legacy: 0
      searchVersion: 1
    }
    publicNetworkAccessForIngestion: 'Enabled'
    publicNetworkAccessForQuery: 'Enabled'
    retentionInDays: 30
    sku: {
      name: 'PerGB2018'
    }
    workspaceCapping: {
      dailyQuotaGb: -1
    }
  }
}

resource table 'Microsoft.OperationalInsights/workspaces/tables@2023-09-01' = {
  name: 'SqlAssessment_CL'
  parent: workspace
  properties: {
    schema: {
      columns: [
        {
          name: 'TimeGenerated'
          type: 'datetime'
        }
        {
          name: 'RawData'
          type: 'string'
        }
      ]
      name: 'SqlAssessment_CL'
    }
  }
}

resource dataCollectionEndpoint 'Microsoft.Insights/dataCollectionEndpoints@2022-06-01' = {
  name: '${location}-DCE-1'
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    networkAcls: {
      publicNetworkAccess: 'Enabled'
    }
  }
}

resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2022-06-01' = {
  name: 'azapi_resource.workspace.output.properties.customerId_azapi_resource.resourceGroup.location_DCR_1'
  location: 'azapi_resource.resourceGroup.location'
  dependsOn: [
    table
  ]
  properties: {
    streamDeclarations: {
      'Custom-SqlAssessment_CL': {
        columns: [
          {
            name: 'TimeGenerated'
            type: 'datetime'
          }
          {
            type: 'string'
            name: 'RawData'
          }
        ]
      }
    }
    dataCollectionEndpointId: dataCollectionEndpoint.id
    dataFlows: [
      {
        outputStream: 'Custom-SqlAssessment_CL'
        streams: [
          'Custom-SqlAssessment_CL'
        ]
        transformKql: 'source'
        destinations: [
          workspace.name
        ]
      }
    ]
    dataSources: {
      logFiles: [
        {
          filePatterns: [
            'C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Microsoft SQL Server IaaS Agent\\Assessment\\*.csv'
          ]
          format: 'text'
          name: 'Custom-SqlAssessment_CL'
          settings: {
            text: {
              recordStartTimestampFormat: 'ISO 8601'
            }
          }
          streams: [
            'Custom-SqlAssessment_CL'
          ]
        }
      ]
    }
    description: ''
    destinations: {
      logAnalytics: [
        {
          name: workspace.name
          workspaceResourceId: workspace.id
        }
      ]
    }
  }
}

resource dataCollectionRuleAssociation 'Microsoft.Insights/dataCollectionRuleAssociations@2022-06-01' = {
  name: 'azapi_resource.workspace.output.properties.customerId_azapi_resource.resourceGroup.location_DCRA_1'
  scope: virtualMachine
  properties: {
    dataCollectionRuleId: dataCollectionRule.id
  }
}

resource networkInterface 'Microsoft.Network/networkInterfaces@2024-05-01' = {
  name: resourceName
  location: 'azapi_resource.resourceGroup.location'
  properties: {
    disableTcpStateTracking: false
    dnsSettings: {
      dnsServers: []
    }
    enableAcceleratedNetworking: false
    enableIPForwarding: false
    ipConfigurations: [
      {
        type: 'Microsoft.Network/networkInterfaces/ipConfigurations'
        name: 'testconfiguration1'
        properties: {
          privateIPAddressVersion: 'IPv4'
          privateIPAllocationMethod: 'Dynamic'
          publicIPAddress: {
            id: publicIPAddress.id
          }
          subnet: {
            id: subnet.id
          }
          primary: true
          privateIPAddress: '10.0.0.4'
        }
      }
    ]
    nicType: 'Standard'
    auxiliaryMode: 'None'
    auxiliarySku: 'None'
  }
}

resource sqlvirtualMachine 'Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01' = {
  name: 'azapi_resource.virtualMachine.name'
  location: 'azapi_resource.virtualMachine.location'
  dependsOn: [
    dataCollectionRuleAssociation
    extension
  ]
  properties: {
    sqlServerLicenseType: 'PAYG'
    virtualMachineResourceId: virtualMachine.id
    enableAutomaticUpgrade: true
    leastPrivilegeMode: 'Enabled'
    sqlImageOffer: 'SQL2017-WS2016'
    sqlImageSku: 'Developer'
    sqlManagement: 'Full'
    assessmentSettings: {
      enable: true
      runImmediately: false
      schedule: {
        dayOfWeek: 'Monday'
        enable: true
        startTime: '00:00'
        weeklyInterval: 1
      }
    }
  }
}

Azure クイック スタートのサンプル

次 Azure クイック スタート テンプレート、このリソースの種類をデプロイするための Bicep サンプルが含まれています。

Bicep ファイル Description
パフォーマンスが最適化されたストレージ設定を使用して SQL Server VM を PremiumSSD でパフォーマンスが最適化されたストレージ設定を使用して SQL Server 仮想マシンを作成する

リソースの形式

Microsoft.SqlVirtualMachine/sqlVirtualMachines リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01' = {
  identity: {
    type: 'string'
  }
  location: 'string'
  name: 'string'
  properties: {
    assessmentSettings: {
      enable: bool
      runImmediately: bool
      schedule: {
        dayOfWeek: 'string'
        enable: bool
        monthlyOccurrence: int
        startTime: 'string'
        weeklyInterval: int
      }
    }
    autoBackupSettings: {
      backupScheduleType: 'string'
      backupSystemDbs: bool
      daysOfWeek: [
        'string'
      ]
      enable: bool
      enableEncryption: bool
      fullBackupFrequency: 'string'
      fullBackupStartTime: int
      fullBackupWindowHours: int
      logBackupFrequency: int
      password: 'string'
      retentionPeriod: int
      storageAccessKey: 'string'
      storageAccountUrl: 'string'
      storageContainerName: 'string'
    }
    autoPatchingSettings: {
      additionalVmPatch: 'string'
      dayOfWeek: 'string'
      enable: bool
      maintenanceWindowDuration: int
      maintenanceWindowStartingHour: int
    }
    enableAutomaticUpgrade: bool
    keyVaultCredentialSettings: {
      azureKeyVaultUrl: 'string'
      credentialName: 'string'
      enable: bool
      servicePrincipalName: 'string'
      servicePrincipalSecret: 'string'
    }
    leastPrivilegeMode: 'string'
    serverConfigurationsManagementSettings: {
      additionalFeaturesServerConfigurations: {
        isRServicesEnabled: bool
      }
      azureAdAuthenticationSettings: {
        clientId: 'string'
      }
      sqlConnectivityUpdateSettings: {
        connectivityType: 'string'
        port: int
        sqlAuthUpdatePassword: 'string'
        sqlAuthUpdateUserName: 'string'
      }
      sqlInstanceSettings: {
        collation: 'string'
        isIfiEnabled: bool
        isLpimEnabled: bool
        isOptimizeForAdHocWorkloadsEnabled: bool
        maxDop: int
        maxServerMemoryMB: int
        minServerMemoryMB: int
      }
      sqlStorageUpdateSettings: {
        diskConfigurationType: 'string'
        diskCount: int
        startingDeviceId: int
      }
      sqlWorkloadTypeUpdateSettings: {
        sqlWorkloadType: 'string'
      }
    }
    sqlImageOffer: 'string'
    sqlImageSku: 'string'
    sqlManagement: 'string'
    sqlServerLicenseType: 'string'
    sqlVirtualMachineGroupResourceId: 'string'
    storageConfigurationSettings: {
      diskConfigurationType: 'string'
      enableStorageConfigBlade: bool
      sqlDataSettings: {
        defaultFilePath: 'string'
        luns: [
          int
        ]
        useStoragePool: bool
      }
      sqlLogSettings: {
        defaultFilePath: 'string'
        luns: [
          int
        ]
        useStoragePool: bool
      }
      sqlSystemDbOnDataDisk: bool
      sqlTempDbSettings: {
        dataFileCount: int
        dataFileSize: int
        dataGrowth: int
        defaultFilePath: 'string'
        logFileSize: int
        logGrowth: int
        luns: [
          int
        ]
        persistFolder: bool
        persistFolderPath: 'string'
        useStoragePool: bool
      }
      storageWorkloadType: 'string'
    }
    virtualMachineIdentitySettings: {
      resourceId: 'string'
      type: 'string'
    }
    virtualMachineResourceId: 'string'
    wsfcDomainCredentials: {
      clusterBootstrapAccountPassword: 'string'
      clusterOperatorAccountPassword: 'string'
      sqlServiceAccountPassword: 'string'
    }
    wsfcStaticIp: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

プロパティ値

Microsoft.SqlVirtualMachine/sqlVirtualMachines

Name Description Value
ID 使用しないでください。 この値は非推奨になります。 サーバーの Azure Active Directory ID。 ResourceIdentity
位置 リソースが存在する地理的な場所 string (必須)
name リソース名 string

Constraints:
最小長 = 1
最大長 = 64
パターン = ^((?!_)[^\\/"'\[\]:|<>+=;,?*@&]{1,64}(?<![.-]))$ (必須)
properties リソースのプロパティ。 SqlVirtualMachineProperties
tags リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください

AADAuthenticationSettings

Name Description Value
clientId Microsoft Graph API にクエリを実行するマネージド ID のクライアント ID。 空の文字列は、システム割り当てマネージド ID に使用する必要があります 文字列

AdditionalFeaturesServerConfigurations

Name Description Value
isRServicesEnabled R サービス (SQL 2016 以降) を有効または無効にします。 bool

AssessmentSettings

Name Description Value
有効にする SQL 仮想マシンで SQL ベスト プラクティス評価機能を有効または無効にします。 bool
runImmediately SQL 仮想マシンで SQL ベスト プラクティス評価を直ちに実行します。 bool
schedule SQL ベスト プラクティス評価のスケジュール。 Schedule

AutoBackupSettings

Name Description Value
backupScheduleType バックアップ スケジュールの種類。 'Automated'
'Manual'
backupSystemDbs システム データベースを自動バックアップに含めるか、自動バックアップから除外します。 bool
daysOfWeek FullBackupFrequency が [週単位] に設定されている場合のバックアップの曜日。 次のいずれかを含む文字列配列:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンでの自動バックを有効または無効にします。 bool
enableEncryption SQL 仮想マシンでのバックアップの暗号化を有効または無効にします。 bool
fullBackupFrequency 完全バックアップの頻度。 どちらの場合も、完全バックアップは次のスケジュールされた時間枠の間に開始されます。 'Daily'
'Weekly'
fullBackupStartTime 完全バックアップを実行できる特定の日の開始時刻。 0 ~ 23 時間。 int
fullBackupWindowHours 完全バックアップを実行できる特定の日の時間枠の期間。 1 ~ 23 時間。 int
logBackupFrequency ログ バックアップの頻度。 5 ~ 60 分。 int
パスワード バックアップ時の暗号化のパスワード。 文字列
retentionPeriod バックアップの保持期間: 1 ~ 90 日。 int
storageAccessKey バックアップの保存先となるストレージ アカウント キー。 文字列
storageAccountUrl バックアップの保存先となるストレージ アカウントの URL。 文字列
storageContainerName バックアップの保存先となるストレージ コンテナー名。 文字列

AutoPatchingSettings

Name Description Value
additionalVmPatch SQL 仮想マシンで有効または有効にする追加の修正プログラム。 'MicrosoftUpdate'
'NotSet'
dayOfWeek パッチを適用する曜日。 'Everyday'
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンで自動パッチを有効または無効にします。 bool
maintenanceWindowDuration 修正プログラムの適用期間。 int
maintenanceWindowStartingHour 修正プログラムの適用が開始される 1 日の時間。 ローカル VM 時刻。 int

KeyVaultCredentialSettings

Name Description Value
azureKeyVaultUrl Azure Key Vault の URL。 文字列
credentialName 資格情報の名前。 文字列
有効にする キー コンテナーの資格情報設定を有効または無効にします。 bool
servicePrincipalName キー コンテナーにアクセスするためのサービス プリンシパル名。 文字列
servicePrincipalSecret キー コンテナーにアクセスするためのサービス プリンシパル名シークレット。 文字列

ResourceIdentity

Name Description Value
型 ID の種類。 リソースの Azure Active Directory プリンシパルを自動的に作成して割り当てるには、これを "SystemAssigned" に設定します。 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned'

Schedule

Name Description Value
dayOfWeek 評価を実行する曜日。 'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンの評価スケジュールを有効または無効にします。 bool
monthlyOccurrence 評価をスケジュールする 1 か月以内の DayOfWeek 日の発生。 1、2、3、4、-1 の値を受け取ります。 月の最後の DayOfWeek 日に -1 を使用する int
startTime HH:mm 形式の時刻。例えば。17:30 文字列
weeklyInterval 2 つの評価実行の間にスケジュールする週数。 1 から 6 の値を受け取ります int

ServerConfigurationsManagementSettings

Name Description Value
additionalFeaturesServerConfigurations その他の SQL 機能の設定。 AdditionalFeaturesServerConfigurations
azureAdAuthenticationSettings Azure AD 認証の設定。 AADAuthenticationSettings
sqlConnectivityUpdateSettings SQL 接続の種類の設定。 SqlConnectivityUpdateSettings
sqlInstanceSettings SQL インスタンスの設定。 SQLInstanceSettings
sqlStorageUpdateSettings SQL ストレージの更新設定。 SqlStorageUpdateSettings
sqlWorkloadTypeUpdateSettings SQL ワークロードの種類の設定。 SqlWorkloadTypeUpdateSettings

SqlConnectivityUpdateSettings

Name Description Value
connectivityType SQL Server 接続オプション。 'LOCAL'
'PRIVATE'
'PUBLIC'
ポート SQL Server ポート。 int
sqlAuthUpdatePassword SQL Server sysadmin ログイン パスワード。 文字列
sqlAuthUpdateUserName 作成する SQL Server sysadmin ログイン。 文字列

SQLInstanceSettings

Name Description Value
照合順序 SQL Server 照合順序。 文字列
isIfiEnabled SQL Server IFI。 bool
isLpimEnabled SQL Server LPIM。 bool
isOptimizeForAdHocWorkloadsEnabled アドホック ワークロード用の SQL Server Optimize。 bool
maxDop SQL Server MAXDOP。 int
maxServerMemoryMB SQL Server の最大メモリ。 int
minServerMemoryMB SQL Server の最小メモリ。 int

SQLStorageSettings

Name Description Value
defaultFilePath SQL Server の既定のファイル パス 文字列
luns ディスクの論理ユニット番号。 int[]
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlStorageUpdateSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
diskCount 仮想マシンのディスク数。 int
startingDeviceId 更新する最初のディスクのデバイス ID。 int

SQLTempDbSettings

Name Description Value
dataFileCount SQL Server tempdb データ ファイルの数 int
dataFileSize SQL Server tempdb データ ファイルのサイズ int
dataGrowth SQL Server tempdb データ ファイルの自動拡張サイズ int
defaultFilePath SQL Server の既定のファイル パス 文字列
logFileSize SQL Server tempdb ログ ファイルのサイズ int
logGrowth SQL Server tempdb ログ ファイルの自動拡張サイズ int
luns ディスクの論理ユニット番号。 int[]
persistFolder SQL Server tempdb の保存フォルダーの選択 bool
persistFolderPath SQL Server tempdb の保存フォルダーの場所 文字列
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlVirtualMachineProperties

Name Description Value
assessmentSettings SQL のベスト プラクティスの評価の設定。 AssessmentSettings
autoBackupSettings SQL Server の自動バックアップ設定。 AutoBackupSettings
autoPatchingSettings SQL 仮想マシンに重要なセキュリティ更新プログラムを適用するための自動修正プログラムの設定。 AutoPatchingSettings
enableAutomaticUpgrade Sql IaaS 拡張機能エージェントの自動アップグレードを有効にします。 bool
keyVaultCredentialSettings キー コンテナーの資格情報の設定。 KeyVaultCredentialSettings
leastPrivilegeMode SQL IaaS Agent の最小特権モード。 'Enabled'
'NotSet'
serverConfigurationsManagementSettings SQL Server の構成管理設定。 ServerConfigurationsManagementSettings
sqlImageOffer SQL イメージ オファー。 例としては、SQL2016-WS2016、SQL2017-WS2016 などがあります。 文字列
sqlImageSku SQL Server エディションの種類。 'Developer'
'Enterprise'
'Express'
'Standard'
'Web'
sqlManagement SQL Server 管理の種類。 注: このパラメーターは使用されなくなりました。 API は Sql Management を自動的に検出し、使用しないようにします。 'Full'
'LightWeight'
'NoAgent'
sqlServerLicenseType SQL Server ライセンスの種類。 'AHUB'
'DR'
'PAYG'
sqlVirtualMachineGroupResourceId この SQL 仮想マシンが属しているか、その一部となる SQL 仮想マシン グループの ARM リソース ID。 文字列
storageConfigurationSettings ストレージ構成設定。 StorageConfigurationSettings
virtualMachineIdentitySettings Sql IaaS 拡張機能の構成に使用される仮想マシン ID の詳細。 VirtualMachineIdentity
virtualMachineResourceId SQL Marketplace イメージから作成された基になる仮想マシンの ARM リソース ID。 文字列
wsfcDomainCredentials SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 WsfcDomainCredentials
wsfcStaticIp SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 文字列

SqlWorkloadTypeUpdateSettings

Name Description Value
sqlWorkloadType SQL Server ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

StorageConfigurationSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
enableStorageConfigBlade Azure portal で SQL IaaS Agent ストレージ構成ブレードを有効にします。 bool
sqlDataSettings SQL Server データ ストレージの設定。 SQLStorageSettings
sqlLogSettings SQL Server ログ ストレージの設定。 SQLStorageSettings
sqlSystemDbOnDataDisk True の場合、DataPool 上の SQL Server SystemDb ストレージ。 bool
sqlTempDbSettings SQL Server TempDb ストレージの設定。 SQLTempDbSettings
storageWorkloadType ストレージ ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

TrackedResourceTags

Name Description Value

VirtualMachineIdentity

Name Description Value
resourceId ID の ARM リソース ID。 UserAssigned ID が選択されている場合にのみ必要です。 文字列
型 仮想マシンの ID の種類。 マネージド ID をオプトアウトするには、[なし] を指定します。 'None'
'SystemAssigned'
'UserAssigned'

WsfcDomainCredentials

Name Description Value
clusterBootstrapAccountPassword クラスター ブートストラップ アカウントのパスワード。 文字列
clusterOperatorAccountPassword クラスター オペレーター アカウントのパスワード。 文字列
sqlServiceAccountPassword SQL サービス アカウントのパスワード。 文字列

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

sqlVirtualMachines リソースの種類は、次をターゲットとする操作と共にデプロイできます。

使用例

Azure のクイック スタート テンプレート

このリソースの種類 デプロイする Azure クイック スタート テンプレート 次に示します。

Template Description
既存の SQL Virtual Machines を使用して SQL Always ON セットアップをデプロイする

Azure にデプロイする
既存の SQL 仮想マシンを使用して SQL Always ON セットアップをデプロイします。 仮想マシンは既に既存のドメインに参加している必要があり、SQL Server のエンタープライズ バージョンを実行している必要があります。
パフォーマンスが最適化されたストレージ設定を使用して SQL Server VM を

Azure にデプロイする
PremiumSSD でパフォーマンスが最適化されたストレージ設定を使用して SQL Server 仮想マシンを作成する
UltraSSD での SQL VM パフォーマンス最適化ストレージ設定の

Azure
にデプロイする
SQL ログ ファイルに UltraSSD を使用して、パフォーマンスが最適化されたストレージ設定で SQL Server 仮想マシンを作成する

リソースの形式

Microsoft.SqlVirtualMachine/sqlVirtualMachines リソースを作成するには、次の JSON をテンプレートに追加します。

{
  "type": "Microsoft.SqlVirtualMachine/sqlVirtualMachines",
  "apiVersion": "2023-10-01",
  "name": "string",
  "identity": {
    "type": "string"
  },
  "location": "string",
  "properties": {
    "assessmentSettings": {
      "enable": "bool",
      "runImmediately": "bool",
      "schedule": {
        "dayOfWeek": "string",
        "enable": "bool",
        "monthlyOccurrence": "int",
        "startTime": "string",
        "weeklyInterval": "int"
      }
    },
    "autoBackupSettings": {
      "backupScheduleType": "string",
      "backupSystemDbs": "bool",
      "daysOfWeek": [ "string" ],
      "enable": "bool",
      "enableEncryption": "bool",
      "fullBackupFrequency": "string",
      "fullBackupStartTime": "int",
      "fullBackupWindowHours": "int",
      "logBackupFrequency": "int",
      "password": "string",
      "retentionPeriod": "int",
      "storageAccessKey": "string",
      "storageAccountUrl": "string",
      "storageContainerName": "string"
    },
    "autoPatchingSettings": {
      "additionalVmPatch": "string",
      "dayOfWeek": "string",
      "enable": "bool",
      "maintenanceWindowDuration": "int",
      "maintenanceWindowStartingHour": "int"
    },
    "enableAutomaticUpgrade": "bool",
    "keyVaultCredentialSettings": {
      "azureKeyVaultUrl": "string",
      "credentialName": "string",
      "enable": "bool",
      "servicePrincipalName": "string",
      "servicePrincipalSecret": "string"
    },
    "leastPrivilegeMode": "string",
    "serverConfigurationsManagementSettings": {
      "additionalFeaturesServerConfigurations": {
        "isRServicesEnabled": "bool"
      },
      "azureAdAuthenticationSettings": {
        "clientId": "string"
      },
      "sqlConnectivityUpdateSettings": {
        "connectivityType": "string",
        "port": "int",
        "sqlAuthUpdatePassword": "string",
        "sqlAuthUpdateUserName": "string"
      },
      "sqlInstanceSettings": {
        "collation": "string",
        "isIfiEnabled": "bool",
        "isLpimEnabled": "bool",
        "isOptimizeForAdHocWorkloadsEnabled": "bool",
        "maxDop": "int",
        "maxServerMemoryMB": "int",
        "minServerMemoryMB": "int"
      },
      "sqlStorageUpdateSettings": {
        "diskConfigurationType": "string",
        "diskCount": "int",
        "startingDeviceId": "int"
      },
      "sqlWorkloadTypeUpdateSettings": {
        "sqlWorkloadType": "string"
      }
    },
    "sqlImageOffer": "string",
    "sqlImageSku": "string",
    "sqlManagement": "string",
    "sqlServerLicenseType": "string",
    "sqlVirtualMachineGroupResourceId": "string",
    "storageConfigurationSettings": {
      "diskConfigurationType": "string",
      "enableStorageConfigBlade": "bool",
      "sqlDataSettings": {
        "defaultFilePath": "string",
        "luns": [ "int" ],
        "useStoragePool": "bool"
      },
      "sqlLogSettings": {
        "defaultFilePath": "string",
        "luns": [ "int" ],
        "useStoragePool": "bool"
      },
      "sqlSystemDbOnDataDisk": "bool",
      "sqlTempDbSettings": {
        "dataFileCount": "int",
        "dataFileSize": "int",
        "dataGrowth": "int",
        "defaultFilePath": "string",
        "logFileSize": "int",
        "logGrowth": "int",
        "luns": [ "int" ],
        "persistFolder": "bool",
        "persistFolderPath": "string",
        "useStoragePool": "bool"
      },
      "storageWorkloadType": "string"
    },
    "virtualMachineIdentitySettings": {
      "resourceId": "string",
      "type": "string"
    },
    "virtualMachineResourceId": "string",
    "wsfcDomainCredentials": {
      "clusterBootstrapAccountPassword": "string",
      "clusterOperatorAccountPassword": "string",
      "sqlServiceAccountPassword": "string"
    },
    "wsfcStaticIp": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

プロパティ値

Microsoft.SqlVirtualMachine/sqlVirtualMachines

Name Description Value
apiVersion API のバージョン '2023-10-01'
ID 使用しないでください。 この値は非推奨になります。 サーバーの Azure Active Directory ID。 ResourceIdentity
位置 リソースが存在する地理的な場所 string (必須)
name リソース名 string

Constraints:
最小長 = 1
最大長 = 64
パターン = ^((?!_)[^\\/"'\[\]:|<>+=;,?*@&]{1,64}(?<![.-]))$ (必須)
properties リソースのプロパティ。 SqlVirtualMachineProperties
tags リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください
型 リソースの種類 'Microsoft.SqlVirtualMachine/sqlVirtualMachines'

AADAuthenticationSettings

Name Description Value
clientId Microsoft Graph API にクエリを実行するマネージド ID のクライアント ID。 空の文字列は、システム割り当てマネージド ID に使用する必要があります 文字列

AdditionalFeaturesServerConfigurations

Name Description Value
isRServicesEnabled R サービス (SQL 2016 以降) を有効または無効にします。 bool

AssessmentSettings

Name Description Value
有効にする SQL 仮想マシンで SQL ベスト プラクティス評価機能を有効または無効にします。 bool
runImmediately SQL 仮想マシンで SQL ベスト プラクティス評価を直ちに実行します。 bool
schedule SQL ベスト プラクティス評価のスケジュール。 Schedule

AutoBackupSettings

Name Description Value
backupScheduleType バックアップ スケジュールの種類。 'Automated'
'Manual'
backupSystemDbs システム データベースを自動バックアップに含めるか、自動バックアップから除外します。 bool
daysOfWeek FullBackupFrequency が [週単位] に設定されている場合のバックアップの曜日。 次のいずれかを含む文字列配列:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンでの自動バックを有効または無効にします。 bool
enableEncryption SQL 仮想マシンでのバックアップの暗号化を有効または無効にします。 bool
fullBackupFrequency 完全バックアップの頻度。 どちらの場合も、完全バックアップは次のスケジュールされた時間枠の間に開始されます。 'Daily'
'Weekly'
fullBackupStartTime 完全バックアップを実行できる特定の日の開始時刻。 0 ~ 23 時間。 int
fullBackupWindowHours 完全バックアップを実行できる特定の日の時間枠の期間。 1 ~ 23 時間。 int
logBackupFrequency ログ バックアップの頻度。 5 ~ 60 分。 int
パスワード バックアップ時の暗号化のパスワード。 文字列
retentionPeriod バックアップの保持期間: 1 ~ 90 日。 int
storageAccessKey バックアップの保存先となるストレージ アカウント キー。 文字列
storageAccountUrl バックアップの保存先となるストレージ アカウントの URL。 文字列
storageContainerName バックアップの保存先となるストレージ コンテナー名。 文字列

AutoPatchingSettings

Name Description Value
additionalVmPatch SQL 仮想マシンで有効または有効にする追加の修正プログラム。 'MicrosoftUpdate'
'NotSet'
dayOfWeek パッチを適用する曜日。 'Everyday'
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンで自動パッチを有効または無効にします。 bool
maintenanceWindowDuration 修正プログラムの適用期間。 int
maintenanceWindowStartingHour 修正プログラムの適用が開始される 1 日の時間。 ローカル VM 時刻。 int

KeyVaultCredentialSettings

Name Description Value
azureKeyVaultUrl Azure Key Vault の URL。 文字列
credentialName 資格情報の名前。 文字列
有効にする キー コンテナーの資格情報設定を有効または無効にします。 bool
servicePrincipalName キー コンテナーにアクセスするためのサービス プリンシパル名。 文字列
servicePrincipalSecret キー コンテナーにアクセスするためのサービス プリンシパル名シークレット。 文字列

ResourceIdentity

Name Description Value
型 ID の種類。 リソースの Azure Active Directory プリンシパルを自動的に作成して割り当てるには、これを "SystemAssigned" に設定します。 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned'

Schedule

Name Description Value
dayOfWeek 評価を実行する曜日。 'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンの評価スケジュールを有効または無効にします。 bool
monthlyOccurrence 評価をスケジュールする 1 か月以内の DayOfWeek 日の発生。 1、2、3、4、-1 の値を受け取ります。 月の最後の DayOfWeek 日に -1 を使用する int
startTime HH:mm 形式の時刻。例えば。17:30 文字列
weeklyInterval 2 つの評価実行の間にスケジュールする週数。 1 から 6 の値を受け取ります int

ServerConfigurationsManagementSettings

Name Description Value
additionalFeaturesServerConfigurations その他の SQL 機能の設定。 AdditionalFeaturesServerConfigurations
azureAdAuthenticationSettings Azure AD 認証の設定。 AADAuthenticationSettings
sqlConnectivityUpdateSettings SQL 接続の種類の設定。 SqlConnectivityUpdateSettings
sqlInstanceSettings SQL インスタンスの設定。 SQLInstanceSettings
sqlStorageUpdateSettings SQL ストレージの更新設定。 SqlStorageUpdateSettings
sqlWorkloadTypeUpdateSettings SQL ワークロードの種類の設定。 SqlWorkloadTypeUpdateSettings

SqlConnectivityUpdateSettings

Name Description Value
connectivityType SQL Server 接続オプション。 'LOCAL'
'PRIVATE'
'PUBLIC'
ポート SQL Server ポート。 int
sqlAuthUpdatePassword SQL Server sysadmin ログイン パスワード。 文字列
sqlAuthUpdateUserName 作成する SQL Server sysadmin ログイン。 文字列

SQLInstanceSettings

Name Description Value
照合順序 SQL Server 照合順序。 文字列
isIfiEnabled SQL Server IFI。 bool
isLpimEnabled SQL Server LPIM。 bool
isOptimizeForAdHocWorkloadsEnabled アドホック ワークロード用の SQL Server Optimize。 bool
maxDop SQL Server MAXDOP。 int
maxServerMemoryMB SQL Server の最大メモリ。 int
minServerMemoryMB SQL Server の最小メモリ。 int

SQLStorageSettings

Name Description Value
defaultFilePath SQL Server の既定のファイル パス 文字列
luns ディスクの論理ユニット番号。 int[]
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlStorageUpdateSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
diskCount 仮想マシンのディスク数。 int
startingDeviceId 更新する最初のディスクのデバイス ID。 int

SQLTempDbSettings

Name Description Value
dataFileCount SQL Server tempdb データ ファイルの数 int
dataFileSize SQL Server tempdb データ ファイルのサイズ int
dataGrowth SQL Server tempdb データ ファイルの自動拡張サイズ int
defaultFilePath SQL Server の既定のファイル パス 文字列
logFileSize SQL Server tempdb ログ ファイルのサイズ int
logGrowth SQL Server tempdb ログ ファイルの自動拡張サイズ int
luns ディスクの論理ユニット番号。 int[]
persistFolder SQL Server tempdb の保存フォルダーの選択 bool
persistFolderPath SQL Server tempdb の保存フォルダーの場所 文字列
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlVirtualMachineProperties

Name Description Value
assessmentSettings SQL のベスト プラクティスの評価の設定。 AssessmentSettings
autoBackupSettings SQL Server の自動バックアップ設定。 AutoBackupSettings
autoPatchingSettings SQL 仮想マシンに重要なセキュリティ更新プログラムを適用するための自動修正プログラムの設定。 AutoPatchingSettings
enableAutomaticUpgrade Sql IaaS 拡張機能エージェントの自動アップグレードを有効にします。 bool
keyVaultCredentialSettings キー コンテナーの資格情報の設定。 KeyVaultCredentialSettings
leastPrivilegeMode SQL IaaS Agent の最小特権モード。 'Enabled'
'NotSet'
serverConfigurationsManagementSettings SQL Server の構成管理設定。 ServerConfigurationsManagementSettings
sqlImageOffer SQL イメージ オファー。 例としては、SQL2016-WS2016、SQL2017-WS2016 などがあります。 文字列
sqlImageSku SQL Server エディションの種類。 'Developer'
'Enterprise'
'Express'
'Standard'
'Web'
sqlManagement SQL Server 管理の種類。 注: このパラメーターは使用されなくなりました。 API は Sql Management を自動的に検出し、使用しないようにします。 'Full'
'LightWeight'
'NoAgent'
sqlServerLicenseType SQL Server ライセンスの種類。 'AHUB'
'DR'
'PAYG'
sqlVirtualMachineGroupResourceId この SQL 仮想マシンが属しているか、その一部となる SQL 仮想マシン グループの ARM リソース ID。 文字列
storageConfigurationSettings ストレージ構成設定。 StorageConfigurationSettings
virtualMachineIdentitySettings Sql IaaS 拡張機能の構成に使用される仮想マシン ID の詳細。 VirtualMachineIdentity
virtualMachineResourceId SQL Marketplace イメージから作成された基になる仮想マシンの ARM リソース ID。 文字列
wsfcDomainCredentials SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 WsfcDomainCredentials
wsfcStaticIp SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 文字列

SqlWorkloadTypeUpdateSettings

Name Description Value
sqlWorkloadType SQL Server ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

StorageConfigurationSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
enableStorageConfigBlade Azure portal で SQL IaaS Agent ストレージ構成ブレードを有効にします。 bool
sqlDataSettings SQL Server データ ストレージの設定。 SQLStorageSettings
sqlLogSettings SQL Server ログ ストレージの設定。 SQLStorageSettings
sqlSystemDbOnDataDisk True の場合、DataPool 上の SQL Server SystemDb ストレージ。 bool
sqlTempDbSettings SQL Server TempDb ストレージの設定。 SQLTempDbSettings
storageWorkloadType ストレージ ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

TrackedResourceTags

Name Description Value

VirtualMachineIdentity

Name Description Value
resourceId ID の ARM リソース ID。 UserAssigned ID が選択されている場合にのみ必要です。 文字列
型 仮想マシンの ID の種類。 マネージド ID をオプトアウトするには、[なし] を指定します。 'None'
'SystemAssigned'
'UserAssigned'

WsfcDomainCredentials

Name Description Value
clusterBootstrapAccountPassword クラスター ブートストラップ アカウントのパスワード。 文字列
clusterOperatorAccountPassword クラスター オペレーター アカウントのパスワード。 文字列
sqlServiceAccountPassword SQL サービス アカウントのパスワード。 文字列

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

sqlVirtualMachines リソースの種類は、次をターゲットとする操作と共にデプロイできます。

  • リソースグループ 各APIバージョンの変更プロパティ一覧については、 変更ログをご覧ください。

使用例

Terraformサンプル

Microsoft SQL 仮想マシンのデプロイの基本的な例。

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 "vm_admin_password" {
  type        = string
  description = "The administrator password for the SQL virtual machine"
  sensitive   = true
}

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

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.0.0.0/16",
        ]
      }
    }
  }
  schema_validation_enabled = false
  lifecycle {
    ignore_changes = [body.properties.subnets]
  }
}

resource "azapi_resource" "networkSecurityGroup" {
  type      = "Microsoft.Network/networkSecurityGroups@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      securityRules = [{
        name = "MSSQLRule"
        properties = {
          access                     = "Allow"
          destinationAddressPrefix   = "*"
          destinationAddressPrefixes = []
          destinationPortRange       = "1433"
          destinationPortRanges      = []
          direction                  = "Inbound"
          priority                   = 1001
          protocol                   = "Tcp"
          sourceAddressPrefix        = "167.220.255.0/25"
          sourceAddressPrefixes      = []
          sourcePortRange            = "*"
          sourcePortRanges           = []
        }
      }]
    }
  }
}

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.0.0.0/24"
      networkSecurityGroup = {
        id = azapi_resource.networkSecurityGroup.id
      }
    }
  }
}

resource "azapi_resource" "publicIPAddress" {
  type      = "Microsoft.Network/publicIPAddresses@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      ddosSettings = {
        protectionMode = "VirtualNetworkInherited"
      }
      idleTimeoutInMinutes     = 4
      ipTags                   = []
      publicIPAddressVersion   = "IPv4"
      publicIPAllocationMethod = "Dynamic"
    }
    sku = {
      name = "Basic"
      tier = "Regional"
    }
  }
}

resource "azapi_resource" "networkInterface" {
  type      = "Microsoft.Network/networkInterfaces@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      disableTcpStateTracking = false
      dnsSettings = {
        dnsServers = []
      }
      enableAcceleratedNetworking = false
      enableIPForwarding          = false
      ipConfigurations = [
        {
          type = "Microsoft.Network/networkInterfaces/ipConfigurations"
          name = "testconfiguration1"
          properties = {
            privateIPAddressVersion   = "IPv4"
            privateIPAllocationMethod = "Dynamic"
            publicIPAddress = {
              id = azapi_resource.publicIPAddress.id
            }
            subnet = {
              id = azapi_resource.subnet.id
            }
            primary          = true
            privateIPAddress = "10.0.0.4"
          }
        }
      ]
      nicType       = "Standard"
      auxiliaryMode = "None"
      auxiliarySku  = "None"
    }
  }
}

resource "azapi_resource" "virtualMachine" {
  type      = "Microsoft.Compute/virtualMachines@2024-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      osProfile = {
        adminUsername            = "testadmin"
        adminPassword            = var.vm_admin_password
        allowExtensionOperations = true
        computerName             = "winhost01"
        secrets                  = []
        windowsConfiguration = {
          timeZone               = "Pacific Standard Time"
          enableAutomaticUpdates = true
          patchSettings = {
            patchMode      = "AutomaticByOS"
            assessmentMode = "ImageDefault"
          }
          provisionVMAgent = true
        }
      }
      storageProfile = {
        dataDisks = []
        imageReference = {
          offer     = "SQL2017-WS2016"
          publisher = "MicrosoftSQLServer"
          sku       = "SQLDEV"
          version   = "latest"
        }
        osDisk = {
          diskSizeGB = 127
          managedDisk = {
            storageAccountType = "Premium_LRS"
          }
          name                    = "acctvm-250116171212663925OSDisk"
          osType                  = "Windows"
          writeAcceleratorEnabled = false
          caching                 = "ReadOnly"
          createOption            = "FromImage"
          deleteOption            = "Detach"
        }
      }
      hardwareProfile = {
        vmSize = "Standard_F2s"
      }
      networkProfile = {
        networkInterfaces = [
          {
            properties = {
              primary = false
            }
            id = azapi_resource.networkInterface.id
          }
        ]
      }
    }
  }
}


resource "azapi_resource" "sqlvirtualMachine" {
  type      = "Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = azapi_resource.virtualMachine.name
  location  = azapi_resource.virtualMachine.location
  body = {
    properties = {
      sqlServerLicenseType     = "PAYG"
      virtualMachineResourceId = azapi_resource.virtualMachine.id
      enableAutomaticUpgrade   = true
      leastPrivilegeMode       = "Enabled"
      sqlImageOffer            = "SQL2017-WS2016"
      sqlImageSku              = "Developer"
      sqlManagement            = "Full"
    }
  }
}

Microsoft SQL 仮想マシンのデプロイの sqlbestpracticesassessment の例。

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 "admin_password" {
  type        = string
  description = "The administrator password for the virtual machine"
  sensitive   = true
}

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

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.0.0.0/16",
        ]
      }
    }
  }
  schema_validation_enabled = false
  lifecycle {
    ignore_changes = [body.properties.subnets]
  }
}

resource "azapi_resource" "networkSecurityGroup" {
  type      = "Microsoft.Network/networkSecurityGroups@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      securityRules = [{
        name = "MSSQLRule"
        properties = {
          access                     = "Allow"
          destinationAddressPrefix   = "*"
          destinationAddressPrefixes = []
          destinationPortRange       = "1433"
          destinationPortRanges      = []
          direction                  = "Inbound"
          priority                   = 1001
          protocol                   = "Tcp"
          sourceAddressPrefix        = "167.220.255.0/25"
          sourceAddressPrefixes      = []
          sourcePortRange            = "*"
          sourcePortRanges           = []
        }
      }]
    }
  }
}

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.0.0.0/24"
      networkSecurityGroup = {
        id = azapi_resource.networkSecurityGroup.id
      }
    }
  }
}

resource "azapi_resource" "publicIPAddress" {
  type      = "Microsoft.Network/publicIPAddresses@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      ddosSettings = {
        protectionMode = "VirtualNetworkInherited"
      }
      idleTimeoutInMinutes     = 4
      ipTags                   = []
      publicIPAddressVersion   = "IPv4"
      publicIPAllocationMethod = "Dynamic"
    }
    sku = {
      name = "Basic"
      tier = "Regional"
    }
  }
}

resource "azapi_resource" "networkInterface" {
  type      = "Microsoft.Network/networkInterfaces@2024-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      disableTcpStateTracking = false
      dnsSettings = {
        dnsServers = []
      }
      enableAcceleratedNetworking = false
      enableIPForwarding          = false
      ipConfigurations = [
        {
          type = "Microsoft.Network/networkInterfaces/ipConfigurations"
          name = "testconfiguration1"
          properties = {
            privateIPAddressVersion   = "IPv4"
            privateIPAllocationMethod = "Dynamic"
            publicIPAddress = {
              id = azapi_resource.publicIPAddress.id
            }
            subnet = {
              id = azapi_resource.subnet.id
            }
            primary          = true
            privateIPAddress = "10.0.0.4"
          }
        }
      ]
      nicType       = "Standard"
      auxiliaryMode = "None"
      auxiliarySku  = "None"
    }
  }
}

resource "azapi_resource" "virtualMachine" {
  type      = "Microsoft.Compute/virtualMachines@2024-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      osProfile = {
        adminUsername            = "testadmin"
        adminPassword            = var.admin_password
        allowExtensionOperations = true
        computerName             = "winhost01"
        secrets                  = []
        windowsConfiguration = {
          timeZone               = "Pacific Standard Time"
          enableAutomaticUpdates = true
          patchSettings = {
            patchMode      = "AutomaticByOS"
            assessmentMode = "ImageDefault"
          }
          provisionVMAgent = true
        }
      }
      storageProfile = {
        dataDisks = []
        imageReference = {
          offer     = "SQL2017-WS2016"
          publisher = "MicrosoftSQLServer"
          sku       = "SQLDEV"
          version   = "latest"
        }
        osDisk = {
          diskSizeGB = 127
          managedDisk = {
            storageAccountType = "Premium_LRS"
          }
          name                    = "acctvm-250116171212663925OSDisk"
          osType                  = "Windows"
          writeAcceleratorEnabled = false
          caching                 = "ReadOnly"
          createOption            = "FromImage"
          deleteOption            = "Detach"
        }
      }
      hardwareProfile = {
        vmSize = "Standard_F2s"
      }
      networkProfile = {
        networkInterfaces = [
          {
            properties = {
              primary = false
            }
            id = azapi_resource.networkInterface.id
          }
        ]
      }
    }
  }
}


resource "azapi_resource" "extension" {
  type      = "Microsoft.Compute/virtualMachines/extensions@2024-07-01"
  parent_id = azapi_resource.virtualMachine.id
  name      = "AzureMonitorWindowsAgent"
  location  = "westeurope"
  body = {
    properties = {
      autoUpgradeMinorVersion = true
      enableAutomaticUpgrade  = true
      publisher               = "Microsoft.Azure.Monitor"
      suppressFailures        = false
      type                    = "AzureMonitorWindowsAgent"
      typeHandlerVersion      = "1.0"
    }
  }
}

resource "azapi_resource" "workspace" {
  type      = "Microsoft.OperationalInsights/workspaces@2020-08-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      features = {
        disableLocalAuth                            = false
        enableLogAccessUsingOnlyResourcePermissions = true
        legacy                                      = 0
        searchVersion                               = 1
      }
      publicNetworkAccessForIngestion = "Enabled"
      publicNetworkAccessForQuery     = "Enabled"
      retentionInDays                 = 30
      sku = {
        name = "PerGB2018"
      }
      workspaceCapping = {
        dailyQuotaGb = -1
      }
    }
  }
}

resource "azapi_resource" "table" {
  type      = "Microsoft.OperationalInsights/workspaces/tables@2023-09-01"
  parent_id = azapi_resource.workspace.id
  name      = "SqlAssessment_CL"
  body = {
    properties = {
      schema = {
        name = "SqlAssessment_CL"
        columns = [
          {
            name = "TimeGenerated"
            type = "datetime"
          },
          {
            type = "string"
            name = "RawData"
          }
        ]
      }
    }
  }
}

resource "azapi_resource" "dataCollectionEndpoint" {
  type      = "Microsoft.Insights/dataCollectionEndpoints@2022-06-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.location}-DCE-1"
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      networkAcls = {
        publicNetworkAccess = "Enabled"
      }
    }
  }
}

resource "azapi_resource" "dataCollectionRule" {
  type      = "Microsoft.Insights/dataCollectionRules@2022-06-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${azapi_resource.workspace.output.properties.customerId}_${azapi_resource.resourceGroup.location}_DCR_1"
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      streamDeclarations = {
        Custom-SqlAssessment_CL = {
          columns = [
            {
              name = "TimeGenerated"
              type = "datetime"
            },
            {
              type = "string"
              name = "RawData"
            }
          ]
        }
      }
      dataCollectionEndpointId = azapi_resource.dataCollectionEndpoint.id
      dataFlows = [
        {
          outputStream = "Custom-SqlAssessment_CL"
          streams = [
            "Custom-SqlAssessment_CL"
          ]
          transformKql = "source"
          destinations = [
            azapi_resource.workspace.name
          ]
        }
      ]
      dataSources = {
        logFiles = [
          {
            filePatterns = [
              "C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Microsoft SQL Server IaaS Agent\\Assessment\\*.csv"
            ]
            format = "text"
            name   = "Custom-SqlAssessment_CL"
            settings = {
              text = {
                recordStartTimestampFormat = "ISO 8601"
              }
            }
            streams = [
              "Custom-SqlAssessment_CL"
            ]
          }
        ]
      }
      description = ""
      destinations = {
        logAnalytics = [
          {
            name                = azapi_resource.workspace.name
            workspaceResourceId = azapi_resource.workspace.id
          }
        ]
      }
    }
  }
  depends_on = [azapi_resource.table]
}

resource "azapi_resource" "dataCollectionRuleAssociation" {
  type      = "Microsoft.Insights/dataCollectionRuleAssociations@2022-06-01"
  parent_id = azapi_resource.virtualMachine.id
  name      = "${azapi_resource.workspace.output.properties.customerId}_${azapi_resource.resourceGroup.location}_DCRA_1"
  body = {
    properties = {
      dataCollectionRuleId = azapi_resource.dataCollectionRule.id
    }
  }
}

resource "azapi_resource" "sqlvirtualMachine" {
  type      = "Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = azapi_resource.virtualMachine.name
  location  = azapi_resource.virtualMachine.location
  body = {
    properties = {
      sqlServerLicenseType     = "PAYG"
      virtualMachineResourceId = azapi_resource.virtualMachine.id
      enableAutomaticUpgrade   = true
      leastPrivilegeMode       = "Enabled"
      sqlImageOffer            = "SQL2017-WS2016"
      sqlImageSku              = "Developer"
      sqlManagement            = "Full"
      assessmentSettings = {
        enable         = true
        runImmediately = false
        schedule = {
          dayOfWeek      = "Monday"
          enable         = true
          startTime      = "00:00"
          weeklyInterval = 1
        }
      }
    }
  }
  depends_on = [
    azapi_resource.dataCollectionRuleAssociation,
    azapi_resource.extension,
  ]
}

リソースの形式

Microsoft.SqlVirtualMachine/sqlVirtualMachines リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01"
  name = "string"
  parent_id = "string"
  identity {
    type = "string"
    identity_ids = [
      "string"
    ]
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      assessmentSettings = {
        enable = bool
        runImmediately = bool
        schedule = {
          dayOfWeek = "string"
          enable = bool
          monthlyOccurrence = int
          startTime = "string"
          weeklyInterval = int
        }
      }
      autoBackupSettings = {
        backupScheduleType = "string"
        backupSystemDbs = bool
        daysOfWeek = [
          "string"
        ]
        enable = bool
        enableEncryption = bool
        fullBackupFrequency = "string"
        fullBackupStartTime = int
        fullBackupWindowHours = int
        logBackupFrequency = int
        password = "string"
        retentionPeriod = int
        storageAccessKey = "string"
        storageAccountUrl = "string"
        storageContainerName = "string"
      }
      autoPatchingSettings = {
        additionalVmPatch = "string"
        dayOfWeek = "string"
        enable = bool
        maintenanceWindowDuration = int
        maintenanceWindowStartingHour = int
      }
      enableAutomaticUpgrade = bool
      keyVaultCredentialSettings = {
        azureKeyVaultUrl = "string"
        credentialName = "string"
        enable = bool
        servicePrincipalName = "string"
        servicePrincipalSecret = "string"
      }
      leastPrivilegeMode = "string"
      serverConfigurationsManagementSettings = {
        additionalFeaturesServerConfigurations = {
          isRServicesEnabled = bool
        }
        azureAdAuthenticationSettings = {
          clientId = "string"
        }
        sqlConnectivityUpdateSettings = {
          connectivityType = "string"
          port = int
          sqlAuthUpdatePassword = "string"
          sqlAuthUpdateUserName = "string"
        }
        sqlInstanceSettings = {
          collation = "string"
          isIfiEnabled = bool
          isLpimEnabled = bool
          isOptimizeForAdHocWorkloadsEnabled = bool
          maxDop = int
          maxServerMemoryMB = int
          minServerMemoryMB = int
        }
        sqlStorageUpdateSettings = {
          diskConfigurationType = "string"
          diskCount = int
          startingDeviceId = int
        }
        sqlWorkloadTypeUpdateSettings = {
          sqlWorkloadType = "string"
        }
      }
      sqlImageOffer = "string"
      sqlImageSku = "string"
      sqlManagement = "string"
      sqlServerLicenseType = "string"
      sqlVirtualMachineGroupResourceId = "string"
      storageConfigurationSettings = {
        diskConfigurationType = "string"
        enableStorageConfigBlade = bool
        sqlDataSettings = {
          defaultFilePath = "string"
          luns = [
            int
          ]
          useStoragePool = bool
        }
        sqlLogSettings = {
          defaultFilePath = "string"
          luns = [
            int
          ]
          useStoragePool = bool
        }
        sqlSystemDbOnDataDisk = bool
        sqlTempDbSettings = {
          dataFileCount = int
          dataFileSize = int
          dataGrowth = int
          defaultFilePath = "string"
          logFileSize = int
          logGrowth = int
          luns = [
            int
          ]
          persistFolder = bool
          persistFolderPath = "string"
          useStoragePool = bool
        }
        storageWorkloadType = "string"
      }
      virtualMachineIdentitySettings = {
        resourceId = "string"
        type = "string"
      }
      virtualMachineResourceId = "string"
      wsfcDomainCredentials = {
        clusterBootstrapAccountPassword = "string"
        clusterOperatorAccountPassword = "string"
        sqlServiceAccountPassword = "string"
      }
      wsfcStaticIp = "string"
    }
  }
}

プロパティ値

Microsoft.SqlVirtualMachine/sqlVirtualMachines

Name Description Value
ID 使用しないでください。 この値は非推奨になります。 サーバーの Azure Active Directory ID。 ResourceIdentity
位置 リソースが存在する地理的な場所 string (必須)
name リソース名 string

Constraints:
最小長 = 1
最大長 = 64
パターン = ^((?!_)[^\\/"'\[\]:|<>+=;,?*@&]{1,64}(?<![.-]))$ (必須)
properties リソースのプロパティ。 SqlVirtualMachineProperties
tags リソース タグ タグ名と値のディクショナリ。
型 リソースの種類 "Microsoft.SqlVirtualMachine/sqlVirtualMachines@2023-10-01"

AADAuthenticationSettings

Name Description Value
clientId Microsoft Graph API にクエリを実行するマネージド ID のクライアント ID。 空の文字列は、システム割り当てマネージド ID に使用する必要があります 文字列

AdditionalFeaturesServerConfigurations

Name Description Value
isRServicesEnabled R サービス (SQL 2016 以降) を有効または無効にします。 bool

AssessmentSettings

Name Description Value
有効にする SQL 仮想マシンで SQL ベスト プラクティス評価機能を有効または無効にします。 bool
runImmediately SQL 仮想マシンで SQL ベスト プラクティス評価を直ちに実行します。 bool
schedule SQL ベスト プラクティス評価のスケジュール。 Schedule

AutoBackupSettings

Name Description Value
backupScheduleType バックアップ スケジュールの種類。 'Automated'
'Manual'
backupSystemDbs システム データベースを自動バックアップに含めるか、自動バックアップから除外します。 bool
daysOfWeek FullBackupFrequency が [週単位] に設定されている場合のバックアップの曜日。 次のいずれかを含む文字列配列:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンでの自動バックを有効または無効にします。 bool
enableEncryption SQL 仮想マシンでのバックアップの暗号化を有効または無効にします。 bool
fullBackupFrequency 完全バックアップの頻度。 どちらの場合も、完全バックアップは次のスケジュールされた時間枠の間に開始されます。 'Daily'
'Weekly'
fullBackupStartTime 完全バックアップを実行できる特定の日の開始時刻。 0 ~ 23 時間。 int
fullBackupWindowHours 完全バックアップを実行できる特定の日の時間枠の期間。 1 ~ 23 時間。 int
logBackupFrequency ログ バックアップの頻度。 5 ~ 60 分。 int
パスワード バックアップ時の暗号化のパスワード。 文字列
retentionPeriod バックアップの保持期間: 1 ~ 90 日。 int
storageAccessKey バックアップの保存先となるストレージ アカウント キー。 文字列
storageAccountUrl バックアップの保存先となるストレージ アカウントの URL。 文字列
storageContainerName バックアップの保存先となるストレージ コンテナー名。 文字列

AutoPatchingSettings

Name Description Value
additionalVmPatch SQL 仮想マシンで有効または有効にする追加の修正プログラム。 'MicrosoftUpdate'
'NotSet'
dayOfWeek パッチを適用する曜日。 'Everyday'
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンで自動パッチを有効または無効にします。 bool
maintenanceWindowDuration 修正プログラムの適用期間。 int
maintenanceWindowStartingHour 修正プログラムの適用が開始される 1 日の時間。 ローカル VM 時刻。 int

KeyVaultCredentialSettings

Name Description Value
azureKeyVaultUrl Azure Key Vault の URL。 文字列
credentialName 資格情報の名前。 文字列
有効にする キー コンテナーの資格情報設定を有効または無効にします。 bool
servicePrincipalName キー コンテナーにアクセスするためのサービス プリンシパル名。 文字列
servicePrincipalSecret キー コンテナーにアクセスするためのサービス プリンシパル名シークレット。 文字列

ResourceIdentity

Name Description Value
型 ID の種類。 リソースの Azure Active Directory プリンシパルを自動的に作成して割り当てるには、これを "SystemAssigned" に設定します。 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned'

Schedule

Name Description Value
dayOfWeek 評価を実行する曜日。 'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
有効にする SQL 仮想マシンの評価スケジュールを有効または無効にします。 bool
monthlyOccurrence 評価をスケジュールする 1 か月以内の DayOfWeek 日の発生。 1、2、3、4、-1 の値を受け取ります。 月の最後の DayOfWeek 日に -1 を使用する int
startTime HH:mm 形式の時刻。例えば。17:30 文字列
weeklyInterval 2 つの評価実行の間にスケジュールする週数。 1 から 6 の値を受け取ります int

ServerConfigurationsManagementSettings

Name Description Value
additionalFeaturesServerConfigurations その他の SQL 機能の設定。 AdditionalFeaturesServerConfigurations
azureAdAuthenticationSettings Azure AD 認証の設定。 AADAuthenticationSettings
sqlConnectivityUpdateSettings SQL 接続の種類の設定。 SqlConnectivityUpdateSettings
sqlInstanceSettings SQL インスタンスの設定。 SQLInstanceSettings
sqlStorageUpdateSettings SQL ストレージの更新設定。 SqlStorageUpdateSettings
sqlWorkloadTypeUpdateSettings SQL ワークロードの種類の設定。 SqlWorkloadTypeUpdateSettings

SqlConnectivityUpdateSettings

Name Description Value
connectivityType SQL Server 接続オプション。 'LOCAL'
'PRIVATE'
'PUBLIC'
ポート SQL Server ポート。 int
sqlAuthUpdatePassword SQL Server sysadmin ログイン パスワード。 文字列
sqlAuthUpdateUserName 作成する SQL Server sysadmin ログイン。 文字列

SQLInstanceSettings

Name Description Value
照合順序 SQL Server 照合順序。 文字列
isIfiEnabled SQL Server IFI。 bool
isLpimEnabled SQL Server LPIM。 bool
isOptimizeForAdHocWorkloadsEnabled アドホック ワークロード用の SQL Server Optimize。 bool
maxDop SQL Server MAXDOP。 int
maxServerMemoryMB SQL Server の最大メモリ。 int
minServerMemoryMB SQL Server の最小メモリ。 int

SQLStorageSettings

Name Description Value
defaultFilePath SQL Server の既定のファイル パス 文字列
luns ディスクの論理ユニット番号。 int[]
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlStorageUpdateSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
diskCount 仮想マシンのディスク数。 int
startingDeviceId 更新する最初のディスクのデバイス ID。 int

SQLTempDbSettings

Name Description Value
dataFileCount SQL Server tempdb データ ファイルの数 int
dataFileSize SQL Server tempdb データ ファイルのサイズ int
dataGrowth SQL Server tempdb データ ファイルの自動拡張サイズ int
defaultFilePath SQL Server の既定のファイル パス 文字列
logFileSize SQL Server tempdb ログ ファイルのサイズ int
logGrowth SQL Server tempdb ログ ファイルの自動拡張サイズ int
luns ディスクの論理ユニット番号。 int[]
persistFolder SQL Server tempdb の保存フォルダーの選択 bool
persistFolderPath SQL Server tempdb の保存フォルダーの場所 文字列
useStoragePool 記憶域プールを使用してドライブをビルドする (true または指定されていない場合) bool

SqlVirtualMachineProperties

Name Description Value
assessmentSettings SQL のベスト プラクティスの評価の設定。 AssessmentSettings
autoBackupSettings SQL Server の自動バックアップ設定。 AutoBackupSettings
autoPatchingSettings SQL 仮想マシンに重要なセキュリティ更新プログラムを適用するための自動修正プログラムの設定。 AutoPatchingSettings
enableAutomaticUpgrade Sql IaaS 拡張機能エージェントの自動アップグレードを有効にします。 bool
keyVaultCredentialSettings キー コンテナーの資格情報の設定。 KeyVaultCredentialSettings
leastPrivilegeMode SQL IaaS Agent の最小特権モード。 'Enabled'
'NotSet'
serverConfigurationsManagementSettings SQL Server の構成管理設定。 ServerConfigurationsManagementSettings
sqlImageOffer SQL イメージ オファー。 例としては、SQL2016-WS2016、SQL2017-WS2016 などがあります。 文字列
sqlImageSku SQL Server エディションの種類。 'Developer'
'Enterprise'
'Express'
'Standard'
'Web'
sqlManagement SQL Server 管理の種類。 注: このパラメーターは使用されなくなりました。 API は Sql Management を自動的に検出し、使用しないようにします。 'Full'
'LightWeight'
'NoAgent'
sqlServerLicenseType SQL Server ライセンスの種類。 'AHUB'
'DR'
'PAYG'
sqlVirtualMachineGroupResourceId この SQL 仮想マシンが属しているか、その一部となる SQL 仮想マシン グループの ARM リソース ID。 文字列
storageConfigurationSettings ストレージ構成設定。 StorageConfigurationSettings
virtualMachineIdentitySettings Sql IaaS 拡張機能の構成に使用される仮想マシン ID の詳細。 VirtualMachineIdentity
virtualMachineResourceId SQL Marketplace イメージから作成された基になる仮想マシンの ARM リソース ID。 文字列
wsfcDomainCredentials SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 WsfcDomainCredentials
wsfcStaticIp SQL 可用性グループの Windows Server フェールオーバー クラスターを設定するためのドメイン資格情報。 文字列

SqlWorkloadTypeUpdateSettings

Name Description Value
sqlWorkloadType SQL Server ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

StorageConfigurationSettings

Name Description Value
diskConfigurationType SQL Server に適用するディスク構成。 'ADD'
'EXTEND'
'NEW'
enableStorageConfigBlade Azure portal で SQL IaaS Agent ストレージ構成ブレードを有効にします。 bool
sqlDataSettings SQL Server データ ストレージの設定。 SQLStorageSettings
sqlLogSettings SQL Server ログ ストレージの設定。 SQLStorageSettings
sqlSystemDbOnDataDisk True の場合、DataPool 上の SQL Server SystemDb ストレージ。 bool
sqlTempDbSettings SQL Server TempDb ストレージの設定。 SQLTempDbSettings
storageWorkloadType ストレージ ワークロードの種類。 'DW'
'GENERAL'
'OLTP'

TrackedResourceTags

Name Description Value

VirtualMachineIdentity

Name Description Value
resourceId ID の ARM リソース ID。 UserAssigned ID が選択されている場合にのみ必要です。 文字列
型 仮想マシンの ID の種類。 マネージド ID をオプトアウトするには、[なし] を指定します。 'None'
'SystemAssigned'
'UserAssigned'

WsfcDomainCredentials

Name Description Value
clusterBootstrapAccountPassword クラスター ブートストラップ アカウントのパスワード。 文字列
clusterOperatorAccountPassword クラスター オペレーター アカウントのパスワード。 文字列
sqlServiceAccountPassword SQL サービス アカウントのパスワード。 文字列