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.
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": {}
}
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgentWithIdentity.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Identity = new JobAgentIdentity(JobAgentIdentityType.UserAssigned)
{
UserAssignedIdentities =
{
["/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"] = new UserAssignedIdentity()
},
},
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlServerJobAgentData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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"
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgentWithSku.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Sku = new SqlSku("JA200"),
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlServerJobAgentData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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
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"
}
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/UpdateJobAgent.json
// this example is just showing the usage of "JobAgents_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerJobAgentResource created on azure
// for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "group1";
string serverName = "server1";
string jobAgentName = "agent1";
ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName);
SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId);
// invoke the operation
SqlServerJobAgentPatch patch = new SqlServerJobAgentPatch
{
Tags =
{
["mytag1"] = "myvalue1"
},
};
ArmOperation<SqlServerJobAgentResource> lro = await sqlServerJobAgent.UpdateAsync(WaitUntil.Completed, patch);
SqlServerJobAgentResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlServerJobAgentData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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
ErrorAdditionalInfo
Object
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
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
Object
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
JobAgent
Object
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
Object
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
Enumeration
The job agent identity type
Value |
Description |
None
|
|
SystemAssigned
|
|
UserAssigned
|
|
SystemAssignedUserAssigned
|
|
JobAgentState
Enumeration
The state of the job agent.
Value |
Description |
Creating
|
|
Ready
|
|
Updating
|
|
Deleting
|
|
Disabled
|
|
JobAgentUpdate
Object
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
Object
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
Object
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.
|