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

[WebPubSub]Add isolated-process extension for WebPubSub #34618

Merged
merged 20 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 1 addition & 0 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<PackageReference Update="Microsoft.AspNetCore.Http" Version="2.1.22" />
<PackageReference Update="Microsoft.AspNetCore.Http.Connections" Version="1.0.15" />
<PackageReference Update="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Update="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />
<PackageReference Update="Microsoft.Extensions.Azure" Version="1.6.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="2.1.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Release History

## 1.4.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Functions.Worker.Extensions.WebPubSub", "src\Microsoft.Azure.Functions.Worker.Extensions.WebPubSub.csproj", "{8FD378FF-7228-4A8D-AB9B-65D60A386E94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8FD378FF-7228-4A8D-AB9B-65D60A386E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FD378FF-7228-4A8D-AB9B-65D60A386E94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FD378FF-7228-4A8D-AB9B-65D60A386E94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FD378FF-7228-4A8D-AB9B-65D60A386E94}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A1FF741-58C3-4C13-A0D5-54902BE0CC44}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Azure Web PubSub extension of isolated-process Azure Functions client library for .NET

This extension defines the function binding types and triggers in Azure Functions for .NET isolated-process, allowing you to easily write functions that respond to any event published to Web PubSub.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

## Getting started

### Install the package

Install the client library from [NuGet](https://www.nuget.org/):

```dotnetcli
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.WebPubSub
```

### Prerequisites

- An [Azure subscription][azure_sub].
- An existing Azure Web PubSub service instance.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

### Authenticate the client
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

Not applicable for the library. You should work with a client library to deserialize service requests in a friendly way.

## Key concepts
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

### Events

Connect, Connected, Disconnected are system events indicate connection stage. And Connect is a blocking event that service will wait for the response to determine next action. Any error returned will drop the connection.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

User events are message event. It's also a blocking event which service is waiting for response. And server can return information in the response which will be sent to the caller directly.

### WebPubSubEventRequest

WebPubSubEventRequest, represents a abstract request come from service side. In detail, it should be ValidationRequest or one of the 4 events, which are ConnectEventRequest, ConnectedEventRequest, UserEventRequest and DisconnectedEventRequest. ValidationRequest represent the request for [Abuse Protection](https://github.com/cloudevents/spec/blob/v1.0.1/http-webhook.md#4-abuse-protection).
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

### WebPubSubEventResponse

WebPubSubEventResponse, represents a abstract response should return to service. In detail, it should be EventErrorResponse or one of the 2 blocking events, which are ConnectEventResponse and UserEventResponse.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

## Examples

Check Microsoft.Azure.WebPubSub.AspNetCore for E2E using examples.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

## Troubleshooting

You can also easily [enable console logging](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md#logging) if you want to dig deeper into the requests you're making against the service.
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

## Next steps
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

Please take a look at the
[samples][samples_ref]
directory for detailed examples on how to use this library.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [email protected] with any additional questions or comments.

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventgrid%2FMicrosoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents%2FREADME.png)
JialinXin marked this conversation as resolved.
Show resolved Hide resolved

[azure_sub]: https://azure.microsoft.com/free/dotnet/
[samples_ref]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Azure.Messaging.WebPubSub/tests/Samples/
JialinXin marked this conversation as resolved.
Show resolved Hide resolved
Loading