Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (42 sloc) 2.72 KB

Schema Registry Sink for Azure Blob Storage

This library provides a sink class to Azure Blob Storage that is used for the schema registry.

NuGet Package Status

Package Download Version


IBlobStorageSchemaSink and BlobStorageSchemaSink

As an extension of ISchemaSink and SchemaSink respectively, both IBlobStorageSchemaSink and BlobStorageSchemaSink declare extra property and methods:

  • Container: Declares the blob container name.
  • WithBlobClient(CloudBlobClient blobClient): Adds the Azure Blob Storage client instance.
  • WithContainer(string container): Adds the blob container name.

It also has two overriding methods, GetSchemaAsync(string path) and SetSchemaAsync(string schema, string path).

NOTE: The path parameter value MAY be fully qualified URL. However, if it is the fully qualified URL path, both methods rip off both base location and container name from it. Make sure that, when the fully qualified URL is used, it MUST contain the same base URL and container name as the sink recognises. Otherwise it will throw an exception.

var connectionString = "UseDevelopmentStorage=true";
var container = "schemas";
var account = CloudStorageAccount.Parse(connectionString);
var blobClient = account.CreateCloudBlobClient();

var sink = new BlobStorageSchemaSink()

var schema = "{" +
             "  \"type\": \"object\"," +
             "  \"properties\": {" +
             "    \"hello\": {" +
             "      \"type\": \"string\"" +
             "    }" +
             "  }" +

var path1 = "v1/schema.json";

var sinked1 = await sink.SetSchemaAsync(schema, path1)

var schema1 = await sink.GetSchemaAsync(path1)

var path2 = "";

var sinked2 = await sink.SetSchemaAsync(schema, path2)

var schema2 = await sink.GetSchemaAsync(path2)
You can’t perform that action at this time.