You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-grid/event-grid-dotnet-get-started-pull-delivery.md
+54-32Lines changed: 54 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.custom:
8
8
- references_regions
9
9
- devx-track-dotnet
10
10
- ignite-2023
11
-
ms.date: 11/15/2023
11
+
ms.date: 06/19/2024
12
12
---
13
13
14
14
@@ -31,7 +31,7 @@ In this quickstart, you do the following steps:
31
31
If you're new to the service, see [Event Grid overview](overview.md) before you do this quickstart.
32
32
33
33
-**Azure subscription**. To use Azure services, including Azure Event Grid, you need a subscription. If you don't have an existing Azure account, you can sign up for a [free trial](https://azure.microsoft.com/free/dotnet).
34
-
-**Visual Studio 2022**. The sample application makes use of new features that were introduced in C# 10. To use the latest syntax, we recommend that you install .NET 6.0, or higher and set the language version to `latest`. If you're using Visual Studio, versions before Visual Studio 2022 aren't compatible with the tools needed to build C# 10 projects.
34
+
-**Visual Studio 2022**. The sample application makes use of new features that were introduced in C# 10. To use the latest syntax, we recommend that you install .NET 6.0, or higher and set the language version to `latest`. If you're using Visual Studio, versions before Visual Studio 2022 aren't compatible with the tools needed to build C# 10 projects.
@@ -82,31 +80,36 @@ This section shows you how to create a .NET console application to send messages
82
80
1. Replace the contents of `Program.cs` with the following code. The important steps are outlined, with additional information in the code comments.
83
81
84
82
> [!IMPORTANT]
85
-
> Update placeholder values (`<ENDPOINT>` , `<TOPIC-NAME>`, `<TOPIC-ACCESS-KEY>`, `<TOPIC-SUBSCRIPTION-NAME>`) in the code snippet with your topic endpoint, topic name, topic key, topic's subscription name.
83
+
> Update placeholder values (`<NAMESPACE-ENDPOINT>` , `<TOPIC-NAME>`, `<TOPIC-ACCESS-KEY>`, `<TOPIC-SUBSCRIPTION-NAME>`) in the code snippet with your namespace endpoint, topic name, and topic key.
86
84
87
85
```csharp
88
86
using Azure.Messaging;
89
87
using Azure;
90
-
using Azure.Messaging.EventGrid.Namespaces;
88
+
using Azure.Messaging.EventGrid.Namespaces;
91
89
92
-
// TODO: Replace the <ENDPOINT> , <TOPIC-KEY> and <TOPIC-NAME> placeholder
93
90
94
-
var topicEndpoint = "<TOPIC-ENDPOINT>"; // Should be in the form: https://namespace01.eastus-1.eventgrid.azure.net.
95
-
var topicKey = "<TOPIC-ACCESS-KEY>";
91
+
// TODO: Replace the following placeholders with appropriate values
92
+
93
+
// Endpoint of the namespace that you can find on the Overview page for your Event Grid namespace. Prefix it with https://.
94
+
// Should be in the form: https://namespace01.eastus-1.eventgrid.azure.net.
95
+
var namespaceEndpoint = "<NAMESPACE-ENDPOINT>";
96
+
97
+
// Name of the topic in the namespace
96
98
var topicName = "<TOPIC-NAME>";
97
-
var subscription = "<TOPIC-SUBSCRIPTION-NAME>";
98
-
99
+
100
+
// Access key for the topic
101
+
var topicKey = "<TOPIC-ACCESS-KEY>";
102
+
99
103
// Construct the client using an Endpoint for a namespace as well as the access key
100
-
var client = new EventGridClient(new Uri(topicEndpoint), new AzureKeyCredential(topicKey));
104
+
var client = new EventGridSenderClient(new Uri(namespaceEndpoint), topicName, new AzureKeyCredential(topicKey));
101
105
102
106
// Publish a single CloudEvent using a custom TestModel for the event data.
103
107
var @ev = new CloudEvent("employee_source", "type", new TestModel { Name = "Bob", Age = 18 });
new CloudEvent("employee_source", "type", new TestModel { Name = "Tom", Age = 55 }),
112
115
new CloudEvent("employee_source", "type", new TestModel { Name = "Alice", Age = 25 })});
@@ -118,7 +121,7 @@ This section shows you how to create a .NET console application to send messages
118
121
{
119
122
public string Name { get; set; }
120
123
public int Age { get; set; }
121
-
}
124
+
}
122
125
123
126
```
124
127
2. Build the project, and ensure that there are no errors.
@@ -156,7 +159,7 @@ In this section, you create a .NET console application that receives messages fr
156
159
1. Run the following command to install the **Azure.Messaging.EventGrid** NuGet package. Select **EventReceiver** for the **Default project** if it's not already set.
Console.WriteLine($"Failed count for Reject: {rejectResult.FailedLockTokens.Count}");
@@ -299,7 +315,13 @@ In this section, you add code to retrieve messages from the queue.
299
315
public string Name { get; set; }
300
316
public int Age { get; set; }
301
317
}
318
+
302
319
```
320
+
1. In the **Solution Explorer** window, right-click **EventReceiver** project, and select **Set as Startup project**.
321
+
1. Build the project, and ensure that there are no errors.
322
+
1. Run the **EventReceiver** application and confirmation you see the three events in the output window.
323
+
324
+
:::image type="content" source="./media/event-grid-dotnet-get-started-events/receive-output.png" alt-text="Screenshot showing the output from the Receiver app." lightbox="./media/event-grid-dotnet-get-started-events/receive-output.png":::
Copy file name to clipboardExpand all lines: articles/event-grid/includes/event-grid-create-event-subscriptions-portal.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,31 @@
1
1
---
2
-
title: include file
3
-
description: include file
2
+
title: Create a subscription to an Event Grid namespace topic
3
+
description: Include file with steps to create a subscription to an Azure Event Grid namespace topic.
4
4
services: event-grid
5
5
author: sonalika-roy
6
6
ms.service: event-grid
7
7
ms.topic: include
8
-
ms.date: 05/30/20223
8
+
ms.date: 06/19/2024
9
9
ms.author: sonalikaroy
10
10
ms.custom: include file
11
11
---
12
12
13
13
## Create an event subscription
14
14
15
15
1. If you are on the **Topics** page of your Event Grid namespace in the Azure portal, select your topic from the list of topics. If you are on the **Topics** page, follow instructions from [create, view, and manage a namespace topics](../create-view-manage-namespace-topics.md) to identify the topic you want to use to create the event subscription.
16
-
2. On the **Event Gird Namespace Topic** page, select **Subscriptions** option in the **Entities** section on the left menu.
17
-
3. On the **Subscriptions** page, select "**+ Subscription**" button on the command bar.
5. In the **Filters** tab, add the names of the event types you want to filter in the subscription and add context attribute filters you want to use in the subscription. Then, select **Next: Additional features** at the bottom of the page.
Copy file name to clipboardExpand all lines: articles/event-grid/includes/event-grid-create-namespace-topic-portal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
13
13
## Create a namespace topic
14
14
15
-
1. If you are not on the Event Grid Namespace page, follow the [create, view and manage namespaces](../create-view-manage-namespaces.md) steps to view the namespace you want to use to create the topic.
15
+
1. If you aren't on the Event Grid Namespace page, follow the [create, view, and manage namespaces](../create-view-manage-namespaces.md) steps to view the namespace you want to use to create the topic.
16
16
2. On the **Event Grid Namespace** page, select **Topics** option in the **Eventing** section on the left menu.
17
17
3. On the **Topics** page, select **+ Topic** button on the command bar.
0 commit comments