To lean more about Excel Custom Functions see Custom Functions Overview
For this Sample we'll use Azure SignalR Service in the serverless mode
- Create an Azure SignalR Service instance
- Go to the Azure Signal Service Resouce that you just created in the portal and click
Settings
- Change the
Service Mode
toServerless
- Click
Save
In order to connect to the Azure SignalR Service instance, you'll need an endpoint to obtain an oAuth Bearer-Token(JWT). You can use Azure Functions for this.
- See: SignalR Service bindings for Azure Functions
- Get token from: SignalR Service bindings for Azure Functions - Authenticated tokens
- open
customfunctions.ts
- set
signalRTokenEndpoint
to the URL of your Azure Functions negotiate endpoint
- Open command-line
cd
into the root directory of this sample- use
yarn
ornpm
to restore all packages
yarn install
npm install
- start web server using
yarn
ornpm
yarn start-web
npm run start-web
- Open Excel Online
- On the
Insert
Ribbon, click onOffice Add-ins
- In the new Dialog click
Upload my Add-in
- Browse and upload
manifest.xml
- in any call the custom function
=SIA.CONNECT_TO_SIGNALR("MessageType")
- use Azure Functions or anything else to send messages to the hub