Skip to content

Commit f3c8da9

Browse files
authored
[Samples] Centralize messaging samples (Azure#58447)
* [Samples] Centralize messaging samples Event Hubs samples migration: - Moved aspnet-hosted-service from sdk/eventhub/ to samples/eventhubs/ - Deleted sdk/eventhub shared Directory.Build.props and Directory.Build.targets - Updated EH Processor samples README link to new location IoT Hub to Event Hubs sample: - Bumped Microsoft.Azure.Devices 1.40.0 to 1.41.0 - Updated README for .NET 10, VS 2026, and learn.microsoft.com links Service Bus samples migration: - Moved DeadLetterQueue, TopicFilters, and PluginSample from sdk/servicebus/ to samples/servicebus/ (dead-letter-queue, topic-filters, plugin-sample) - Deleted sdk/servicebus shared Directory.Build.props and Directory.Build.targets - Scrubbed SDK repo integration from all csproj files - Created SampleSharedSource bridge project under sdk/servicebus tests to maintain PluginSample as a test dependency while keeping the sample standalone; uses linked source files with repo-provided strong naming Front matter: - Added urlFragment to 5 sample READMEs for Azure Samples Browser indexing * Removing cross-link of samples * Completing partial rename; previous push was incomplete
1 parent 3a1b205 commit f3c8da9

46 files changed

Lines changed: 403 additions & 138 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>false</IsPackable>
44
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
5+
<ImportRepoCommonSettings>false</ImportRepoCommonSettings>
56
</PropertyGroup>
67
<Import Project="..\Directory.Build.props" />
78
<!-- Standalone samples opt out of central package management -->

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/AspNetHostedService.sln renamed to samples/eventhubs/aspnet-hosted-service/AspNetHostedService.sln

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/README.md renamed to samples/eventhubs/aspnet-hosted-service/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ languages:
55
products:
66
- azure
77
- azure-event-hubs
8+
urlFragment: eventhubs-aspnet-hosted-service
89
name: Using the EventProcessorClient with an ASP.NET hosted service
910
description: Using the EventProcessorClient with an ASP.NET hosted service
1011
---
@@ -27,11 +28,9 @@ The [Azure.Messaging.EventHubs.Processor](https://github.com/Azure/azure-sdk-for
2728

2829
- **Azure Storage blob container:** Checkpoint and ownership data in Azure Storage will be written to blobs in a specific container. The `EventProcessorClient` requires an existing container and will not implicitly create one to help guard against accidental misconfiguration. It is recommended that you use a unique container for each Event Hub and consumer group combination. If you are not familiar with Azure Storage containers, you may wish to refer to the documentation on [managing containers](https://learn.microsoft.com/azure/storage/blobs/storage-blob-container-create?tabs=dotnet). There, you can find detailed instructions for using .NET, the Azure CLI, or Azure PowerShell to create a container.
2930

30-
- **C# 8.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`.
31+
- **C# 10.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 10.0. In order to take advantage of the C# 10.0 syntax, it is recommended that you compile using the [.NET SDK](https://dotnet.microsoft.com/download) 10.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`.
3132

32-
Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal.
33-
34-
You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks).
33+
Visual Studio users wishing to take full advantage of the C# 10.0 syntax will need to use Visual Studio 2026 or later. Visual Studio 2026, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com).
3534

3635
To quickly create a basic set of resources in Azure and to receive a connection string for them, you can deploy our sample template by clicking:
3736

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/Azure.Messaging.EventHubs.Processor.Samples.HostedService.csproj renamed to samples/eventhubs/aspnet-hosted-service/src/Azure.Messaging.EventHubs.Processor.Samples.HostedService.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Azure.Messaging.EventHubs.Processor" />
11-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
12-
<PackageReference Include="Microsoft.Extensions.Hosting" />
10+
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.12.2" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3" />
12+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.3" />
1313
</ItemGroup>
1414

1515
</Project>

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/EventProcessorClientService.cs renamed to samples/eventhubs/aspnet-hosted-service/src/EventProcessorClientService.cs

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/ISampleApplicationProcessor.cs renamed to samples/eventhubs/aspnet-hosted-service/src/ISampleApplicationProcessor.cs

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/SampleApplicationProcessor.cs renamed to samples/eventhubs/aspnet-hosted-service/src/SampleApplicationProcessor.cs

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/SampleProgram.cs renamed to samples/eventhubs/aspnet-hosted-service/src/SampleProgram.cs

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/appsettings.Development.json renamed to samples/eventhubs/aspnet-hosted-service/src/appsettings.Development.json

File renamed without changes.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/src/appsettings.json renamed to samples/eventhubs/aspnet-hosted-service/src/appsettings.json

File renamed without changes.

0 commit comments

Comments
 (0)