{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-managed-instance-key-schema.json",
  "title": "ManagedInstanceKey",
  "description": "A managed instance key.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-managedinstancekeys-api-openapi.yml#/components/schemas/ManagedInstanceKey",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/ManagedInstanceKeyProperties",
      "description": "Resource properties.",
      "x-ms-client-flatten": true
    },
    "kind": {
      "type": "string",
      "description": "Kind of encryption protector. This is metadata used for the Azure portal experience.",
      "readOnly": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "$defs": {
    "ManagedInstanceKeyProperties": {
      "type": "object",
      "description": "Properties for a key execution.",
      "properties": {
        "serverKeyType": {
          "$ref": "#/$defs/ServerKeyType",
          "description": "The key type like 'ServiceManaged', 'AzureKeyVault'.",
          "x-ms-mutability": [
            "create"
          ]
        },
        "uri": {
          "type": "string",
          "description": "The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.",
          "x-ms-mutability": [
            "create"
          ]
        },
        "thumbprint": {
          "type": "string",
          "description": "Thumbprint of the key.",
          "readOnly": true
        },
        "creationDate": {
          "type": "string",
          "format": "date-time",
          "description": "The key creation date.",
          "readOnly": true
        },
        "autoRotationEnabled": {
          "type": "boolean",
          "description": "Key auto rotation opt-in flag. Either true or false.",
          "readOnly": true
        }
      },
      "required": [
        "serverKeyType"
      ]
    },
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "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
    },
    "ServerKeyType": {
      "type": "string",
      "description": "The encryption protector type like 'ServiceManaged', 'AzureKeyVault'.",
      "enum": [
        "ServiceManaged",
        "AzureKeyVault"
      ],
      "x-ms-enum": {
        "name": "ServerKeyType",
        "modelAsString": true,
        "values": [
          {
            "name": "ServiceManaged",
            "value": "ServiceManaged",
            "description": "ServiceManaged"
          },
          {
            "name": "AzureKeyVault",
            "value": "AzureKeyVault",
            "description": "AzureKeyVault"
          }
        ]
      }
    }
  }
}