Problems with creating custom categories

敏华 李 0 Reputation points
2025-05-21T10:26:36.4533333+00:00

I'm trying to use the custom categories feature but got stuck at the creation step. It shows this error: "[sampleBlobUrl] only supports jsonl extension. | Request Id: e068e1bf-fb68-48e3-b90f-80f31d47cda5, Timestamp: 2025-05-21T09:43:43Z.". Could anyone tell me how to fill this field correctly? I couldn't find any relevant tutorials. I want to create custom categories for a few images.User's image

Azure AI Content Safety
Azure AI Content Safety
An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-05-22T16:46:55.5333333+00:00

    Hi @敏华 李

    I Understand that you are encountering an issue with custom categories. The error message "sampleBlobUrl] only supports jsonl extension

    means that the Azure AI Content Safety custom categories feature expects the sample data you provide (via the sampleBlobUrl field) to be a file in the JSON Lines (.jsonl) format, not any other file type.

    How to Fill the sampleBlobUrl Field Correctly

    • Prepare your training data as a .jsonl file. Each line in this file should be a separate JSON object representing a sample (for text categories, each sample is a text string and its label).

    Upload this .jsonl file to an Azure Blob Storage container.

    Use the direct URL to this .jsonl file as the value for sampleBlobUrl when creating the custom category.

    Example

    Suppose your Azure Blob Storage container is called training-data and your file is named my-category-samples.jsonl. The URL might look like.

    https://<your-storage-account>.blob.core.windows.net/training-data/my-category-samples.jsonl

    You would use this URL as the value for sampleBlobUrl in your API request or in the portal.

    File Format Details

    The file must have the .jsonl extension.

    Each line should be a valid JSON object.

    • For text categories, a line might look like:
        {"text": "example content", "label": "positive"}
        
        
      

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.