Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Copy API overview
The process for copying an analyzer across regions consists of the following steps:
- First you issue a copy authorization request to the source resource—the resource that contains the model to be copied. You receive back the authorization token.
- Next you send the copy request to the target resource—that is, the resource that receives the copied model, along with the authorization token.
Generate copy authorization request
In this operation, you can optionally specify target to lock the key to a specific target resource. The authorization token expires in 24 hours.
You can also optionally specify encryptionKey to encrypt the authorization token so it can only be used with the corresponding decryptionKey. The authorization token includes the source, optional target, and other metadata.
POST {sourceEndpoint}/contentunderstanding/analyzers/{sourceAnalyzerId}:getCopyAuthorization
Request body
{
"target": "https://{targetEndpoint}/contentunderstanding/analyzers/{targetAnalyzerId}",
"encryptionKey": "{encryptionKey}"
}
You receive a 200 response code with a response body that contains the authorization token.
{
"source": "https://{sourceEndpoint}/contentunderstanding/analyzers/{sourceAnalyzerId}",
"authorizationToken": "{authorizationToken}",
"expiresAt": "{expirationDateTime}",
// "target": "https://{targetEndpoint}/contentunderstanding/analyzers/{targetAnalyzerId}" // If specified, this is optional
}
Start Copy operation
If you used encryptionKey when generating the authorization token, you must specify the corresponding decryptionKey. The target resource needs role-based access control (RBAC) access to the source resource, or you must provide an authorizationToken for the remote source analyzer.
By default, copied analyzers link to model deployments with the same name in the target resource as the source analyzer. You can override deployment names in the :copy request JSON.
If the target resource doesn't contain the named model deployments, the copy fails. The target embedding model must match the source embedding model, or the service returns a 400 error. If the target chatCompletion model is different from the source chatCompletion model, the service returns a warning.
POST {targetEndpoint}/contentunderstanding/analyzers/{targetAnalyzerId}:copy
The body of your request is the response from the previous step.
{
"source": "https://{sourceEndpoint}/contentunderstanding/analyzers/{sourceAnalyzerId}",
"authorizationToken": "{authorizationToken}"
// "decryptionKey": "{decryptionKey}"
// Optionally override model deployment information.
"deployments": {
"chatCompletion": "sourceChatCompletionDeployment"
}
}
You receive a 200 response code with response body that contains the details.
Operation-Location: {targetEndpoint}/contentunderstanding/analyzers/{targetAnalyzerId}/operations/{operationId}?api-version=...
{
"analyzerId": "{targetAnalyzerId}",
"status": "creating",
}
Next steps
In this guide, you learned how to use the Copy API to back up your custom models to a secondary Content Understanding resource. Next, explore the API reference docs to see what else you can do with Content Understanding.