An example of using Azure Signal R service to send data from one endpoint to several other endpoints.
The intent of this repository is to serve as an example of how to set this up in a serverless fashion. If you run into issues setting it up please post an issue on the repo. And if you want to add a PR - all contributions are welcomed.
- Clone the repository
- Go into the [repo-root-folder]/deploy/aad
- Run the following in a bash shell
./create-application.sh -p [prefix] -s [postfix]
where [prefix] is the resource prefix and [postfix] is the resource postfix - After it finishes, record the output as we will need some of the values later
- Next we will create an Azure AD Application registration using the steps below
- Go to the Azure Portal and click on Azure Active Directory
- Inside Azure Active Directory, go into App Registrations
- Find the application registration we just created, will be named something like [prefix]visualassist[postfix]
- Inside the application registration screen select Authentication on the left
- Inside the Authentication tab, click on the button "Add a platform"
- When the new blade shows up, select Mobile and desktop applications
- Inside there, add a custom redirect URI of http://localhost/
- Save that data and it should now show up
- On the left select "Expose and API"
- From that screen, select the "set" button and it should name your application api://[guid] where [guid] is some unique identifier
- From that point, click on the "Add a scope" button
- Inside that window, enter "publish" as the scope name
- Go ahead and fill the required fields with anything you want and then ensure the state is Enabled
- After that click on Add scope
- Navigate into the [repo-root-folder]/deploy/bicep folder
- Run the following shell script in bash
./deploy-azure.sh -p [prefix] -s [postfix] -g [resource-group-name] -l [location] -a [valid-audience]
where the values are in the table below - Navigate into the [repo-root-folder]/deploy/application folder
- Run the following shell script in bash
./deploy-application.sh -p [prefix] -s [postfix]
where [prefix] is the resource prefix and [postfix] is the resource postfix - Double check that all the resources are deployed to Azure, it should be a SignalR Service, Function Application and Application Insights instance
- Open up the [repo-root-folder]/src/ui/VisualAssist.UserInterface.sln solution file
- Once inside there, go into the App.config file
- Change the values to be what you need in your environment description in the table below
Variable | Description | Example |
---|---|---|
prefix | The resource prefix | jw |
postfix | The resource postfix | dev |
resource-group-name | The resource group name for your Azure resources | TestGroup |
location | The location, I used westus2 | westus2 |
valid-audience | The Azure AD application audience, example api://[azure-ad-app-id] | api://89c7d6ac-586a-4dc8-bbc3-1c8952c2f757 |
Variable | Description | Example |
---|---|---|
ClientId | The Azure AD Client ID (or App ID) | 89c7d6ac-586a-4dc8-bbc3-1c8952c2f757 |
Tenant | Your Azure AD Tenant (az account show) | 72f988bf-86f1-41af-91ab-2d7cd011db47 |
Instance | The instance your Azure AD application is in | https://login.microsoftonline.com/ |
Scope | The scope for your application | api://89c7d6ac-586a-4dc8-bbc3-1c8952c2f757/publish |
SignalRNegotiateEndpoint | The URI to your function application | https://jweafadev.azurewebsites.net/api |
FunctionAppUrl | The root URI for your function app | https://jweafadev.azurewebsites.net/ |