public async Task ChangelogSample() { #region Snippet:ChangeLog_Sample string namespaceName = "myNamespace"; string eventhubName = "myEventhub"; string resourceGroupName = "myResourceGroup"; ArmClient client = new ArmClient(new DefaultAzureCredential()); SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync(); ResourceGroupResource resourceGroup = subscription.GetResourceGroups().Get(resourceGroupName); //create namespace EventHubNamespaceData parameters = new EventHubNamespaceData(AzureLocation.WestUS) { Sku = new EventHubsSku(EventHubsSkuName.Standard) { Tier = EventHubsSkuTier.Standard, } }; parameters.Tags.Add("tag1", "value1"); parameters.Tags.Add("tag2", "value2"); EventHubNamespaceCollection eHNamespaceCollection = resourceGroup.GetEventHubNamespaces(); EventHubNamespaceResource eventHubNamespace = eHNamespaceCollection.CreateOrUpdate(WaitUntil.Completed, namespaceName, parameters).Value; //create eventhub EventHubCollection eventHubCollection = eventHubNamespace.GetEventHubs(); EventHubData eventHubData = new EventHubData() { MessageRetentionInDays = 4, PartitionCount = 4, Status = EntityStatus.Active, CaptureDescription = new CaptureDescription() { Enabled = true, Encoding = EncodingCaptureDescription.Avro, IntervalInSeconds = 120, SizeLimitInBytes = 10485763, Destination = new EventHubDestination() { Name = "EventHubArchive.AzureBlockBlob", BlobContainer = "Container", ArchiveNameFormat = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}", StorageAccountResourceId = subscription.Id.ToString() + "/resourcegroups/v-ajnavtest/providers/Microsoft.Storage/storageAccounts/testingsdkeventhubnew" }, SkipEmptyArchives = true } }; EventHubResource eventHub = eventHubCollection.CreateOrUpdate(WaitUntil.Completed, eventhubName, eventHubData).Value; #endregion }