From 2e05dc49bed858a61d29b71bc9dfde3ede4dcaf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Mon, 28 Aug 2023 22:50:02 +0200 Subject: [PATCH] less crashy signalR? --- .../Client/Features/Chat/ChatClientHub.razor | 1 - .../local/signalr1.arm.json | 71 +++++++++++++++++++ src/web/Server/Properties/launchSettings.json | 10 +-- .../Properties/serviceDependencies.json | 5 +- .../Properties/serviceDependencies.local.json | 11 ++- 5 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 src/web/Server/Properties/ServiceDependencies/local/signalr1.arm.json diff --git a/src/web/Client/Features/Chat/ChatClientHub.razor b/src/web/Client/Features/Chat/ChatClientHub.razor index 05c8264e..e99eee26 100644 --- a/src/web/Client/Features/Chat/ChatClientHub.razor +++ b/src/web/Client/Features/Chat/ChatClientHub.razor @@ -1,4 +1,3 @@ -@page "/" @using Microsoft.AspNetCore.SignalR.Client @inject NavigationManager Navigation @implements IAsyncDisposable diff --git a/src/web/Server/Properties/ServiceDependencies/local/signalr1.arm.json b/src/web/Server/Properties/ServiceDependencies/local/signalr1.arm.json new file mode 100644 index 00000000..05327c31 --- /dev/null +++ b/src/web/Server/Properties/ServiceDependencies/local/signalr1.arm.json @@ -0,0 +1,71 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "Jordnaer", + "metadata": { + "_parameterType": "resourceGroup", + "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." + } + }, + "resourceGroupLocation": { + "type": "string", + "defaultValue": "uksouth", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource group. Resource groups could have different location than resources." + } + }, + "resourceLocation": { + "type": "string", + "defaultValue": "[parameters('resourceGroupLocation')]", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." + } + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "name": "[parameters('resourceGroupName')]", + "location": "[parameters('resourceGroupLocation')]", + "apiVersion": "2019-10-01" + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('jordnaer', subscription().subscriptionId)))]", + "resourceGroup": "[parameters('resourceGroupName')]", + "apiVersion": "2019-10-01", + "dependsOn": [ + "[parameters('resourceGroupName')]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "sku": { + "name": "Free_F1", + "tier": "Free", + "size": "F1", + "capacity": 1 + }, + "location": "[parameters('resourceLocation')]", + "name": "jordnaer", + "type": "Microsoft.SignalRService/SignalR", + "apiVersion": "2018-10-01" + } + ] + } + } + } + ], + "metadata": { + "_dependencyType": "signalr.azure" + } +} \ No newline at end of file diff --git a/src/web/Server/Properties/launchSettings.json b/src/web/Server/Properties/launchSettings.json index b31bc8cb..782774df 100644 --- a/src/web/Server/Properties/launchSettings.json +++ b/src/web/Server/Properties/launchSettings.json @@ -6,11 +6,11 @@ "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:7116;http://localhost:5235", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development", - "ConnectionStrings_JordnaerDbContext": "Server=localhost,1433;Database=jordnaer;User ID=sa;Password=6efe173b-3e33-4d6c-8f50-3e5f7cadd54c;Persist Security Info=False;TrustServerCertificate=true;", - "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.Azure.SignalR" - } + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ConnectionStrings_JordnaerDbContext": "Server=localhost,1433;Database=jordnaer;User ID=sa;Password=6efe173b-3e33-4d6c-8f50-3e5f7cadd54c;Persist Security Info=False;TrustServerCertificate=true;", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.Azure.SignalR" + } } } } \ No newline at end of file diff --git a/src/web/Server/Properties/serviceDependencies.json b/src/web/Server/Properties/serviceDependencies.json index 8348389e..57065a89 100644 --- a/src/web/Server/Properties/serviceDependencies.json +++ b/src/web/Server/Properties/serviceDependencies.json @@ -14,9 +14,8 @@ "dynamicId": null }, "signalr1": { - "type": "signalr", - "connectionId": "ConnectionStrings:AzureSignalR", - "dynamicId": null + "type": "signalr", + "connectionId": "ConnectionStrings:AzureSignalR" } } } \ No newline at end of file diff --git a/src/web/Server/Properties/serviceDependencies.local.json b/src/web/Server/Properties/serviceDependencies.local.json index 6ec03536..ba87e079 100644 --- a/src/web/Server/Properties/serviceDependencies.local.json +++ b/src/web/Server/Properties/serviceDependencies.local.json @@ -23,12 +23,11 @@ "dynamicId": null }, "signalr1": { - "serviceConnectorResourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.ServiceLinker/locations/swedencentral/connectors/AzureSignalRConnectionString_4B4C9F2617", - "secretStore": null, - "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.SignalRService/SignalR/jordnaer", - "type": "signalr.azure", - "connectionId": "ConnectionStrings:AzureSignalR", - "dynamicId": null + "serviceConnectorResourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.ServiceLinker/locations/swedencentral/connectors/ConnectionStringsAzureSignalR_33750E4577", + "secretStore": null, + "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.SignalRService/SignalR/jordnaer", + "type": "signalr.azure", + "connectionId": "ConnectionStrings:AzureSignalR" } } } \ No newline at end of file