1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. JobCredential
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.sql.JobCredential

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

A stored credential that can be used by a job to connect to target databases.

Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2021-11-01.

Other available API versions: 2017-03-01-preview, 2020-02-02-preview, 2020-08-01-preview, 2020-11-01-preview, 2021-02-01-preview, 2021-05-01-preview, 2021-08-01-preview, 2021-11-01, 2021-11-01-preview, 2022-02-01-preview, 2022-05-01-preview, 2022-08-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native sql [ApiVersion]. See the version guide for details.

Example Usage

Create or update a credential

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var jobCredential = new AzureNative.Sql.JobCredential("jobCredential", new()
    {
        CredentialName = "cred1",
        JobAgentName = "agent1",
        Password = "<password>",
        ResourceGroupName = "group1",
        ServerName = "server1",
        Username = "myuser",
    });

});
Copy
package main

import (
	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewJobCredential(ctx, "jobCredential", &sql.JobCredentialArgs{
			CredentialName:    pulumi.String("cred1"),
			JobAgentName:      pulumi.String("agent1"),
			Password:          pulumi.String("<password>"),
			ResourceGroupName: pulumi.String("group1"),
			ServerName:        pulumi.String("server1"),
			Username:          pulumi.String("myuser"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.JobCredential;
import com.pulumi.azurenative.sql.JobCredentialArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var jobCredential = new JobCredential("jobCredential", JobCredentialArgs.builder()
            .credentialName("cred1")
            .jobAgentName("agent1")
            .password("<password>")
            .resourceGroupName("group1")
            .serverName("server1")
            .username("myuser")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const jobCredential = new azure_native.sql.JobCredential("jobCredential", {
    credentialName: "cred1",
    jobAgentName: "agent1",
    password: "<password>",
    resourceGroupName: "group1",
    serverName: "server1",
    username: "myuser",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

job_credential = azure_native.sql.JobCredential("jobCredential",
    credential_name="cred1",
    job_agent_name="agent1",
    password="<password>",
    resource_group_name="group1",
    server_name="server1",
    username="myuser")
Copy
resources:
  jobCredential:
    type: azure-native:sql:JobCredential
    properties:
      credentialName: cred1
      jobAgentName: agent1
      password: <password>
      resourceGroupName: group1
      serverName: server1
      username: myuser
Copy

Create JobCredential Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new JobCredential(name: string, args: JobCredentialArgs, opts?: CustomResourceOptions);
@overload
def JobCredential(resource_name: str,
                  args: JobCredentialArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def JobCredential(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  job_agent_name: Optional[str] = None,
                  password: Optional[str] = None,
                  resource_group_name: Optional[str] = None,
                  server_name: Optional[str] = None,
                  username: Optional[str] = None,
                  credential_name: Optional[str] = None)
func NewJobCredential(ctx *Context, name string, args JobCredentialArgs, opts ...ResourceOption) (*JobCredential, error)
public JobCredential(string name, JobCredentialArgs args, CustomResourceOptions? opts = null)
public JobCredential(String name, JobCredentialArgs args)
public JobCredential(String name, JobCredentialArgs args, CustomResourceOptions options)
type: azure-native:sql:JobCredential
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. JobCredentialArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. JobCredentialArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. JobCredentialArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. JobCredentialArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. JobCredentialArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var jobCredentialResource = new AzureNative.Sql.JobCredential("jobCredentialResource", new()
{
    JobAgentName = "string",
    Password = "string",
    ResourceGroupName = "string",
    ServerName = "string",
    Username = "string",
    CredentialName = "string",
});
Copy
example, err := sql.NewJobCredential(ctx, "jobCredentialResource", &sql.JobCredentialArgs{
	JobAgentName:      pulumi.String("string"),
	Password:          pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	ServerName:        pulumi.String("string"),
	Username:          pulumi.String("string"),
	CredentialName:    pulumi.String("string"),
})
Copy
var jobCredentialResource = new JobCredential("jobCredentialResource", JobCredentialArgs.builder()
    .jobAgentName("string")
    .password("string")
    .resourceGroupName("string")
    .serverName("string")
    .username("string")
    .credentialName("string")
    .build());
Copy
job_credential_resource = azure_native.sql.JobCredential("jobCredentialResource",
    job_agent_name="string",
    password="string",
    resource_group_name="string",
    server_name="string",
    username="string",
    credential_name="string")
Copy
const jobCredentialResource = new azure_native.sql.JobCredential("jobCredentialResource", {
    jobAgentName: "string",
    password: "string",
    resourceGroupName: "string",
    serverName: "string",
    username: "string",
    credentialName: "string",
});
Copy
type: azure-native:sql:JobCredential
properties:
    credentialName: string
    jobAgentName: string
    password: string
    resourceGroupName: string
    serverName: string
    username: string
Copy

JobCredential Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The JobCredential resource accepts the following input properties:

JobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
Password This property is required. string
The credential password.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Username This property is required. string
The credential user name.
CredentialName Changes to this property will trigger replacement. string
The name of the credential.
JobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
Password This property is required. string
The credential password.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Username This property is required. string
The credential user name.
CredentialName Changes to this property will trigger replacement. string
The name of the credential.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
String
The name of the job agent.
password This property is required. String
The credential password.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
username This property is required. String
The credential user name.
credentialName Changes to this property will trigger replacement. String
The name of the credential.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
password This property is required. string
The credential password.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
username This property is required. string
The credential user name.
credentialName Changes to this property will trigger replacement. string
The name of the credential.
job_agent_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the job agent.
password This property is required. str
The credential password.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
server_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
username This property is required. str
The credential user name.
credential_name Changes to this property will trigger replacement. str
The name of the credential.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
String
The name of the job agent.
password This property is required. String
The credential password.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
username This property is required. String
The credential user name.
credentialName Changes to this property will trigger replacement. String
The name of the credential.

Outputs

All input properties are implicitly available as output properties. Additionally, the JobCredential resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name.
type string
Resource type.
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name.
type str
Resource type.
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:sql:JobCredential cred1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi