A developer is adding a setup script to a lightweight extraction application. The script must create a custom analyzer named receiptPlus from the definition in analyzer-definition.json. Company policy allows only generally available (GA) API versions. The script must authenticate by using the Content Understanding subscription key. Each option below is followed by -H "Content-Type: application/json" -d @analyzer-definition.json.
Which command should the script run?
The analyzer reference creates a custom analyzer with a PUT request to the analyzers path, where the analyzer ID is part of the URL and the JSON definition is sent as the body. The GA API version used by the reference is 2025-11-01, whereas 2026-06-01-preview is for preview features. The subscription key is sent in the Ocp-Apim-Subscription-Key header.
- Not correct:
curl -X GET "https://{endpoint}/contentunderstanding/analyzers/receiptPlus?api-version=2025-11-01" -H "Ocp-Apim-Subscription-Key: {key}". The reference creates a custom analyzer by submitting its configuration with a PUT request. A GET request does not submit the analyzer definition, so it does not create the analyzer. - Correct:
curl -X PUT "https://{endpoint}/contentunderstanding/analyzers/receiptPlus?api-version=2025-11-01" -H "Ocp-Apim-Subscription-Key: {key}". This matches the documented way to create a custom analyzer: a PUT to the analyzers path with the analyzer ID, the GA API version 2025-11-01, and the subscription key header. - Not correct:
curl -X PUT "https://{endpoint}/contentunderstanding/analyzers/receiptPlus?api-version=2026-06-01-preview" -H "Ocp-Apim-Subscription-Key: {key}". 2026-06-01-preview is the version that preview features require. The GA API version is 2025-11-01, so this command breaks the policy. - Not correct:
curl -X PUT "https://{endpoint}/contentunderstanding/analyzers/receiptPlus?api-version=2025-11-01" -H "Authorization: Bearer {key}". The documented create command passes the subscription key in the Ocp-Apim-Subscription-Key header, not as a bearer token in the Authorization header.