Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

Commit 426440f

Browse files
authored
Merge pull request #21 from dbarkol/main
Upgrade to .NET Core 6.0
2 parents 9652b73 + dcc64e0 commit 426440f

5 files changed

Lines changed: 39 additions & 89 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: "Source code for a site that displays events from Azure Event Grid
1111

1212
# Azure Event Grid Viewer
1313

14-
This repository contains the source code for a site that displays events from Azure Event Grid in near-real time. It is built on ASP.NET Core 3.1 and leverages SignalR to display incoming messages.
14+
This repository contains the source code for a site that displays events from Azure Event Grid in near-real time. It is built on [ASP.NET Core](https://docs.microsoft.com/aspnet/core) and leverages [SignalR](https://dotnet.microsoft.com/apps/aspnet/signalr) to display incoming messages.
1515

1616
For details about how it was put together, please refer to the [accompanying blog post](https://madeofstrings.com/2018/03/14/azure-event-grid-viewer-with-asp-net-core-and-signalr/).
1717

@@ -42,4 +42,4 @@ For example: `https://{{site-name}}.azurewebsites.net/api/updates`
4242
### 5. References
4343

4444
- [Routing events to a custom endpoint](https://docs.microsoft.com/azure/storage/blobs/storage-blob-event-quickstart?toc=%2fazure%2fevent-grid%2ftoc.json)
45-
- [Receive events to an HTTP endpoint](https://docs.microsoft.com/en-us/azure/event-grid/receive-events)
45+
- [Receive events to an HTTP endpoint](https://docs.microsoft.com/azure/event-grid/receive-events)

azuredeploy.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"resources": [
5555
{
56-
"apiVersion": "2015-08-01",
56+
"apiVersion": "2020-12-01",
5757
"name": "[parameters('hostingPlanName')]",
5858
"type": "Microsoft.Web/serverfarms",
5959
"location": "[parameters('location')]",
@@ -66,7 +66,7 @@
6666
}
6767
},
6868
{
69-
"apiVersion": "2015-08-01",
69+
"apiVersion": "2020-12-01",
7070
"name": "[parameters('siteName')]",
7171
"type": "Microsoft.Web/sites",
7272
"location": "[parameters('location')]",
@@ -76,13 +76,20 @@
7676
"properties": {
7777
"serverFarmId": "[parameters('hostingPlanName')]",
7878
"siteConfig": {
79-
"webSocketsEnabled": true
79+
"webSocketsEnabled": true,
80+
"netFrameworkVersion": "v6.0",
81+
"metadata": [
82+
{
83+
"name": "CURRENT_STACK",
84+
"value": "dotnet"
85+
}
86+
]
8087
},
81-
"httpsOnly":true
88+
"httpsOnly": true
8289
},
8390
"resources": [
8491
{
85-
"apiVersion": "2018-11-01",
92+
"apiVersion": "2020-12-01",
8693
"name": "web",
8794
"type": "sourcecontrols",
8895
"dependsOn": [

viewer/Program.cs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
using Microsoft.AspNetCore;
2-
using Microsoft.AspNetCore.Hosting;
1+
using Microsoft.AspNetCore.Builder;
2+
using viewer.Hubs;
3+
using Microsoft.Extensions.DependencyInjection;
34

4-
namespace viewer
5+
var builder = WebApplication.CreateBuilder(args);
6+
7+
builder.Services.AddRazorPages();
8+
builder.Services.AddControllers();
9+
builder.Services.AddSignalR();
10+
11+
var app = builder.Build();
12+
app.UseHttpsRedirection();
13+
app.UseStaticFiles();
14+
app.UseRouting();
15+
app.UseCookiePolicy();
16+
17+
app.UseEndpoints(endpoints =>
518
{
6-
public class Program
7-
{
8-
public static void Main(string[] args)
9-
{
10-
CreateWebHostBuilder(args).Build().Run();
11-
}
19+
endpoints.MapHub<GridEventsHub>("/hubs/gridevents");
20+
endpoints.MapControllerRoute(
21+
name: "default",
22+
pattern: "{controller=Home}/{action=Index}/{id?}");
23+
});
24+
25+
app.Run();
1226

13-
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
14-
WebHost.CreateDefaultBuilder(args)
15-
.UseStartup<Startup>();
16-
}
17-
}

viewer/Startup.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

viewer/viewer.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.App" />
9-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
8+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
109
</ItemGroup>
1110

1211
</Project>

0 commit comments

Comments
 (0)