-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add realtime notification feature (#431)
* feat: add realtime feature * fix(realtime): update RealtimeService * chore: minor changes (#2) * chore: add azd support (wip) --------- Co-authored-by: Wassim Chegham <github@wassim.dev>
- Loading branch information
1 parent
bd03a2b
commit beb7633
Showing
25 changed files
with
1,702 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
param serviceName string = 'notifications' | ||
|
||
param applicationInsightsName string | ||
param notificationsServiceName string | ||
param containerAppsEnvironmentName string | ||
param containerRegistryName string | ||
param notificationsImageName string = '' | ||
param keyVaultName string | ||
|
||
var targetPort = 4300 | ||
|
||
module app '../core/host/container-app.bicep' = { | ||
name: '${serviceName}-container-app-module' | ||
params: { | ||
name: name | ||
location: location | ||
tags: union(tags, { 'azd-service-name': '${serviceName}-container-app' }) | ||
containerAppsEnvironmentName: containerAppsEnvironmentName | ||
containerRegistryName: containerRegistryName | ||
containerCpuCoreCount: '1.0' | ||
containerMemory: '2.0Gi' | ||
secrets: [ | ||
{ | ||
name: 'appinsights-cs' | ||
value: applicationInsights.properties.ConnectionString | ||
} | ||
{ | ||
name: 'webpubsub-cs' | ||
value: awps.listKeys().primaryConnectionString | ||
} | ||
] | ||
env: [ | ||
{ | ||
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' | ||
secretRef: 'appinsights-cs' | ||
} | ||
{ | ||
name: 'SERVICE_WEB_PUBSUB_CONNECTION_STRING' | ||
secretRef: 'webpubsub-cs' | ||
} | ||
{ | ||
name: 'SERVICE_WEB_PUBSUB_PORT' | ||
value: '${targetPort}' | ||
} | ||
] | ||
imageName: !empty(notificationsImageName) ? notificationsImageName : 'nginx:latest' | ||
keyVaultName: keyVault.name | ||
targetPort: targetPort | ||
} | ||
} | ||
|
||
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { | ||
name: applicationInsightsName | ||
} | ||
|
||
resource awps 'Microsoft.SignalRService/webPubSub@2023-02-01' existing = { | ||
name: notificationsServiceName | ||
} | ||
|
||
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { | ||
name: keyVaultName | ||
} | ||
|
||
output SERVICE_WEBPUBSUB_URI string = app.outputs.uri | ||
output SERVICE_NOTIFICATIONS_IMAGE_NAME string = app.outputs.imageName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
param serviceName string = 'notifications' | ||
|
||
module notifications '../core/pubsub/web-pub-sub.bicep' = { | ||
name: '${serviceName}-awps-module' | ||
params: { | ||
name: name | ||
location: location | ||
tags: union(tags, { 'azd-service-name': '${serviceName}-awps' }) | ||
sku: 'Free_F1' | ||
} | ||
} | ||
|
||
output SERVICE_WEBPUBSUB_NAME string = notifications.outputs.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@description('The name for your new Web PubSub instance.') | ||
@maxLength(63) | ||
@minLength(3) | ||
param name string = uniqueString(resourceGroup().id) | ||
|
||
param tags object = {} | ||
|
||
@description('The region in which to create the new instance, defaults to the same location as the resource group.') | ||
param location string = resourceGroup().location | ||
|
||
@description('Unit count') | ||
@allowed([ | ||
1 | ||
2 | ||
5 | ||
10 | ||
20 | ||
50 | ||
100 | ||
]) | ||
param unitCount int = 1 | ||
|
||
@description('SKU name') | ||
@allowed([ | ||
'Standard_S1' | ||
'Free_F1' | ||
]) | ||
param sku string = 'Free_F1' | ||
|
||
@description('Pricing tier') | ||
@allowed([ | ||
'Free' | ||
'Standard' | ||
]) | ||
param pricingTier string = 'Free' | ||
|
||
// Resource definition | ||
resource webpubsub 'Microsoft.SignalRService/webPubSub@2023-02-01' = { | ||
name: name | ||
location: location | ||
tags: union(tags, { 'azd-service-name': name }) | ||
sku: { | ||
capacity: unitCount | ||
name: sku | ||
tier: pricingTier | ||
} | ||
identity: { | ||
type: 'None' | ||
} | ||
properties: { | ||
disableAadAuth: false | ||
disableLocalAuth: false | ||
liveTraceConfiguration: { | ||
categories: [ | ||
{ | ||
enabled: 'false' | ||
name: 'ConnectivityLogs' | ||
} | ||
{ | ||
enabled: 'false' | ||
name: 'MessagingLogs' | ||
} | ||
] | ||
enabled: 'false' | ||
} | ||
networkACLs: { | ||
defaultAction: 'Deny' | ||
publicNetwork: { | ||
allow: [ | ||
'ServerConnection' | ||
'ClientConnection' | ||
'RESTAPI' | ||
'Trace' | ||
] | ||
} | ||
} | ||
publicNetworkAccess: 'Enabled' | ||
resourceLogConfiguration: { | ||
categories: [ | ||
{ | ||
enabled: 'true' | ||
name: 'ConnectivityLogs' | ||
} | ||
{ | ||
enabled: 'true' | ||
name: 'MessagingLogs' | ||
} | ||
] | ||
} | ||
tls: { | ||
clientCertEnabled: false | ||
} | ||
} | ||
} | ||
|
||
output name string = webpubsub.name | ||
output uri string = 'https://${webpubsub.properties.hostName}' | ||
output id string = webpubsub.id |
Oops, something went wrong.