Condividi tramite


Microsoft.Sql server/jobAgents/credentials

Definizione di risorsa Bicep

Il tipo di risorsa servers/jobAgents/credentials può essere distribuito con operazioni destinate a:

  • gruppi di risorse - Vedere i comandi di distribuzione del gruppo di risorse

Per un elenco delle proprietà modificate in ogni versione dell'API, vedere log delle modifiche.

Formato risorsa

Per creare una risorsa Microsoft.Sql/servers/jobAgents/credentials, aggiungere il bicep seguente al modello.

resource symbolicname 'Microsoft.Sql/servers/jobAgents/credentials@2025-02-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    password: 'string'
    username: 'string'
  }
}

Valori delle proprietà

Microsoft.Sql/servers/jobAgents/credentials

Name Description Value
name Nome della risorsa stringa (obbligatorio)
parent In Bicep è possibile specificare la risorsa padre per una risorsa figlio. È necessario aggiungere questa proprietà solo quando la risorsa figlio viene dichiarata all'esterno della risorsa padre.

Per altre informazioni, vedere risorsa figlio all'esterno della risorsa padre.
Nome simbolico per la risorsa di tipo: servers/jobAgents
properties Proprietà delle risorse. JobCredentialProperties

JobCredentialProperties

Name Description Value
password Password delle credenziali. stringa (obbligatorio)
username Nome utente credenziali. stringa (obbligatorio)

Esempi di utilizzo

Esempi bicep

Un esempio di base di distribuzione delle credenziali di processo elastiche.

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@description('The administrator username for the SQL server credential')
param sqlAdminUsername string
@secure()
@description('The administrator password for the SQL server credential')
param sqlAdminPassword string
@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string

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

resource database 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
  parent: server
  name: resourceName
  location: location
  properties: {
    autoPauseDelay: 0
    collation: 'SQL_Latin1_General_CP1_CI_AS'
    createMode: 'Default'
    elasticPoolId: ''
    highAvailabilityReplicaCount: 0
    isLedgerOn: false
    minCapacity: 0
    readScale: 'Disabled'
    requestedBackupStorageRedundancy: 'Geo'
    zoneRedundant: false
  }
}

resource jobAgent 'Microsoft.Sql/servers/jobAgents@2020-11-01-preview' = {
  parent: server
  name: resourceName
  location: location
  properties: {
    databaseId: database.id
  }
}

resource credential 'Microsoft.Sql/servers/jobAgents/credentials@2020-11-01-preview' = {
  parent: jobAgent
  name: resourceName
  properties: {
    password: null
    username: null
  }
}

Definizione di risorsa del modello di Resource Manager

Il tipo di risorsa servers/jobAgents/credentials può essere distribuito con operazioni destinate a:

  • gruppi di risorse - Vedere i comandi di distribuzione del gruppo di risorse

Per un elenco delle proprietà modificate in ogni versione dell'API, vedere log delle modifiche.

Formato risorsa

Per creare una risorsa Microsoft.Sql/servers/jobAgents/credentials, aggiungere il codice JSON seguente al modello.

{
  "type": "Microsoft.Sql/servers/jobAgents/credentials",
  "apiVersion": "2025-02-01-preview",
  "name": "string",
  "properties": {
    "password": "string",
    "username": "string"
  }
}

Valori delle proprietà

Microsoft.Sql/servers/jobAgents/credentials

Name Description Value
apiVersion Versione dell'API '2025-02-01-anteprima'
name Nome della risorsa stringa (obbligatorio)
properties Proprietà delle risorse. JobCredentialProperties
type Tipo di risorsa 'Microsoft.Sql/servers/jobAgents/credentials'

JobCredentialProperties

Name Description Value
password Password delle credenziali. stringa (obbligatorio)
username Nome utente credenziali. stringa (obbligatorio)

Esempi di utilizzo

Definizione di risorsa Terraform (provider AzAPI)

Il tipo di risorsa servers/jobAgents/credentials può essere distribuito con operazioni destinate a:

  • Gruppi di risorse

Per un elenco delle proprietà modificate in ogni versione dell'API, vedere log delle modifiche.

Formato risorsa

Per creare una risorsa Microsoft.Sql/servers/jobAgents/credentials, aggiungere il file Terraform seguente al modello.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/servers/jobAgents/credentials@2025-02-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      password = "string"
      username = "string"
    }
  }
}

Valori delle proprietà

Microsoft.Sql/servers/jobAgents/credentials

Name Description Value
name Nome della risorsa stringa (obbligatorio)
parent_id ID della risorsa padre per questa risorsa. ID per la risorsa di tipo: servers/jobAgents
properties Proprietà delle risorse. JobCredentialProperties
type Tipo di risorsa "Microsoft.Sql/servers/jobAgents/credentials@2025-02-01-preview"

JobCredentialProperties

Name Description Value
password Password delle credenziali. stringa (obbligatorio)
username Nome utente credenziali. stringa (obbligatorio)

Esempi di utilizzo

Esempi di Terraform

Un esempio di base di distribuzione delle credenziali di processo elastiche.

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

provider "azapi" {
  skip_provider_registration = false
}

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

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

variable "sql_admin_username" {
  type        = string
  description = "The administrator username for the SQL server credential"
}

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

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

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

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

resource "azapi_resource" "database" {
  type      = "Microsoft.Sql/servers/databases@2021-02-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      autoPauseDelay                   = 0
      collation                        = "SQL_Latin1_General_CP1_CI_AS"
      createMode                       = "Default"
      elasticPoolId                    = ""
      highAvailabilityReplicaCount     = 0
      isLedgerOn                       = false
      minCapacity                      = 0
      readScale                        = "Disabled"
      requestedBackupStorageRedundancy = "Geo"
      zoneRedundant                    = false
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "jobAgent" {
  type      = "Microsoft.Sql/servers/jobAgents@2020-11-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      databaseId = azapi_resource.database.id
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "credential" {
  type      = "Microsoft.Sql/servers/jobAgents/credentials@2020-11-01-preview"
  parent_id = azapi_resource.jobAgent.id
  name      = var.resource_name
  body = {
    properties = {
      password = var.sql_admin_password
      username = var.sql_admin_username
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}