Edit

Share via


Create and manage event schemas in schema sets

In this article, you lean how to add a schema to a schema set in Fabric.

Prerequisites

If you don't have an event schema set, create one by following instructions from Create an event schema set.

Add an event schema

  1. If you aren't on the schema set page already, navigate to the Fabric workspace, and select the event schema set.

    Screenshot that shows My Workspace with an event schema set selected.

  2. Select + New event schema.

    If you're trying to add the first schema to the schema set, you see the following screen:

    Screenshot that shows the New event schema button.

    If you're trying to add a schema to a schema set that has at least one schema in it, you see the following screen:

    Screenshot that shows the New event schema button for a schema set with at least one schema.

  3. On the New event schema page, follow these instructions:

    1. Specify a name for the event schema set. The name must contain fewer than 256 UTF-8 characters
    2. Optionally, enter a description for the event schema set.
  4. Use one of the following options to create a schema.

    • If you have a schema JSON file, select Upload to upload the file. For a sample file, see the Sample schema file section.

      Screenshot that shows the upload option to create a schema.

    • Start building a schema manually by selecting Add row. For each row, select the field type, field name, and optionally enter a description.

      Screenshot that shows the manual way of building a schema.

    • To build a schema by entering JSON code, select Code editor option as shown in the following image. If you see the message: If you choose to use the code editor to create your schema, note that you won’t be able to switch back to the UI builder, select Edit.

      Screenshot that shows the code editor to build a schema.

      Enter the JSON code into the editor.

      Screenshot that shows the JSON code in the code editor to build a schema.

  5. Select Finish to start creating the schema.

  6. You see the editor for the event schema set. To add more schemas to the schema set, select + New event schema at the top of the page.

    Screenshot that shows the New event schema button for a schema set after you created the schema.

Download an event schema

You can download a schema file of an existing schema in the schema set to your computer by using the Download button on the ribbon.

Screenshot that shows the Download button on the ribbon in an event schema editor.

Here's a sample file that you can upload to add an event schema to a schema set.

{
    "fields": [
        {
            "name": "ponumber",
            "type": "long",
            "doc": "Purchase order number"
        },
        {
            "name": "podate",
            "type": "string",
            "doc": "Purchase order date"
        },
        {
            "name": "item",
            "type": "string",
            "doc": "The item that was purchased"
        },
        {
            "name": "quantity",
            "type": "int",
            "doc": "Number of items purchased"
        },
        {
            "name": "unitprice",
            "type": "float",
            "doc": "Unit price of the item"
        }
    ],
    "type": "record",
    "name": "ContosoPurchaseOrderSchema"
}

Delete an event schema

To delete an event schema, select the Trash icon next to the event schema in the Event schemas pane.

Screenshot that shows the Trash button next to an event schema in the Event schemas pane.

Find an event schema

To find an event schema, you can enter text in the Search box in the Event schemas pane.

Update an event schema

You can modify schemas after registering them with Fabric Real-Time intelligence.

Note

Fabric doesn't perform compatibility checks when you update a schema, which means any changes you make could break existing pipelines. For example, removing required fields or changing field types might cause errors in pipelines or downstream services expecting the original structure.

Because of this behavior, we recommend that you add a new schema where needed, instead of modifying an existing one. You can then update your pipelines and configurations to use the new schema, test everything, and retire the old version once you confirm that everything works correctly.

  1. To update an event schema and create a new version of the schema, select Update.

    Screenshot that shows the Update button on the ribbon in an event schema editor.

  2. In the Update event schema window, update the schema, and select Finish.

    Screenshot that shows the Update event schema window.

    You notice that a new version of the schema is created in the schema set.

    Screenshot that shows v2 of the schema.

View versions of an event schema

Use the version drop-down list to select the version of the schema you want to view.

Screenshot that shows versions of the schema.

View history of an event schema

You can see the history of creation and update of the schema in the History section of Details pane to the right.

Screenshot that shows History section of the Details pane to the right.

To learn how to use schemas in Fabric eventstreams, see Use schemas in eventstreams.