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.
In this quickstart, you create a schema group with schemas in a schema registry hosted by Azure Event Hubs.
Azure Schema Registry is a feature of Event Hubs. It provides a central repository for schemas for event-driven and messaging-centric applications. It provides the flexibility for your producer and consumer applications to exchange data without having to manage and share the schema. It also provides a simple governance framework for reusable schemas and defines relationship between schemas through a grouping construct (schema groups). For more information, see Azure Schema Registry in Event Hubs.
Note
- The feature isn't available in the Basic tier.
- Make sure that you're a member of one of these roles: Owner, Contributor, or Schema Registry Contributor. For more information, see Azure role-based access control.
- If the event hub is in a virtual network, you can't create schemas in the Azure portal unless you access the portal from a virtual machine in the same virtual network.
Prerequisites
Create an Event Hubs namespace. You can instead use an existing namespace.
Create a schema group
Navigate to the Event Hubs Namespace page.
In the left menu, expand Entities and select Schema Registry.
To create a schema group, select + Schema Group.
On the Create Schema Group page, do these steps:
Enter a name for the schema group.
For Serialization type, select Avro serialization format. This format applies to all schemas in the schema group. JSON serialization format is also supported (preview).
Select a compatibility mode for all schemas in the group. For Avro, forward and backward compatibility modes are supported.
Select Create to create the schema group.
Select the name of the schema group in the list of schema groups.
You see the Schema Group page for the group.
Add a schema to the schema group
In this section, you add a schema to the schema group using the Azure portal.
On the Schema Group page, select + Schema on the toolbar.
On the Create Schema page, do these steps:
For Name, enter
orderschema
.Enter the following schema into the text box. You can instead select a file with the schema.
{ "namespace": "com.azure.schemaregistry.samples", "type": "record", "name": "Order", "fields": [ { "name": "id", "type": "string" }, { "name": "amount", "type": "double" } ] }
Select Create.
Select the schema from the list of schemas.
You see the Schema Overview page for the schema.
If there are multiple versions of a schema, you see them in the Versions. Select a version to switch to that version schema.
Create a new version of schema
Update the schema in the text box, and select Validate. In the following example, you add a new field called
description
to the schema.Review validation status and changes, and select Save.
You see that
2
is selected for the version on the Schema Overview page.Select
1
to see the version 1 of the schema.
Clean up resources
Note
Don't clean up resources if you want to continue to the next quickstart linked from Next step.
- Navigate to the Event Hubs Namespace page.
- Select Schema Registry on the left menu.
- Select the schema group you created in this quickstart.
- On the Schema Group page, select Delete on the toolbar.
- On the Delete Schema Group page, type the name of the schema group, and select Delete.