Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The simpliest way is to use the [Azure portal][azure_portal] and navigate to you

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

```C# Snippet:CreateSchemaRegistryClient
```C# Snippet:SchemaRegistryCreateSchemaRegistryClient
string endpoint = "<event_hubs_namespace_hostname>";
var credentials = new ClientSecretCredential(
"<tenant_id>",
Expand Down Expand Up @@ -77,7 +77,7 @@ The following shows examples of what is available through the SchemaRegistryClie

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

```C# Snippet:RegisterSchema
```C# Snippet:SchemaRegistryRegisterSchema
string schemaName = "<schema_name>";
string groupName = "<schema_group_name>";
SerializationType schemaType = SerializationType.Avro;
Expand All @@ -100,7 +100,7 @@ Response<SchemaProperties> schemaProperties = client.RegisterSchema(groupName, s

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

```C# Snippet:RetrieveSchemaId
```C# Snippet:SchemaRegistryRetrieveSchemaId
string schemaName = "<schema_name>";
string groupName = "<schema_group_name>";
SerializationType schemaType = SerializationType.Avro;
Expand All @@ -124,7 +124,7 @@ string schemaId = schemaProperties.Value.Id;

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

```C# Snippet:RetrieveSchema
```C# Snippet:SchemaRegistryRetrieveSchema
string schemaId = "<schema_id>";

Response<SchemaProperties> schemaProperties = client.GetSchema(schemaId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Sample01_ReadmeSnippets : SamplesBase<SchemaRegistryClientTestEnvir
[Test]
public void CreateSchemaRegistryClient()
{
#region Snippet:CreateSchemaRegistryClient
#region Snippet:SchemaRegistryCreateSchemaRegistryClient
string endpoint = "<event_hubs_namespace_hostname>";
var credentials = new ClientSecretCredential(
"<tenant_id>",
Expand All @@ -30,7 +30,7 @@ public void RegisterSchema()
{
var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential);

#region Snippet:RegisterSchema
#region Snippet:SchemaRegistryRegisterSchema
string schemaName = "<schema_name>";
string groupName = "<schema_group_name>";
SerializationType schemaType = SerializationType.Avro;
Expand All @@ -56,7 +56,7 @@ public void RetrieveSchemaId()
{
var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential);

#region Snippet:RetrieveSchemaId
#region Snippet:SchemaRegistryRetrieveSchemaId
string schemaName = "<schema_name>";
string groupName = "<schema_group_name>";
SerializationType schemaType = SerializationType.Avro;
Expand All @@ -83,7 +83,7 @@ public void RetrieveSchema()
{
var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential);

#region Snippet:RetrieveSchema
#region Snippet:SchemaRegistryRetrieveSchema
string schemaId = "<schema_id>";

Response<SchemaProperties> schemaProperties = client.GetSchema(schemaId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The simpliest way is to use the [Azure portal][azure_portal] and navigate to you

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

```C# Snippet:CreateSchemaRegistryClient2
```C# Snippet:SchemaRegistryAvroCreateSchemaRegistryClient
string endpoint = "<event_hubs_namespace_hostname>";
var credentials = new ClientSecretCredential(
"<tenant_id>",
Expand Down Expand Up @@ -92,7 +92,7 @@ Details on generating a class using the Apache Avro library can be found in the

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

```C# Snippet:Serialize
```C# Snippet:SchemaRegistryAvroSerialize
var employee = new Employee { Age = 42, Name = "John Doe" };
string groupName = "<schema_group_name>";

Expand All @@ -105,7 +105,7 @@ serializer.Serialize(memoryStream, employee, typeof(Employee), CancellationToken

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

```C# Snippet:Deserialize
```C# Snippet:SchemaRegistryAvroDeserialize
string groupName = "<schema_group_name>";

var serializer = new SchemaRegistryAvroObjectSerializer(client, groupName, new SchemaRegistryAvroObjectSerializerOptions { AutoRegisterSchemas = true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Sample01_ReadmeSnippets : SamplesBase<SchemaRegistryClientTestEnvir
[Test]
public void CreateSchemaRegistryClient()
{
#region Snippet:CreateSchemaRegistryClient2
#region Snippet:SchemaRegistryAvroCreateSchemaRegistryClient
string endpoint = "<event_hubs_namespace_hostname>";
var credentials = new ClientSecretCredential(
"<tenant_id>",
Expand All @@ -34,7 +34,7 @@ public void Serialize()
{
var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential);

#region Snippet:Serialize
#region Snippet:SchemaRegistryAvroSerialize
var employee = new Employee { Age = 42, Name = "John Doe" };
string groupName = "<schema_group_name>";

Expand All @@ -51,7 +51,7 @@ public void Deserialize()
var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential);
using var memoryStream = new MemoryStream();

#region Snippet:Deserialize
#region Snippet:SchemaRegistryAvroDeserialize
string groupName = "<schema_group_name>";

var serializer = new SchemaRegistryAvroObjectSerializer(client, groupName, new SchemaRegistryAvroObjectSerializerOptions { AutoRegisterSchemas = true });
Expand Down