Share via


Job Agents - Update

Updates a job agent.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}?api-version=2023-08-01

URI Parameters

Name In Required Type Description
jobAgentName
path True

string

The name of the job agent to be updated.

resourceGroupName
path True

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
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Type Description
identity

JobAgentIdentity

Managed identity assigned to job agent

sku

Sku

The name and tier of the SKU.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

JobAgent

Successfully updated the job agent.

202 Accepted

Accepted

Headers

Location: string

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state

  • 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state

  • 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.

  • 400 MissingIdentityType - Please specify the identity type.

  • 400 MultipleIdentitiesOnJobAgent - Please specify only one user managed identity per job agent.

  • 400 InvalidIdentityTenantId - tenantId cannot be specified on a create or update request.

  • 400 InvalidIdentityType - Please specify only "None" or "UserAssigned" identity types.

  • 400 SkuMismatchingNameCapacity - The SKU capacity provided does not match with provided SKU name.

  • 400 ElasticJobAgentEditionUnsupported - The given SLO is not supported for job agent. Please retry with the supported SLO.

  • 400 ElasticJobAgentObjectiveAssignmentInProgress - The SLO assignment for elastic job agent '{0}' is currently in progress. Please retry operation later.

  • 400 ElasticJobAgentEditionUnsupported - The given SLO is not supported for job agent. Please retry with the supported SLO.

  • 400 ElasticJobsNotSupportedOnAutoPauseEnabledDatabase - Auto-pause enabled serverless database is not supported as an Elastic Jobs database because job agent would prevent that database from pausing. You can either disable auto-pause on this serverless database or delete the job agent that is using this database. See here for more details: https://docs.microsoft.com/azure/azure-sql/database/serverless-tier-overview#auto-pausing

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 JobAgentNotFound - Specified job agent does not exist in the specified logical server.

  • 404 PropertyChangeUnsupported - Property cannot be modified.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 409 ServerDisabled - Server is disabled.

  • 409 ElasticJobAgentOperationUnavailable - The operation '{0}' is blocked for Elastic Job Agent '{1}' because {2}

  • 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

Examples

Update a job agent's identity.
Update a job agent's sku.
Update a job agent's tags.

Update a job agent's identity.

Sample request

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {}
    }
  }
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  },
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {
        "clientId": "e09c8507-0000-0000-97e2-18c5beec59dc",
        "principalId": "0c29d9b7-0ae2-4014-96ea-faf8e0cf2bc7"
      }
    }
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview

Update a job agent's sku.

Sample request

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "sku": {
    "name": "JA200"
  }
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  },
  "sku": {
    "name": "JA200",
    "capacity": 200
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview

Update a job agent's tags.

Sample request

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1?api-version=2023-08-01

{
  "tags": {
    "mytag1": "myvalue1"
  }
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1",
  "name": "agent1",
  "type": "Microsoft.Sql/servers/jobAgents",
  "location": "southeastasia",
  "properties": {
    "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
  },
  "tags": {
    "mytag1": "myvalue1"
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/southeastasia/jobAgentOperationResults/00000000-1111-2222-3333-444444444444?api-version=2017-03-01-preview

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

JobAgent

An Azure SQL job agent.

JobAgentIdentity

Azure Active Directory identity configuration for a resource.

JobAgentIdentityType

The job agent identity type

JobAgentState

The state of the job agent.

JobAgentUpdate

An update to an Azure SQL job agent.

JobAgentUserAssignedIdentity

Azure Active Directory identity configuration for a resource.

Sku

An ARM Resource SKU.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

JobAgent

An Azure SQL job agent.

Name Type Description
id

string

Resource ID.

identity

JobAgentIdentity

The identity of the job agent.

location

string

Resource location.

name

string

Resource name.

properties.databaseId

string (arm-id)

Resource ID of the database to store job metadata in.

properties.state

JobAgentState

The state of the job agent.

sku

Sku

The name and tier of the SKU.

tags

object

Resource tags.

type

string

Resource type.

JobAgentIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
tenantId

string (uuid)

The job agent identity tenant id

type

JobAgentIdentityType

The job agent identity type

userAssignedIdentities

<string,  JobAgentUserAssignedIdentity>

The resource ids of the user assigned identities to use

JobAgentIdentityType

The job agent identity type

Value Description
None
SystemAssigned
SystemAssignedUserAssigned
UserAssigned

JobAgentState

The state of the job agent.

Value Description
Creating
Deleting
Disabled
Ready
Updating

JobAgentUpdate

An update to an Azure SQL job agent.

Name Type Description
identity

JobAgentIdentity

Managed identity assigned to job agent

sku

Sku

The name and tier of the SKU.

tags

object

Resource tags.

JobAgentUserAssignedIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
clientId

string (uuid)

The Azure Active Directory client id.

principalId

string (uuid)

The Azure Active Directory principal id.

Sku

An ARM Resource SKU.

Name Type Description
capacity

integer (int32)

Capacity of the particular SKU.

family

string

If the service has different generations of hardware, for the same SKU, then that can be captured here.

name

string

The name of the SKU, typically, a letter + Number code, e.g. P3.

size

string

Size of the particular SKU

tier

string

The tier or edition of the particular SKU, e.g. Basic, Premium.