Microsoft.Automation automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers 01/11/2023

Definición de recursos de Bicep

El tipo de recurso automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers se puede implementar con operaciones destinadas a:

Para obtener una lista de las propiedades modificadas en cada versión de API, consulte registro de cambios.

Ejemplos de uso

Ejemplos de Bicep

Un ejemplo básico de implementación de Automation.

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The password for the automation account hybrid runbook worker')
param automationWorkerPassword string
@secure()
@description('The administrator password for the virtual machine')
param vmAdminPassword string

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

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2022-07-01' = {
  name: 'internal'
  parent: virtualNetwork
  properties: {
    addressPrefix: '10.0.2.0/24'
    delegations: []
    privateEndpointNetworkPolicies: 'Enabled'
    privateLinkServiceNetworkPolicies: 'Enabled'
    serviceEndpointPolicies: []
    serviceEndpoints: []
  }
}

resource automationAccount 'Microsoft.Automation/automationAccounts@2021-06-22' = {
  name: resourceName
  location: location
  properties: {
    encryption: {
      keySource: 'Microsoft.Automation'
    }
    publicNetworkAccess: true
    sku: {
      name: 'Basic'
    }
  }
}

resource hybridRunbookWorkerGroup 'Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups@2021-06-22' = {
  name: resourceName
  parent: automationAccount
}

resource hybridRunbookWorker 'Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2021-06-22' = {
  name: 'c7714056-5ba8-4bbe-920e-2993171164eb'
  parent: hybridRunbookWorkerGroup
  properties: {
    vmResourceId: virtualMachine.id
  }
}

resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = {
  name: resourceName
  location: location
  properties: {
    additionalCapabilities: {}
    applicationProfile: {
      galleryApplications: []
    }
    diagnosticsProfile: {
      bootDiagnostics: {
        enabled: false
        storageUri: ''
      }
    }
    extensionsTimeBudget: 'PT1H30M'
    hardwareProfile: {
      vmSize: 'Standard_D2s_v3'
    }
    networkProfile: {
      networkInterfaces: [
        {
          id: networkInterface.id
          properties: {
            primary: true
          }
        }
      ]
    }
    osProfile: {
      adminPassword: vmAdminPassword
      adminUsername: 'adminuser'
      allowExtensionOperations: true
      computerName: resourceName
      linuxConfiguration: {
        disablePasswordAuthentication: false
        patchSettings: {
          assessmentMode: 'ImageDefault'
          patchMode: 'ImageDefault'
        }
        provisionVMAgent: true
        ssh: {
          publicKeys: []
        }
      }
      secrets: []
    }
    priority: 'Regular'
    storageProfile: {
      dataDisks: []
      imageReference: {
        offer: 'UbuntuServer'
        publisher: 'Canonical'
        sku: '16.04-LTS'
        version: 'latest'
      }
      osDisk: {
        caching: 'ReadWrite'
        createOption: 'FromImage'
        managedDisk: {
          storageAccountType: 'Standard_LRS'
        }
        osType: 'Linux'
        writeAcceleratorEnabled: false
      }
    }
  }
}

resource networkInterface 'Microsoft.Network/networkInterfaces@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    enableAcceleratedNetworking: false
    enableIPForwarding: false
    ipConfigurations: [
      {
        name: 'testconfiguration1'
        properties: {
          primary: true
          privateIPAddressVersion: 'IPv4'
          privateIPAllocationMethod: 'Dynamic'
          subnet: {
            id: subnet.id
          }
        }
      }
    ]
  }
}

resource credential 'Microsoft.Automation/automationAccounts/credentials@2020-01-13-preview' = {
  name: resourceName
  parent: automationAccount
  properties: {
    description: ''
    password: automationWorkerPassword
    userName: 'test_user'
  }
}

Módulos comprobados de Azure

Los siguientes módulos comprobados de Azure se pueden usar para implementar este tipo de recurso.

Module Descripción
Cuenta de Automatización - Grupo de Trabajadores Híbridos Runbook - Hybrid Runb Wrkr AVM Child Module para la Cuenta de Automatización - Grupo de Trabajadores Hybrid Runbook - Hybrid Runb Wrkr

Formato de recurso

Para crear un recurso Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers, agregue el siguiente bicep a la plantilla.

resource symbolicname 'Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2023-11-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    vmResourceId: 'string'
  }
}

Valores de propiedad

Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers

Nombre Descripción Valor
nombre El nombre del recurso string (obligatorio)
padre En Bicep, puede especificar el recurso primario para un recurso secundario. Solo tiene que agregar esta propiedad cuando el recurso secundario se declara fuera del recurso primario.

Para obtener más información, consulte recurso secundario fuera del recurso primario.
Nombre simbólico del recurso de tipo: automationAccounts/hybridRunbookWorkerGroups
Propiedades Obtiene o establece propiedades de creación o actualización del grupo de Hybrid Runbook Worker. HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties (obligatorio)

HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties

Nombre Descripción Valor
vmResourceId Identificador de Azure Resource Manager para una máquina virtual. cuerda

Definición de recursos de plantilla de ARM

El tipo de recurso automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers se puede implementar con operaciones destinadas a:

Ejemplos de uso

Formato de recurso

Para crear un recurso Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers, agregue el siguiente JSON a la plantilla.

{
  "type": "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers",
  "apiVersion": "2023-11-01",
  "name": "string",
  "properties": {
    "vmResourceId": "string"
  }
}

Valores de propiedad

Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers

Nombre Descripción Valor
apiVersion La versión de api '2023-11-01'
nombre El nombre del recurso string (obligatorio)
Propiedades Obtiene o establece propiedades de creación o actualización del grupo de Hybrid Runbook Worker. HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties (obligatorio)
tipo El tipo de recurso 'Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers'

HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties

Nombre Descripción Valor
vmResourceId Identificador de Azure Resource Manager para una máquina virtual. cuerda

Definición de recursos de Terraform (proveedor AzAPI)

El tipo de recurso automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers se puede implementar con operaciones destinadas a:

  • Grupos de recursos Para una lista de propiedades modificadas en cada versión de la API, consulte registro de cambios.

Ejemplos de uso

Ejemplos de Terraform

Un ejemplo básico de implementación de Automation.

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 "automation_worker_password" {
  type        = string
  description = "The password for the automation account hybrid runbook worker"
  sensitive   = true
}

variable "vm_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" "automationAccount" {
  type      = "Microsoft.Automation/automationAccounts@2021-06-22"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      encryption = {
        keySource = "Microsoft.Automation"
      }
      publicNetworkAccess = true
      sku = {
        name = "Basic"
      }
    }
  }
  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.0.0.0/16",
        ]
      }
      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      = "internal"
  body = {
    properties = {
      addressPrefix = "10.0.2.0/24"
      delegations = [
      ]
      privateEndpointNetworkPolicies    = "Enabled"
      privateLinkServiceNetworkPolicies = "Enabled"
      serviceEndpointPolicies = [
      ]
      serviceEndpoints = [
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "credential" {
  type      = "Microsoft.Automation/automationAccounts/credentials@2020-01-13-preview"
  parent_id = azapi_resource.automationAccount.id
  name      = var.resource_name
  body = {
    properties = {
      description = ""
      password    = var.automation_worker_password
      userName    = "test_user"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "hybridRunbookWorkerGroup" {
  type      = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups@2021-06-22"
  parent_id = azapi_resource.automationAccount.id
  name      = var.resource_name
  body = {
    credential = {
      name = azapi_resource.credential.name
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "networkInterface" {
  type      = "Microsoft.Network/networkInterfaces@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      enableAcceleratedNetworking = false
      enableIPForwarding          = false
      ipConfigurations = [
        {
          name = "testconfiguration1"
          properties = {
            primary                   = true
            privateIPAddressVersion   = "IPv4"
            privateIPAllocationMethod = "Dynamic"
            subnet = {
              id = azapi_resource.subnet.id
            }
          }
        },
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "virtualMachine" {
  type      = "Microsoft.Compute/virtualMachines@2023-03-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      additionalCapabilities = {
      }
      applicationProfile = {
        galleryApplications = [
        ]
      }
      diagnosticsProfile = {
        bootDiagnostics = {
          enabled    = false
          storageUri = ""
        }
      }
      extensionsTimeBudget = "PT1H30M"
      hardwareProfile = {
        vmSize = "Standard_D2s_v3"
      }
      networkProfile = {
        networkInterfaces = [
          {
            id = azapi_resource.networkInterface.id
            properties = {
              primary = true
            }
          },
        ]
      }
      osProfile = {
        adminPassword            = var.vm_admin_password
        adminUsername            = "adminuser"
        allowExtensionOperations = true
        computerName             = var.resource_name
        linuxConfiguration = {
          disablePasswordAuthentication = false
          patchSettings = {
            assessmentMode = "ImageDefault"
            patchMode      = "ImageDefault"
          }
          provisionVMAgent = true
          ssh = {
            publicKeys = [
            ]
          }
        }
        secrets = [
        ]
      }
      priority = "Regular"
      storageProfile = {
        dataDisks = [
        ]
        imageReference = {
          offer     = "UbuntuServer"
          publisher = "Canonical"
          sku       = "16.04-LTS"
          version   = "latest"
        }
        osDisk = {
          caching      = "ReadWrite"
          createOption = "FromImage"
          managedDisk = {
            storageAccountType = "Standard_LRS"
          }
          osType                  = "Linux"
          writeAcceleratorEnabled = false
        }
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "hybridRunbookWorker" {
  type      = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2021-06-22"
  parent_id = azapi_resource.hybridRunbookWorkerGroup.id
  name      = "c7714056-5ba8-4bbe-920e-2993171164eb"
  body = {
    properties = {
      vmResourceId = azapi_resource.virtualMachine.id
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Formato de recurso

Para crear un recurso Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers, agregue el siguiente terraform a la plantilla.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2023-11-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      vmResourceId = "string"
    }
  }
}

Valores de propiedad

Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers

Nombre Descripción Valor
nombre El nombre del recurso string (obligatorio)
parent_id Identificador del recurso que es el elemento primario de este recurso. Identificador del recurso de tipo: automationAccounts/hybridRunbookWorkerGroups
Propiedades Obtiene o establece propiedades de creación o actualización del grupo de Hybrid Runbook Worker. HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties (obligatorio)
tipo El tipo de recurso "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2023-11-01"

HybridRunbookWorkerCreateOrUpdateParametersOrHybridRunbookWorkerProperties

Nombre Descripción Valor
vmResourceId Identificador de Azure Resource Manager para una máquina virtual. cuerda