{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-health/json-schema/azure-health-services-description-schema.json",
  "title": "ServicesDescription",
  "description": "The description of the service.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-health-resource-api-openapi.yml#/components/schemas/ServicesDescription",
  "type": "object",
  "properties": {
    "properties": {
      "x-ms-client-flatten": false,
      "description": "The common properties of a service.",
      "$ref": "#/$defs/ServicesProperties"
    },
    "systemData": {
      "description": "Metadata pertaining to creation and last modification of the resource.",
      "$ref": "#/$defs/systemData"
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ServicesResource"
    }
  ],
  "$defs": {
    "ProvisioningState": {
      "description": "The provisioning state.",
      "enum": [
        "Deleting",
        "Succeeded",
        "Creating",
        "Accepted",
        "Verifying",
        "Updating",
        "Failed",
        "Canceled",
        "Deprovisioned",
        "Moving",
        "Suspended",
        "Warned",
        "SystemMaintenance"
      ],
      "type": "string",
      "readOnly": true,
      "x-ms-enum": {
        "name": "provisioningState",
        "modelAsString": true
      }
    },
    "ServiceAccessPoliciesInfo": {
      "description": "The access policies of the service instance.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceAccessPolicyEntry"
      },
      "x-ms-identifiers": [
        "objectId"
      ]
    },
    "ServiceAccessPolicyEntry": {
      "description": "An access policy entry.",
      "properties": {
        "objectId": {
          "description": "An Azure AD object ID (User or Apps) that is allowed access to the FHIR service.",
          "type": "string",
          "pattern": "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$"
        }
      },
      "required": [
        "objectId"
      ]
    },
    "ServiceAcrConfigurationInfo": {
      "description": "Azure container registry configuration information",
      "type": "object",
      "properties": {
        "loginServers": {
          "type": "array",
          "description": "The list of the ACR login servers.",
          "readOnly": false,
          "items": {
            "type": "string"
          }
        },
        "ociArtifacts": {
          "type": "array",
          "description": "The list of Open Container Initiative (OCI) artifacts.",
          "readOnly": false,
          "items": {
            "$ref": "#/$defs/ServiceOciArtifactEntry"
          },
          "x-ms-identifiers": []
        }
      }
    },
    "ServiceAuthenticationConfigurationInfo": {
      "description": "Authentication configuration information",
      "type": "object",
      "properties": {
        "authority": {
          "type": "string",
          "description": "The authority url for the service",
          "readOnly": false
        },
        "audience": {
          "type": "string",
          "description": "The audience url for the service",
          "readOnly": false
        },
        "smartProxyEnabled": {
          "type": "boolean",
          "description": "If the SMART on FHIR proxy is enabled",
          "readOnly": false
        }
      }
    },
    "ServiceCorsConfigurationHeaderEntry": {
      "description": "A header for CORS.",
      "type": "string"
    },
    "ServiceCorsConfigurationInfo": {
      "description": "The settings for the CORS configuration of the service instance.",
      "type": "object",
      "properties": {
        "origins": {
          "type": "array",
          "description": "The origins to be allowed via CORS.",
          "readOnly": false,
          "items": {
            "$ref": "#/$defs/ServiceCorsConfigurationOriginEntry"
          }
        },
        "headers": {
          "type": "array",
          "description": "The headers to be allowed via CORS.",
          "readOnly": false,
          "items": {
            "$ref": "#/$defs/ServiceCorsConfigurationHeaderEntry"
          }
        },
        "methods": {
          "type": "array",
          "description": "The methods to be allowed via CORS.",
          "readOnly": false,
          "items": {
            "$ref": "#/$defs/ServiceCorsConfigurationMethodEntry"
          }
        },
        "maxAge": {
          "type": "integer",
          "description": "The max age to be allowed via CORS.",
          "readOnly": false,
          "minimum": 0,
          "maximum": 99999
        },
        "allowCredentials": {
          "type": "boolean",
          "description": "If credentials are allowed via CORS.",
          "readOnly": false
        }
      }
    },
    "ServiceCorsConfigurationMethodEntry": {
      "description": "A method for CORS.",
      "type": "string"
    },
    "ServiceCorsConfigurationOriginEntry": {
      "description": "An origin for CORS.",
      "type": "string",
      "pattern": "^(?:(?:(?:[hH][tT][tT][pP](?:[sS]|))\\:\\/\\/(?:[a-zA-Z0-9-]+[.]?)+(?:\\:[0-9]{1,5})?|[*]))$"
    },
    "ServiceCosmosDbConfigurationInfo": {
      "description": "The settings for the Cosmos DB database backing the service.",
      "type": "object",
      "properties": {
        "offerThroughput": {
          "type": "integer",
          "description": "The provisioned throughput for the backing database.",
          "readOnly": false,
          "minimum": 400
        },
        "keyVaultKeyUri": {
          "type": "string",
          "description": "The URI of the customer-managed key for the backing database.",
          "readOnly": false
        },
        "crossTenantCmkApplicationId": {
          "type": "string",
          "pattern": "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$",
          "description": "The multi-tenant application id used to enable CMK access for services in a data sovereign region.",
          "readOnly": false
        }
      }
    },
    "ServiceExportConfigurationInfo": {
      "description": "Export operation configuration information",
      "type": "object",
      "properties": {
        "storageAccountName": {
          "type": "string",
          "description": "The name of the default export storage account.",
          "readOnly": false
        }
      }
    },
    "ServiceImportConfigurationInfo": {
      "description": "Import operation configuration information",
      "type": "object",
      "properties": {
        "integrationDataStore": {
          "type": "string",
          "description": "The name of the default integration storage account.",
          "readOnly": false
        },
        "initialImportMode": {
          "type": "boolean",
          "description": "If the FHIR service is in InitialImportMode.",
          "readOnly": false
        },
        "enabled": {
          "type": "boolean",
          "description": "If the import operation is enabled.",
          "readOnly": false
        }
      }
    },
    "ServiceOciArtifactEntry": {
      "description": "An Open Container Initiative (OCI) artifact.",
      "type": "object",
      "properties": {
        "loginServer": {
          "description": "The Azure Container Registry login server.",
          "type": "string"
        },
        "imageName": {
          "description": "The artifact name.",
          "type": "string"
        },
        "digest": {
          "description": "The artifact digest.",
          "type": "string"
        }
      }
    },
    "ServicesProperties": {
      "description": "The properties of a service instance.",
      "type": "object",
      "properties": {
        "provisioningState": {
          "description": "The provisioning state.",
          "$ref": "#/$defs/ProvisioningState"
        },
        "accessPolicies": {
          "$ref": "#/$defs/ServiceAccessPoliciesInfo",
          "description": "The access policies of the service instance."
        },
        "cosmosDbConfiguration": {
          "$ref": "#/$defs/ServiceCosmosDbConfigurationInfo",
          "description": "The settings for the Cosmos DB database backing the service."
        },
        "authenticationConfiguration": {
          "$ref": "#/$defs/ServiceAuthenticationConfigurationInfo",
          "description": "The authentication configuration for the service instance."
        },
        "corsConfiguration": {
          "$ref": "#/$defs/ServiceCorsConfigurationInfo",
          "description": "The settings for the CORS configuration of the service instance."
        },
        "exportConfiguration": {
          "$ref": "#/$defs/ServiceExportConfigurationInfo",
          "description": "The settings for the export operation of the service instance."
        },
        "privateEndpointConnections": {
          "description": "The list of private endpoint connections that are set up for this resource.",
          "type": "array",
          "items": {
            "$ref": "../../../../../../common-types/resource-management/v1/privatelinks.json#/definitions/PrivateEndpointConnection"
          }
        },
        "publicNetworkAccess": {
          "description": "Control permission for data plane traffic coming from public networks while private endpoint is enabled.",
          "enum": [
            "Enabled",
            "Disabled"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "PublicNetworkAccess",
            "modelAsString": true
          }
        },
        "acrConfiguration": {
          "$ref": "#/$defs/ServiceAcrConfigurationInfo",
          "description": "The azure container registry settings used for convert data operation of the service instance."
        },
        "importConfiguration": {
          "$ref": "#/$defs/ServiceImportConfigurationInfo",
          "description": "The settings for the import operation of the service instance."
        }
      }
    },
    "ServicesResource": {
      "description": "The common properties of a service.",
      "properties": {
        "id": {
          "readOnly": true,
          "type": "string",
          "description": "The resource identifier."
        },
        "name": {
          "readOnly": true,
          "type": "string",
          "description": "The resource name.",
          "pattern": "^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$"
        },
        "type": {
          "readOnly": true,
          "type": "string",
          "description": "The resource type."
        },
        "kind": {
          "readOnly": false,
          "type": "string",
          "description": "The kind of the service.",
          "enum": [
            "fhir",
            "fhir-Stu3",
            "fhir-R4"
          ],
          "x-ms-enum": {
            "name": "kind",
            "modelAsString": false
          }
        },
        "location": {
          "type": "string",
          "description": "The resource location.",
          "x-ms-mutability": [
            "create",
            "read"
          ]
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The resource tags."
        },
        "etag": {
          "description": "An etag associated with the resource, used for optimistic concurrency when editing it.",
          "type": "string"
        },
        "identity": {
          "type": "object",
          "description": "Setting indicating whether the service has a managed identity associated with it.",
          "properties": {
            "principalId": {
              "readOnly": true,
              "type": "string",
              "description": "The principal ID of the resource identity."
            },
            "tenantId": {
              "readOnly": true,
              "type": "string",
              "description": "The tenant ID of the resource."
            },
            "type": {
              "description": "Type of identity being specified, currently SystemAssigned and None are allowed.",
              "type": "string",
              "enum": [
                "SystemAssigned",
                "None"
              ],
              "x-ms-enum": {
                "name": "ManagedServiceIdentityType",
                "modelAsString": true
              }
            }
          }
        }
      },
      "x-ms-azure-resource": true,
      "required": [
        "location",
        "kind"
      ]
    },
    "systemData": {
      "description": "Metadata pertaining to creation and last modification of the resource.",
      "type": "object",
      "readOnly": true,
      "properties": {
        "createdBy": {
          "type": "string",
          "description": "The identity that created the resource."
        },
        "createdByType": {
          "type": "string",
          "description": "The type of identity that created the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource creation (UTC)."
        },
        "lastModifiedBy": {
          "type": "string",
          "description": "The identity that last modified the resource."
        },
        "lastModifiedByType": {
          "type": "string",
          "description": "The type of identity that last modified the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "lastModifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource last modification (UTC)"
        }
      }
    }
  }
}