Courseiva

AI-102 Cognitive Services Activity (Data Factory) Practice Question

Exhibit

{
  "pipeline": {
    "name": "text-analytics-pipeline",
    "activities": [
      {
        "name": "AnalyzeSentiment",
        "type": "CognitiveService",
        "inputs": [{"name": "textColumn", "value": "@activity('GetData').output.text"}],
        "outputs": [{"name": "sentimentResult", "value": ""}],
        "linkedServiceName": "AzureAILanguageService"
      }
    ]
  }
}

Refer to the exhibit. You are designing a Data Factory pipeline to perform sentiment analysis on a text column. The pipeline fails with a 'BadRequest' error. What is the most likely issue?

⚠ Common exam trap

Candidates often suspect configuration errors like linked service names or activity types, but the most common cause of BadRequest is an incorrect input format for the Cognitive Services activity.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The input format is incorrect; it should be a JSON array of documents

The Cognitive Services activity in Azure Data Factory that performs sentiment analysis expects input in the form of a JSON array of documents, each containing an 'id' and 'text' field. A 'BadRequest' error typically indicates that the input format is incorrect, such as passing a single string or an improperly structured object instead of the required array. The other options are less likely because the error is specifically related to the request payload format.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The output variable 'sentimentResult' is not defined

    Why it's wrong here

    An undefined output variable surfaces as an expression or activity evaluation error naming the variable, not BadRequest, which the Azure AI services activity returns for invalid request payloads such as malformed input or exceeded limits. It is tempting because variable definition errors are common in pipelines, and defining the variable would be correct when the error cites it.

  • ✗

    The activity type should be 'AzureFunction'

    Why it's wrong here

    Sentiment analysis is a Cognitive Services skill invoked through the Azure AI Language linked service, not an Azure Function activity, which runs custom code rather than the built-in text analytics endpoint. AzureFunction suits bespoke scoring logic the pipeline must execute itself, where no prebuilt cognitive skill exists.

  • ✓

    The input format is incorrect; it should be a JSON array of documents

    Why this is correct

    The Azure AI Language sentiment endpoint expects a request body shaped as a JSON array of document objects, each with an id, text and language. A BadRequest arises when the pipeline sends a flat string or malformed payload, so restructuring the input as that array satisfies the API's schema constraint.

  • ✗

    The linked service name is misspelled

    Why it's wrong here

    A misspelled linked service name produces a linked service not found or authorisation error, not BadRequest, because the pipeline cannot resolve the connection before the service call. It is tempting because linked service misconfiguration is a common Data Factory failure, and correcting the name would be the fix when the error names the missing linked service.

About these practice questions

One of 761 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.