Consolidate intro and note, use quick start links
This commit is contained in:
Родитель
719324bed3
Коммит
de8fe2385e
|
@ -1,16 +1,16 @@
|
|||
# Receive events with the Event Processor Host in .NET Standard
|
||||
|
||||
This sample shows how to write a .NET Core console application that receives a set of events from an event hub by using the **Event Processor Host** library. You can run the solution as-is, replacing the strings with your event hub and storage account values. The sample is also [available as a tutorial](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-receive-eph).
|
||||
**Note:** This sample uses the legacy Event Hubs library `Microsoft.Azure.EventHubs.Processor` to write a .NET Core console application that receives a set of events from an Event Hub instance. We strongly encourage you to refer to the [quick start that uses the new library `Azure.Messaging.EventHubs.Processor`](https://docs.microsoft.com/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send#receive-events) instead.
|
||||
|
||||
**Note:** This sample uses the legacy Event Hubs library `Microsoft.Azure.EventHubs`. We strongly encourage you to use the new library `Azure.Messaging.EventHubs`. Here is the corresponding sample using the new library: [link](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md).
|
||||
You can run the solution as-is, replacing the strings with your event hub and storage account values.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Microsoft Visual Studio 2015 or 2017](http://www.visualstudio.com).
|
||||
* [.NET Core Visual Studio 2015 or 2017 tools](http://www.microsoft.com/net/core).
|
||||
* An Azure subscription.
|
||||
* [An event hub namespace and an event hub](event-hubs-quickstart-namespace-portal.md).
|
||||
* An Azure Storage account.
|
||||
- [Microsoft Visual Studio 2015 or 2017](http://www.visualstudio.com).
|
||||
- [.NET Core Visual Studio 2015 or 2017 tools](http://www.microsoft.com/net/core).
|
||||
- An [Azure subscription](https://azure.microsoft.com/free/).
|
||||
- [An event hub namespace and an event hub](event-hubs-quickstart-namespace-portal.md).
|
||||
- An Azure Storage account.
|
||||
|
||||
## Run the sample
|
||||
|
||||
|
@ -22,17 +22,19 @@ To run the sample, follow these steps:
|
|||
4. Load the SampleEphReceiver.sln solution file into Visual Studio.
|
||||
5. Add the [Microsoft.Azure.EventHubs](https://www.nuget.org/packages/Microsoft.Azure.EventHubs/) and [Microsoft.Azure.EventHubs.Processor](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.Processor/) NuGet packages to the project.
|
||||
6. In Program.cs, replace the following constants with the corresponding values for the event hub connection string, event hub name:
|
||||
```csharp
|
||||
private const string EventHubConnectionString = "Event Hubs connection string";
|
||||
private const string EventHubName = "Event Hub name";
|
||||
```
|
||||
7. Create a Storage account to host a blob container, needed for lease management by the Event Processor Host.
|
||||
```csharp
|
||||
private const string EventHubConnectionString = "Event Hubs connection string";
|
||||
private const string EventHubName = "Event Hub name";
|
||||
```
|
||||
7. Create a Storage account to host a blob container, needed for lease management by the Event Processor Host.
|
||||
8. In Program.cs, replace the storage account container name, storage account name, and storage account key (the container will be created if not present):
|
||||
|
||||
```
|
||||
private const string StorageContainerName = "Storage account container name";
|
||||
private const string StorageAccountName = "Storage account name";
|
||||
private const string StorageAccountKey = "Storage account key";
|
||||
```
|
||||
|
||||
9. Run the program, and ensure that there are no errors.
|
||||
|
||||
Congratulations! You have now received events from an event hub by using the Event Processor Host. To send events, see the [SampleSender](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/Microsoft.Azure.EventHubs/SampleSender) sample.
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Send events to Azure Event Hubs in .NET Standard
|
||||
|
||||
This sample shows how to write a .NET Core console application that sends a set of events to an Event Hub. You can run the solution as-is, replacing the `EhConnectionString` and `EhEntityPath` strings with your Event Hub values. The sample is also [available as a tutorial](https://docs.microsoft.com/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send).
|
||||
|
||||
**Note:** This sample uses the legacy Event Hubs library `Microsoft.Azure.EventHubs`. We strongly encourage you to use the current library `Azure.Messaging.EventHubs`. See the [corresponding sample](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md) that uses the current library.
|
||||
**Note:** This sample uses the legacy Event Hubs library `Microsoft.Azure.EventHubs.Processor` to write a .NET Core console application that sends a set of events to an Event Hub instance. We strongly encourage you to refer to the [quick start that uses the new library `Azure.Messaging.EventHubs`](https://docs.microsoft.com/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send#send-events) instead.
|
||||
|
||||
You can run the solution as-is, replacing the strings with your Event Hub instance details like connection string and name.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Microsoft Visual Studio 2015 or 2017](http://www.visualstudio.com).
|
||||
* [.NET Core SDK](http://www.microsoft.com/net/core).
|
||||
* An Azure subscription.
|
||||
* [An Event Hub namespace and an Event Hub](event-hubs-quickstart-namespace-portal.md).
|
||||
- [Microsoft Visual Studio 2015 or 2017](http://www.visualstudio.com).
|
||||
- [.NET Core SDK](http://www.microsoft.com/net/core).
|
||||
- An [Azure subscription](https://azure.microsoft.com/free/).
|
||||
- [An Event Hub namespace and an Event Hub](event-hubs-quickstart-namespace-portal.md).
|
||||
|
||||
## Run the sample
|
||||
|
||||
|
@ -22,11 +21,10 @@ To run the sample, follow these steps:
|
|||
4. Load the SampleSender.sln solution file into Visual Studio.
|
||||
5. Add the [Microsoft.Azure.EventHubs](https://www.nuget.org/packages/Microsoft.Azure.EventHubs/) NuGet package to the project.
|
||||
6. In Program.cs, replace the placeholders in brackets with the proper values that were obtained when creating the Event Hub. Make sure that the `Event Hubs connection string` is the namespace-level connection string, and not the Event Hub string:
|
||||
```csharp
|
||||
private const string EhConnectionString = "Event Hubs connection string";
|
||||
private const string EhEntityPath = "Event Hub name";
|
||||
```
|
||||
```csharp
|
||||
private const string EhConnectionString = "Event Hubs connection string";
|
||||
private const string EhEntityPath = "Event Hub name";
|
||||
```
|
||||
7. Run the program, and ensure that there are no errors.
|
||||
|
||||
Congratulations! You have now sent events to an Event Hub. To receive these events, see the [SampleEphReceiver](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/Microsoft.Azure.EventHubs/SampleEphReceiver) sample.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче