Azure.Data.SchemaRegistry 1.2.0 The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved

.NET Standard 2.0
Install-Package Azure.Data.SchemaRegistry -Version 1.2.0
dotnet add package Azure.Data.SchemaRegistry --version 1.2.0
<PackageReference Include="Azure.Data.SchemaRegistry" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Azure.Data.SchemaRegistry --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Azure.Data.SchemaRegistry, 1.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Azure.Data.SchemaRegistry as a Cake Addin
#addin nuget:?package=Azure.Data.SchemaRegistry&version=1.2.0

// Install Azure.Data.SchemaRegistry as a Cake Tool
#tool nuget:?package=Azure.Data.SchemaRegistry&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Azure Schema Registry client library for .NET

Azure Schema Registry is a schema repository service hosted by Azure Event Hubs, providing schema storage, versioning, and management. The registry is leveraged by serializers to reduce payload size while describing payload structure with schema identifiers rather than full schemas.

Getting started

Install the package

Install the Azure Schema Registry client library for .NET with NuGet:

dotnet add package Azure.Data.SchemaRegistry


If you need to create an Event Hubs namespace, you can use the Azure Portal or Azure PowerShell.

You can use Azure PowerShell to create the Event Hubs namespace with the following command:

New-AzEventHubNamespace -ResourceGroupName myResourceGroup -NamespaceName namespace_name -Location eastus

Authenticate the client

In order to interact with the Azure Schema Registry service, you'll need to create an instance of the Schema Registry Client class. To create this client, you'll need Azure resource credentials and the Event Hubs namespace hostname.

Get credentials

To acquire authenicated credentials and start interacting with Azure resources, please see the quickstart guide here.

Get Event Hubs namespace hostname

The simpliest way is to use the Azure portal and navigate to your Event Hubs namespace. From the Overview tab, you'll see Host name. Copy the value from this field.

Create SchemaRegistryClient

Once you have the Azure resource credentials and the Event Hubs namespace hostname, you can create the SchemaRegistryClient. You'll also need the Azure.Identity package to create the credential.

// Create a new SchemaRegistry client using the default credential from Azure.Identity using environment variables previously set,
// For more information on Azure.Identity usage, see:
var client = new SchemaRegistryClient(fullyQualifiedNamespace: fullyQualifiedNamespace, credential: new DefaultAzureCredential());

Key concepts


A schema has 6 components:

  • Group Name: The name of the group of schemas in the Schema Registry instance.
  • Schema Name: The name of the schema.
  • Schema ID: The ID assigned by the Schema Registry instance for the schema.
  • Schema Format: The format used for serialization of the schema. For example, Avro.
  • Schema Content: The string representation of the schema.
  • Schema Version: The version assigned to the schema in the Schema Registry instance.

These components play different roles. Some are used as input into the operations and some are outputs. Currently, SchemaProperties only exposes those properties that are potential outputs that are used in SchemaRegistry operations. Those exposed properties are Content and Id.

Thread safety

We guarantee that all client instance methods are thread-safe and independent of each other (guideline). This ensures that the recommendation of reusing client instances is always safe, even across threads.

Additional concepts

Client options | Accessing the response | Long-running operations | Handling failures | Diagnostics | Mocking | Client lifetime


The following shows examples of what is available through the SchemaRegistryClient. There are both sync and async methods available for these client operations.

Register a schema

Register a schema to be stored in the Azure Schema Registry.

string name = "employeeSample";
SchemaFormat format = SchemaFormat.Avro;
// Example schema's definition
string definition = @"
   ""type"" : ""record"",
    ""namespace"" : ""TestSchema"",
    ""name"" : ""Employee"",
    ""fields"" : [
    { ""name"" : ""Name"" , ""type"" : ""string"" },
    { ""name"" : ""Age"", ""type"" : ""int"" }

Response<SchemaProperties> schemaProperties = client.RegisterSchema(groupName, name, definition, format);

Retrieve a schema ID

Retrieve a previously registered schema ID from the Azure Schema Registry.

string name = "employeeSample";
SchemaFormat format = SchemaFormat.Avro;
// Example schema's content
string content = @"
   ""type"" : ""record"",
    ""namespace"" : ""TestSchema"",
    ""name"" : ""Employee"",
    ""fields"" : [
    { ""name"" : ""Name"" , ""type"" : ""string"" },
    { ""name"" : ""Age"", ""type"" : ""int"" }

SchemaProperties schemaProperties = client.GetSchemaProperties(groupName, name, content, format);
string schemaId = schemaProperties.Id;

Retrieve a schema

Retrieve a previously registered schema's content from the Azure Schema Registry.

SchemaRegistrySchema schema = client.GetSchema(schemaId);
string definition = schema.Definition;


Information on troubleshooting steps will be provided as potential issues are discovered.

Next steps

See Azure Schema Registry for additional information.


This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Azure.Data.SchemaRegistry:

Package Downloads
Microsoft.Azure.Data.SchemaRegistry.ApacheAvro The ID prefix of this package has been reserved for one of the owners of this package by

Microsoft Azure Schema Registry Apache Avro SDK


Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Azure.Data.SchemaRegistry:

Repository Stars
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at or our versioned developer docs at
Version Downloads Last updated
1.2.0 11,239 5/11/2022
1.1.0 21,367 1/25/2022
1.0.0 13,957 11/11/2021
1.0.0-beta.4 2,164 10/6/2021
1.0.0-beta.3 1,456 8/17/2021
1.0.0-beta.2 46,855 9/23/2020
1.0.0-beta.1 14,277 9/9/2020