Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Grid Explorer - Adding Support for Event Grid V2 #737

Merged
merged 27 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f87a0d9
Event Grid Explorer - Adding support for Event Grid V2 in Service Bus…
t-wangamy Aug 16, 2023
cdd396b
Merge branch 'main' of https://github.com/paolosalvatori/ServiceBusEx…
t-wangamy Aug 16, 2023
e8e6791
Event Grid Explorer
t-wangamy Aug 16, 2023
b11b0c1
Event Grid Explorer
t-wangamy Aug 16, 2023
f0ad8fe
Event Grid Explorer
t-wangamy Aug 18, 2023
afe8a98
Wording
SeanFeldman Aug 18, 2023
38d75ec
Event Grid Explorer
t-wangamy Aug 18, 2023
e5b1c2a
Merge branch 'EventGridExplorer' of https://github.com/paolosalvatori…
t-wangamy Aug 18, 2023
7a7c463
Adhare to the license in the repo
SeanFeldman Nov 3, 2023
96e96e1
Fall back to the default API version
SeanFeldman Nov 5, 2023
f174fb4
Change tenantId
ErikMogensen Nov 7, 2023
5a76072
Added api-version commit
ErikMogensen Nov 7, 2023
bbc7b45
Change tenantId when logging in
ErikMogensen Nov 7, 2023
74bc13d
Merge pull request #747 from ErikMogensen/EventGridLogin
paolosalvatori Nov 9, 2023
8207abc
Improve UI event grid explorer (#752)
ErikMogensen Nov 20, 2023
fd86d19
Using Control plane sdk instead of generated files
harrieoriowo May 6, 2024
764e8cb
Finishing up the sdks
harrieoriowo May 16, 2024
2797407
Adding Filter UI
harrieoriowo May 20, 2024
a366114
Allowing multiple filters
harrieoriowo May 21, 2024
b7c3f54
Refining the explorer with proper error handling and the filters acce…
harrieoriowo May 25, 2024
e143794
Merge branch 'main' into EventGridExplorer
harrieoriowo May 25, 2024
1d43822
Resolving comments
harrieoriowo May 29, 2024
f1ed2e4
Merge branch 'EventGridExplorer' of https://github.com/paolosalvatori…
harrieoriowo May 29, 2024
46113e7
Resolving comments
harrieoriowo May 29, 2024
274791e
Removing custom exception and moving logic into filterfactory
harrieoriowo May 30, 2024
b45d3d5
Handling build warnings
harrieoriowo Jun 6, 2024
59b24b9
Build warnings resolved
harrieoriowo Jun 10, 2024
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
43 changes: 43 additions & 0 deletions EventGridExplorer_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Event Grid Explorer - Support for Event Grid V2 in Service Bus Explorer
**Author:** Amy Wang

The Event Grid Explorer provides a tool for viewing and managing Event Grid V2 entities, including namespaces, topics and subscriptions, as well as provide create/delete operations for topics and subscriptions, publish/receive operations for events, and acknowledge/release/reject operations for events.
Currently, the Event Grid Explorer features the functionality that is available for the preview version of Event Grid V2.
This additional support for Event Grid enables users to test event delivery with ease, contributing to the adoption of the new service.

## Connect to Event Grid

Under the File tab, the user can connect to an Event Grid V2 namespace by providing the Resource Group, Namespace Name, Subscription ID, and API Version found in the Azure Portal.

![Connect to EGV2](./media/connect-event-grid.png)

![Connection Info](./media/connect-info-event-grid.png)

## Main View

When the connection is successful, a tree view of the Event Grid V2 namespace with its contained topics and subscriptions is displayed along with properties views.
Right-clicking the Topics and Subscriptions nodes enables the user to create topics/subscriptions and right-clicking the existing topics and subscriptions enables the user to publish/receive events and delete these entities.

![Main View](./media/main-view-event-grid.png)

## Publish

When right-clicking the Publish option on a topic, the user can create and publish an event by entering the event source, type and JSON payload.

![Publish Event to Topic](./media/publish-event-grid.png)

## Receive

When receiving events through a subscription, the user can receive the maximum number of events (100) or a top number of events.
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved
When successful, the data view table is populated with the received events and the event data is displayed in a JSON format.

![Receive Event Popup](./media/receive-popup-event-grid.png)

![Receive Events in Subscription](./media/receive-results-event-grid.png)

## Acknowledge/Release/Reject
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved

On the received events listed in the table, the user can multi-select events to perform the acknowledge/release/reject operations.
SeanFeldman marked this conversation as resolved.
Show resolved Hide resolved
When successful, the event status column is updated with the operation performed.

![Event Action](./media/event-action-event-grid.png)
Binary file added media/connect-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/connect-info-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/event-action-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/main-view-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/publish-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/receive-popup-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/receive-results-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="1.0.9" />
<PackageReference Include="Microsoft.Azure.Relay" Version="2.0.15596" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

<PackageReference Include="WindowsAzure.ServiceBus" Version="6.2.2" />
</ItemGroup>
Expand All @@ -45,6 +45,7 @@
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EventGridExplorerLibrary\EventGridExplorerLibrary.csproj" />
<ProjectReference Include="..\EventHubs\EventHubs.csproj" />
<ProjectReference Include="..\Relay\Relay.csproj" />
<ProjectReference Include="..\ServiceBus\ServiceBus.csproj" />
Expand Down
1 change: 1 addition & 0 deletions src/Common/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static class Constants
{
public const string QueueEntities = "Queues";
public const string TopicEntities = "Topics";
public const string SubscriptionEntities = "Subscriptions";
public const string RelayEntities = "Relays";
public const string EventHubEntities = "Event Hubs";
public const string NotificationHubEntities = "Notification Hubs";
Expand Down
77 changes: 77 additions & 0 deletions src/Common/Helpers/EventGridSubscriptionWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#region Copyright
//=======================================================================================
// Microsoft Azure Customer Advisory Team
//
// This sample is supplemental to the technical guidance published on my personal
// blog at http://blogs.msdn.com/b/paolos/.
//
// Author: Paolo Salvatori
//=======================================================================================
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT
// http://www.apache.org/licenses/LICENSE-2.0
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE.
//=======================================================================================
#endregion

#region Using Directives

using Microsoft.Azure.Management.EventGrid.Models;

#endregion

namespace ServiceBusExplorer.Helpers
{
/// <summary>
/// This class adds a Subscriptions collection to the TopicDescription class
/// </summary>
public class EventGridSubscriptionWrapper
{
#region Public Constructors
/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
public EventGridSubscriptionWrapper()
{
SubscriptionDescription = null;
TopicDescription = null;
Filter = null;
}

/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
/// <param name="subscription">A subscription.</param>
/// <param name="topic">The topic the subscription belongs to.</param>
public EventGridSubscriptionWrapper(Subscription subscription, NamespaceTopic topic)
{
SubscriptionDescription = subscription;
TopicDescription = topic;
}

/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
/// <param name="subscription">A subscription.</param>
/// <param name="topic">The topic the subscription belongs to.</param>
/// <param name="filter">The OData filter.</param>
public EventGridSubscriptionWrapper(Subscription subscription, NamespaceTopic topic, string filter)
{
SubscriptionDescription = subscription;
TopicDescription = topic;
Filter = filter;
}
#endregion

#region Public Properties
public Subscription SubscriptionDescription { get; set; }
public NamespaceTopic TopicDescription { get; set; }
public string Filter { get; set; }
#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved
"format": 1,
"restore": {
"C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorer\\EventGridExplorer.csproj": {}
},
"projects": {
"C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorer\\EventGridExplorer.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorer\\EventGridExplorer.csproj",
"projectName": "EventGridExplorer",
"projectPath": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorer\\EventGridExplorer.csproj",
"packagesPath": "C:\\Users\\t-wangamy\\.nuget\\packages\\",
"outputPath": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorer\\.pkgrefgen\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\ob1\\Azure-EventGrid\\NuGet.Config",
"C:\\Users\\t-wangamy\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"https://msazure.pkgs.visualstudio.com/One/_packaging/Azure-Messaging-Feed/nuget/v3/index.json": {}
},
"frameworks": {
"netcoreapp2.1": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp2.1": {
"targetAlias": "net6.0",
"dependencies": {
"Azure.Identity": {
"target": "Package",
"version": "[1.3.0, )",
"versionOverride": "[1.3.0, )"
},
"Azure.Messaging.EventGrid": {
"target": "Package",
"version": "[4.17.0-beta.1, )",
"versionOverride": "[4.17.0-beta.1, )"
},
"Microsoft.NETCore.App": {
"suppressParent": "All",
"target": "Package",
"version": "[2.1.0, )",
"autoReferenced": true
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.0, )",
"autoReferenced": true
},
"Microsoft.Rest.ClientRuntime": {
"target": "Package",
"version": "[2.3.20, )",
"versionOverride": "[2.3.20, )"
},
"Microsoft.Rest.ClientRuntime.Azure": {
"target": "Package",
"version": "[3.3.19, )",
"versionOverride": "[3.3.19, )"
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[12.0.3, )",
"versionOverride": "[12.0.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\CxCache\\.A\\DotNetSDK.yDqgI4Iq8lDmEdgrULHRCA\\sdk\\6.0.301\\RuntimeIdentifierGraph.json"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\t-wangamy\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.5.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\t-wangamy\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Content Include="$(NuGetPackageRoot)azure.messaging.eventgrid\4.17.0-beta.1\contentFiles\any\netstandard2.0\EventGridClient.xml" Condition="Exists('$(NuGetPackageRoot)azure.messaging.eventgrid\4.17.0-beta.1\contentFiles\any\netstandard2.0\EventGridClient.xml')">
<NuGetPackageId>Azure.Messaging.EventGrid</NuGetPackageId>
<NuGetPackageVersion>4.17.0-beta.1</NuGetPackageVersion>
<NuGetItemType>Content</NuGetItemType>
<Pack>false</Pack>
<Private>False</Private>
<Link>EventGridClient.xml</Link>
</Content>
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.props" Condition="Exists('$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.props')" />
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net461\1.0.0\build\Microsoft.NETFramework.ReferenceAssemblies.net461.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net461\1.0.0\build\Microsoft.NETFramework.ReferenceAssemblies.net461.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.targets')" />
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
t-wangamy marked this conversation as resolved.
Show resolved Hide resolved
"format": 1,
"restore": {
"C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorerLibrary\\EventGridExplorerLibrary.csproj": {}
},
"projects": {
"C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorerLibrary\\EventGridExplorerLibrary.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorerLibrary\\EventGridExplorerLibrary.csproj",
"projectName": "EventGridExplorerLibrary",
"projectPath": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorerLibrary\\EventGridExplorerLibrary.csproj",
"packagesPath": "C:\\Users\\t-wangamy\\.nuget\\packages\\",
"outputPath": "C:\\ob1\\Azure-EventGrid\\src\\prod\\tools\\EventGridExplorerLibrary\\.pkgrefgen\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\ob1\\Azure-EventGrid\\NuGet.Config",
"C:\\Users\\t-wangamy\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"https://msazure.pkgs.visualstudio.com/One/_packaging/Azure-Messaging-Feed/nuget/v3/index.json": {}
},
"frameworks": {
"netstandard2.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"allWarningsAsErrors": true,
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netstandard2.0": {
"targetAlias": "net6.0",
"dependencies": {
"Azure.Identity": {
"target": "Package",
"version": "[1.3.0, )",
"versionOverride": "[1.3.0, )"
},
"Azure.Messaging.EventGrid": {
"target": "Package",
"version": "[4.17.0-beta.1, )",
"versionOverride": "[4.17.0-beta.1, )"
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.0, )",
"autoReferenced": true
},
"Microsoft.Rest.ClientRuntime": {
"target": "Package",
"version": "[2.3.20, )",
"versionOverride": "[2.3.20, )"
},
"Microsoft.Rest.ClientRuntime.Azure": {
"target": "Package",
"version": "[3.3.19, )",
"versionOverride": "[3.3.19, )"
},
"NETStandard.Library": {
"suppressParent": "All",
"target": "Package",
"version": "[2.0.3, )",
"autoReferenced": true
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[12.0.3, )",
"versionOverride": "[12.0.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\CxCache\\.A\\DotNetSDK.yDqgI4Iq8lDmEdgrULHRCA\\sdk\\6.0.301\\RuntimeIdentifierGraph.json"
}
}
}
}
}
Loading