{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-job-agent-schema.json",
  "title": "JobAgent",
  "description": "An Azure SQL job agent.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-jobagents-api-openapi.yml#/components/schemas/JobAgent",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/JobAgentProperties",
      "description": "Resource properties.",
      "x-ms-client-flatten": true
    },
    "sku": {
      "$ref": "#/$defs/Sku",
      "description": "The name and tier of the SKU."
    },
    "identity": {
      "$ref": "#/$defs/JobAgentIdentity",
      "description": "The identity of the job agent."
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "$defs": {
    "Azure.Core.uuid": {
      "type": "string",
      "format": "uuid",
      "description": "Universally Unique Identifier"
    },
    "JobAgentIdentity": {
      "type": "object",
      "description": "Azure Active Directory identity configuration for a resource.",
      "properties": {
        "tenantId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "The job agent identity tenant id"
        },
        "type": {
          "$ref": "#/$defs/JobAgentIdentityType",
          "description": "The job agent identity type"
        },
        "userAssignedIdentities": {
          "type": "object",
          "description": "The resource ids of the user assigned identities to use",
          "additionalProperties": {
            "$ref": "#/$defs/JobAgentUserAssignedIdentity"
          }
        }
      },
      "required": [
        "type"
      ]
    },
    "JobAgentIdentityType": {
      "type": "string",
      "description": "The job agent identity type",
      "enum": [
        "None",
        "SystemAssigned",
        "UserAssigned",
        "SystemAssignedUserAssigned"
      ],
      "x-ms-enum": {
        "name": "JobAgentIdentityType",
        "modelAsString": true,
        "values": [
          {
            "name": "None",
            "value": "None",
            "description": "None"
          },
          {
            "name": "SystemAssigned",
            "value": "SystemAssigned",
            "description": "SystemAssigned"
          },
          {
            "name": "UserAssigned",
            "value": "UserAssigned",
            "description": "UserAssigned"
          },
          {
            "name": "SystemAssignedUserAssigned",
            "value": "SystemAssignedUserAssigned",
            "description": "SystemAssignedUserAssigned"
          }
        ]
      }
    },
    "JobAgentProperties": {
      "type": "object",
      "description": "Properties of a job agent.",
      "properties": {
        "databaseId": {
          "type": "string",
          "format": "arm-id",
          "description": "Resource ID of the database to store job metadata in.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "state": {
          "$ref": "#/$defs/JobAgentState",
          "description": "The state of the job agent.",
          "readOnly": true
        }
      },
      "required": [
        "databaseId"
      ]
    },
    "JobAgentState": {
      "type": "string",
      "description": "The state of the job agent.",
      "enum": [
        "Creating",
        "Ready",
        "Updating",
        "Deleting",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "JobAgentState",
        "modelAsString": true,
        "values": [
          {
            "name": "Creating",
            "value": "Creating",
            "description": "Creating"
          },
          {
            "name": "Ready",
            "value": "Ready",
            "description": "Ready"
          },
          {
            "name": "Updating",
            "value": "Updating",
            "description": "Updating"
          },
          {
            "name": "Deleting",
            "value": "Deleting",
            "description": "Deleting"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "Disabled"
          }
        ]
      }
    },
    "JobAgentUserAssignedIdentity": {
      "type": "object",
      "description": "Azure Active Directory identity configuration for a resource.",
      "properties": {
        "principalId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "The Azure Active Directory principal id.",
          "readOnly": true
        },
        "clientId": {
          "$ref": "#/$defs/Azure.Core.uuid",
          "description": "The Azure Active Directory client id.",
          "readOnly": true
        }
      }
    },
    "Resource": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "Sku": {
      "type": "object",
      "description": "An ARM Resource SKU.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the SKU, typically, a letter + Number code, e.g. P3."
        },
        "tier": {
          "type": "string",
          "description": "The tier or edition of the particular SKU, e.g. Basic, Premium."
        },
        "size": {
          "type": "string",
          "description": "Size of the particular SKU"
        },
        "family": {
          "type": "string",
          "description": "If the service has different generations of hardware, for the same SKU, then that can be captured here."
        },
        "capacity": {
          "type": "integer",
          "format": "int32",
          "description": "Capacity of the particular SKU."
        }
      },
      "required": [
        "name"
      ]
    },
    "TrackedResource": {
      "type": "object",
      "title": "Tracked Resource",
      "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          },
          "x-ms-mutability": [
            "read",
            "create",
            "update"
          ]
        },
        "location": {
          "type": "string",
          "description": "The geo-location where the resource lives",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "location"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    }
  }
}