- Latest
- 2025-02-01-preview
- 2025-01-01
- 2024-11-01-preview
- 2024-05-01-preview
- 2023-08-01
- 2023-08-01-preview
- 2023-05-01-preview
- 2023-02-01-preview
- 2022-11-01-preview
- 2022-08-01-preview
- 2022-05-01-preview
- 2022-02-01-preview
- 2021-11-01
- 2021-11-01-preview
- 2021-08-01-preview
- 2021-05-01-preview
- 2021-02-01-preview
- 2020-11-01-preview
- 2020-08-01-preview
- 2020-02-02-preview
- 2017-03-01-preview
Bicepリソースの定義
servers/jobAgents/jobs/steps リソースの種類は、次を対象とする操作と共にデプロイできます。
- リソース グループの - リソース グループのデプロイ コマンド 参照
各 API バージョンで変更されたプロパティのリストについては、「 変更ログ」を参照してください。
使用例
Bicep のサンプル
Elastic Job Step のデプロイの基本的な例。
param location string = 'westus'
@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string
@secure()
@description('The password for the SQL job credential')
param jobCredentialPassword string
param resourceName string = 'acctest0001'
var maintenanceConfigId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default'
resource server 'Microsoft.Sql/servers@2023-08-01-preview' = {
name: '${resourceName}-server'
location: location
properties: {
administratorLogin: '4dm1n157r470r'
administratorLoginPassword: administratorLoginPassword
minimalTlsVersion: '1.2'
publicNetworkAccess: 'Enabled'
restrictOutboundNetworkAccess: 'Disabled'
version: '12.0'
}
}
resource jobAgent 'Microsoft.Sql/servers/jobAgents@2023-08-01-preview' = {
name: '${resourceName}-job-agent'
location: location
parent: server
sku: {
name: 'JA100'
}
properties: {
databaseId: database.id
}
}
resource credential 'Microsoft.Sql/servers/jobAgents/credentials@2023-08-01-preview' = {
name: '${resourceName}-job-credential'
parent: jobAgent
properties: {
password: jobCredentialPassword
username: 'testusername'
}
}
resource job 'Microsoft.Sql/servers/jobAgents/jobs@2023-08-01-preview' = {
name: '${resourceName}-job'
parent: jobAgent
properties: {
description: ''
}
}
resource targetGroup 'Microsoft.Sql/servers/jobAgents/targetGroups@2023-08-01-preview' = {
name: '${resourceName}-target-group'
parent: jobAgent
properties: {
members: []
}
}
resource step 'Microsoft.Sql/servers/jobAgents/jobs/steps@2023-08-01-preview' = {
name: '${resourceName}-job-step'
parent: job
properties: {
action: {
value: '''IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N''Person'')
CREATE TABLE Person (
FirstName NVARCHAR(50),
LastName NVARCHAR(50),
);
'''
}
credential: credential.id
executionOptions: {
initialRetryIntervalSeconds: 1
maximumRetryIntervalSeconds: 120
retryAttempts: 10
retryIntervalBackoffMultiplier: 2
timeoutSeconds: 43200
}
stepId: 1
targetGroup: targetGroup.id
}
}
resource database 'Microsoft.Sql/servers/databases@2023-08-01-preview' = {
name: '${resourceName}-db'
location: location
parent: server
sku: {
name: 'S1'
}
properties: {
collation: 'SQL_Latin1_General_CP1_CI_AS'
createMode: 'Default'
maintenanceConfigurationId: maintenanceConfigId
}
}
リソースの形式
Microsoftを作るために。Sql/servers/jobAgents/jobs/steps リソースで、テンプレートに以下のBicepを追加してください。
resource symbolicname 'Microsoft.Sql/servers/jobAgents/jobs/steps@2024-11-01-preview' = {
parent: resourceSymbolicName
name: 'string'
properties: {
action: {
source: 'string'
type: 'string'
value: 'string'
}
credential: 'string'
executionOptions: {
initialRetryIntervalSeconds: int
maximumRetryIntervalSeconds: int
retryAttempts: int
retryIntervalBackoffMultiplier: int
timeoutSeconds: int
}
output: {
credential: 'string'
databaseName: 'string'
resourceGroupName: 'string'
schemaName: 'string'
serverName: 'string'
subscriptionId: 'string'
tableName: 'string'
type: 'string'
}
stepId: int
targetGroup: 'string'
}
}
プロパティ値
Microsoft。Sql/servers/jobAgents/jobs/steps
| Name | Description | Value |
|---|---|---|
| name | リソース名 | string (必須) |
| 親 | Bicepでは、子リソースの親リソースを指定することができます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。 詳細については、「親リソースの外部 |
種類のリソースのシンボリック名: servers/jobAgents/jobs |
| properties | リソースのプロパティ。 | JobStepProperties |
JobStepAction
| Name | Description | Value |
|---|---|---|
| ソース | 実行するアクションのソース。 | 'Inline' |
| 型 | ジョブ ステップによって実行されるアクションの種類。 | 'TSql' |
| value | 実行する T-SQL スクリプトのテキストなどのアクション値。 | string (必須) |
JobStepExecutionOptions
| Name | Description | Value |
|---|---|---|
| initialRetryIntervalSeconds | ジョブ ステップの実行の再試行間の初期遅延。 | int |
| maximumRetryIntervalSeconds | ジョブ ステップの実行の再試行の間に待機する最大時間。 | int |
| retryAttempts | 最初の試行が失敗した場合にジョブ ステップが再試行される最大回数。 | int |
| retryIntervalBackoffMultiplier | 再試行間のバックオフ乗数。 | int |
| timeoutSeconds | ジョブ ステップの実行タイムアウト。 | int |
JobStepOutput
| Name | Description | Value |
|---|---|---|
| 資格情報 | 出力先への接続に使用する資格情報のリソース ID。 | 文字列 |
| databaseName | 出力先データベース。 | string (必須) |
| resourceGroupName | 出力先のリソース グループ。 | 文字列 |
| schemaName | 出力先スキーマ。 | 文字列 |
| serverName | 出力先サーバー名。 | string (必須) |
| subscriptionId | 出力先のサブスクリプション ID。 | string Constraints: 最小長 = 36 最大長 = 36 パターン = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tableName | 出力先テーブル。 | string (必須) |
| 型 | 出力先の種類。 | 'SqlDatabase' |
JobStepProperties
| Name | Description | Value |
|---|---|---|
| アクション | ジョブ ステップのアクション ペイロード。 | JobStepAction (必須) |
| 資格情報 | ターゲットへの接続に使用されるジョブ資格情報のリソース ID。 | 文字列 |
| executionOptions | ジョブ ステップの実行オプション。 | JobStepExecutionOptions |
| 出力 | ジョブ ステップの出力先プロパティ。 | JobStepOutput |
| stepId | ジョブ内のジョブ ステップのインデックス。 ジョブ ステップの作成時に指定しない場合は、最後のステップとして作成されます。 ジョブ ステップの更新時に指定しない場合、ステップ ID は変更されません。 | int |
| targetGroup | ジョブ ステップが実行されるターゲット グループのリソース ID。 | string (必須) |
ARM テンプレート リソース定義
servers/jobAgents/jobs/steps リソースの種類は、次を対象とする操作と共にデプロイできます。
- リソースグループ - リソースグループのデプロイコマンドを参照してください。 各APIバージョンの変更プロパティ一覧は 変更ログをご覧ください。
使用例
リソースの形式
Microsoftを作るために。Sql/servers/jobAgents/jobs/steps リソースに、テンプレートに以下のJSONを追加してください。
{
"type": "Microsoft.Sql/servers/jobAgents/jobs/steps",
"apiVersion": "2024-11-01-preview",
"name": "string",
"properties": {
"action": {
"source": "string",
"type": "string",
"value": "string"
},
"credential": "string",
"executionOptions": {
"initialRetryIntervalSeconds": "int",
"maximumRetryIntervalSeconds": "int",
"retryAttempts": "int",
"retryIntervalBackoffMultiplier": "int",
"timeoutSeconds": "int"
},
"output": {
"credential": "string",
"databaseName": "string",
"resourceGroupName": "string",
"schemaName": "string",
"serverName": "string",
"subscriptionId": "string",
"tableName": "string",
"type": "string"
},
"stepId": "int",
"targetGroup": "string"
}
}
プロパティ値
Microsoft。Sql/servers/jobAgents/jobs/steps
| Name | Description | Value |
|---|---|---|
| apiVersion | API のバージョン | '2024-11-01-preview' |
| name | リソース名 | string (必須) |
| properties | リソースのプロパティ。 | JobStepProperties |
| 型 | リソースの種類 | 「Microsoft。sql/servers/jobAgents/jobs/steps' |
JobStepAction
| Name | Description | Value |
|---|---|---|
| ソース | 実行するアクションのソース。 | 'Inline' |
| 型 | ジョブ ステップによって実行されるアクションの種類。 | 'TSql' |
| value | 実行する T-SQL スクリプトのテキストなどのアクション値。 | string (必須) |
JobStepExecutionOptions
| Name | Description | Value |
|---|---|---|
| initialRetryIntervalSeconds | ジョブ ステップの実行の再試行間の初期遅延。 | int |
| maximumRetryIntervalSeconds | ジョブ ステップの実行の再試行の間に待機する最大時間。 | int |
| retryAttempts | 最初の試行が失敗した場合にジョブ ステップが再試行される最大回数。 | int |
| retryIntervalBackoffMultiplier | 再試行間のバックオフ乗数。 | int |
| timeoutSeconds | ジョブ ステップの実行タイムアウト。 | int |
JobStepOutput
| Name | Description | Value |
|---|---|---|
| 資格情報 | 出力先への接続に使用する資格情報のリソース ID。 | 文字列 |
| databaseName | 出力先データベース。 | string (必須) |
| resourceGroupName | 出力先のリソース グループ。 | 文字列 |
| schemaName | 出力先スキーマ。 | 文字列 |
| serverName | 出力先サーバー名。 | string (必須) |
| subscriptionId | 出力先のサブスクリプション ID。 | string Constraints: 最小長 = 36 最大長 = 36 パターン = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tableName | 出力先テーブル。 | string (必須) |
| 型 | 出力先の種類。 | 'SqlDatabase' |
JobStepProperties
| Name | Description | Value |
|---|---|---|
| アクション | ジョブ ステップのアクション ペイロード。 | JobStepAction (必須) |
| 資格情報 | ターゲットへの接続に使用されるジョブ資格情報のリソース ID。 | 文字列 |
| executionOptions | ジョブ ステップの実行オプション。 | JobStepExecutionOptions |
| 出力 | ジョブ ステップの出力先プロパティ。 | JobStepOutput |
| stepId | ジョブ内のジョブ ステップのインデックス。 ジョブ ステップの作成時に指定しない場合は、最後のステップとして作成されます。 ジョブ ステップの更新時に指定しない場合、ステップ ID は変更されません。 | int |
| targetGroup | ジョブ ステップが実行されるターゲット グループのリソース ID。 | string (必須) |
Terraform (AzAPI プロバイダー) リソース定義
servers/jobAgents/jobs/steps リソースの種類は、次を対象とする操作と共にデプロイできます。
- リソースグループ 各APIバージョンの変更プロパティ一覧については、 変更ログをご覧ください。
使用例
Terraformサンプル
Elastic Job Step のデプロイの基本的な例。
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 = "westus"
}
variable "administrator_login_password" {
type = string
sensitive = true
description = "The administrator login password for the SQL server"
}
variable "job_credential_password" {
type = string
sensitive = true
description = "The password for the SQL job credential"
}
data "azapi_client_config" "current" {}
locals {
maintenance_config_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"
}
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@2023-08-01-preview"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}-server"
location = var.location
body = {
properties = {
administratorLogin = "4dm1n157r470r"
administratorLoginPassword = var.administrator_login_password
minimalTlsVersion = "1.2"
publicNetworkAccess = "Enabled"
restrictOutboundNetworkAccess = "Disabled"
version = "12.0"
}
}
}
resource "azapi_resource" "database" {
type = "Microsoft.Sql/servers/databases@2023-08-01-preview"
parent_id = azapi_resource.server.id
name = "${var.resource_name}-db"
location = var.location
body = {
properties = {
collation = "SQL_Latin1_General_CP1_CI_AS"
createMode = "Default"
maintenanceConfigurationId = local.maintenance_config_id
}
sku = {
name = "S1"
}
}
}
resource "azapi_resource" "jobAgent" {
type = "Microsoft.Sql/servers/jobAgents@2023-08-01-preview"
parent_id = azapi_resource.server.id
name = "${var.resource_name}-job-agent"
location = var.location
body = {
properties = {
databaseId = azapi_resource.database.id
}
sku = {
name = "JA100"
}
}
}
resource "azapi_resource" "job" {
type = "Microsoft.Sql/servers/jobAgents/jobs@2023-08-01-preview"
parent_id = azapi_resource.jobAgent.id
name = "${var.resource_name}-job"
body = {
properties = {
description = ""
}
}
}
resource "azapi_resource" "credential" {
type = "Microsoft.Sql/servers/jobAgents/credentials@2023-08-01-preview"
parent_id = azapi_resource.jobAgent.id
name = "${var.resource_name}-job-credential"
body = {
properties = {
password = var.job_credential_password
username = "testusername"
}
}
}
resource "azapi_resource" "targetGroup" {
type = "Microsoft.Sql/servers/jobAgents/targetGroups@2023-08-01-preview"
parent_id = azapi_resource.jobAgent.id
name = "${var.resource_name}-target-group"
body = {
properties = {
members = []
}
}
}
resource "azapi_resource" "step" {
type = "Microsoft.Sql/servers/jobAgents/jobs/steps@2023-08-01-preview"
parent_id = azapi_resource.job.id
name = "${var.resource_name}-job-step"
body = {
properties = {
action = {
value = "IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Person')\n CREATE TABLE Person (\n FirstName NVARCHAR(50),\n LastName NVARCHAR(50),\n );\n"
}
credential = azapi_resource.credential.id
executionOptions = {
initialRetryIntervalSeconds = 1
maximumRetryIntervalSeconds = 120
retryAttempts = 10
retryIntervalBackoffMultiplier = 2
timeoutSeconds = 43200
}
stepId = 1
targetGroup = azapi_resource.targetGroup.id
}
}
}
リソースの形式
Microsoftを作るために。sql/servers/jobAgents/jobs/steps リソースで、テンプレートに以下のTerraformを追加してください。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Sql/servers/jobAgents/jobs/steps@2024-11-01-preview"
name = "string"
parent_id = "string"
body = {
properties = {
action = {
source = "string"
type = "string"
value = "string"
}
credential = "string"
executionOptions = {
initialRetryIntervalSeconds = int
maximumRetryIntervalSeconds = int
retryAttempts = int
retryIntervalBackoffMultiplier = int
timeoutSeconds = int
}
output = {
credential = "string"
databaseName = "string"
resourceGroupName = "string"
schemaName = "string"
serverName = "string"
subscriptionId = "string"
tableName = "string"
type = "string"
}
stepId = int
targetGroup = "string"
}
}
}
プロパティ値
Microsoft。Sql/servers/jobAgents/jobs/steps
| Name | Description | Value |
|---|---|---|
| name | リソース名 | string (必須) |
| parent_id | このリソースの親であるリソースの ID。 | 種類のリソースの ID: servers/jobAgents/jobs |
| properties | リソースのプロパティ。 | JobStepProperties |
| 型 | リソースの種類 | 「Microsoft。Sql/servers/jobAgents/jobs/steps@2024-11-01-preview" |
JobStepAction
| Name | Description | Value |
|---|---|---|
| ソース | 実行するアクションのソース。 | 'Inline' |
| 型 | ジョブ ステップによって実行されるアクションの種類。 | 'TSql' |
| value | 実行する T-SQL スクリプトのテキストなどのアクション値。 | string (必須) |
JobStepExecutionOptions
| Name | Description | Value |
|---|---|---|
| initialRetryIntervalSeconds | ジョブ ステップの実行の再試行間の初期遅延。 | int |
| maximumRetryIntervalSeconds | ジョブ ステップの実行の再試行の間に待機する最大時間。 | int |
| retryAttempts | 最初の試行が失敗した場合にジョブ ステップが再試行される最大回数。 | int |
| retryIntervalBackoffMultiplier | 再試行間のバックオフ乗数。 | int |
| timeoutSeconds | ジョブ ステップの実行タイムアウト。 | int |
JobStepOutput
| Name | Description | Value |
|---|---|---|
| 資格情報 | 出力先への接続に使用する資格情報のリソース ID。 | 文字列 |
| databaseName | 出力先データベース。 | string (必須) |
| resourceGroupName | 出力先のリソース グループ。 | 文字列 |
| schemaName | 出力先スキーマ。 | 文字列 |
| serverName | 出力先サーバー名。 | string (必須) |
| subscriptionId | 出力先のサブスクリプション ID。 | string Constraints: 最小長 = 36 最大長 = 36 パターン = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tableName | 出力先テーブル。 | string (必須) |
| 型 | 出力先の種類。 | 'SqlDatabase' |
JobStepProperties
| Name | Description | Value |
|---|---|---|
| アクション | ジョブ ステップのアクション ペイロード。 | JobStepAction (必須) |
| 資格情報 | ターゲットへの接続に使用されるジョブ資格情報のリソース ID。 | 文字列 |
| executionOptions | ジョブ ステップの実行オプション。 | JobStepExecutionOptions |
| 出力 | ジョブ ステップの出力先プロパティ。 | JobStepOutput |
| stepId | ジョブ内のジョブ ステップのインデックス。 ジョブ ステップの作成時に指定しない場合は、最後のステップとして作成されます。 ジョブ ステップの更新時に指定しない場合、ステップ ID は変更されません。 | int |
| targetGroup | ジョブ ステップが実行されるターゲット グループのリソース ID。 | string (必須) |