Sql Agent - Create Or Update

Puts new sql agent configuration to instance.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current?api-version=2021-11-01

URI Parameters

Name In Required Type Description
managedInstanceName
path True

string

The name of the managed instance.

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.

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
properties.state enum:
  • Enabled
  • Disabled

The state of Sql Agent.

Responses

Name Type Description
200 OK

SqlAgentConfiguration

Successfully put sql agent configuration

Other Status Codes

*** Error Responses: ***

  • 400 SqlAgentManagedServerNotFound - User tried to configure sql agent of unknown managed instance.

Examples

Puts new sql agent configuration to instance.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/sqlAgent/current?api-version=2021-11-01

{
  "properties": {
    "state": "Enabled"
  }
}

Sample response

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/sqlAgent/current",
  "name": "current",
  "type": "Microsoft.Sql/managedInstances/sqlAgent",
  "properties": {
    "state": "Enabled"
  }
}

Definitions

SqlAgentConfiguration

A recoverable managed database resource.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.state enum:
  • Disabled
  • Enabled

The state of Sql Agent.

type

string

Resource type.