This application is a microservice for use with Azure Functions.
It acts as a server (a listener) for DocuSign Connect notification messages. After checking the message's Basic Authentication and HMAC values, the software enqueues the message onto an Azure Service Bus queue for processing by other software apps.
The repo connect-node-worker-azure is an example worker application. It receives messages from the queue and then processes them. See the repo for more information.
This figure shows the solution's architecture. This application is written in Node.js. The example worker app is also written in Node.js but could be written in a different language.
Short form instructions are below. Long form instructions are also available.
To deploy the needed infra using the Serverless framework follow these instructions below.
-
Provision an Azure Service Bus Namespace.
-
Add a Shared access policy for the namespace. The policy will need Send and Listen scopes.
-
Record the Primary Connection String for the Shared access policy.
The connection string is used for the
SVC_BUS_CONNECTION_STRING
setting for the listener function and the worker application. -
Create a Queue in the namespace. Record the Queue name.
The queue name is used for the
SVC_BUS_QUEUE_NAME
setting for the listener function and the worker application.
-
Provision an Azure Function.
Runtime Stack:
JavaScript
.The OS can be either Windows or Linux.
Note the URL for the cloud function. Your DocuSign Connect subscription will be configured with this URL.
-
Download/clone this repo to a local directory.
-
Install Node.js version 8.x or later.
-
Navigate to
ConnectMessage
folder and runnpm install
.Note: If the
package-lock.json
contains references to packages that are inaccessible, delete this file and run command again. -
Use the VS Code or other tools suggested by Azure to upload the directory to your Azure function.
-
Set the environment (settings) variables for the function:
- BASIC_AUTH_NAME: optional. The Basic Authentication name set in the Connect subscription.
- BASIC_AUTH_PW: optional. The Basic Authentication password set in the Connect subscription.
- HMAC_1: optional. The HMAC secret used by the Connect subscription.
- SVC_BUS_CONNECTION_STRING: required. The connection string for a Shared access policy to the queue.
- SVC_BUS_QUEUE_NAME: required.
Note: Make sure Azure Authentication is disabled for your function app, otherwise it may not receive any messages.
Configure a DocuSign Connect subscription to send notifications to the Azure Function. Create / complete a DocuSign envelope. Check the Connect logs for feedback.
This application and the worker application enable test messages to be sent via the queuing system. The test messages do not include XML Connect notification messages.
To send a test message, use the function's URL with
query parameter test
set to
a test value. A GET or POST request can be used.
The worker application includes the test tool runTest.js
See the worker application for information on running the integration tests.
Do not include documents in the notification messages The Message Bus queuing system will not support messages that include documents. Check that your Connect subscription is configured to not include envelope documents nor the envelope's Certificate of Completion.
This repository uses the MIT License. See the LICENSE file for more information.
Pull requests are welcomed. Pull requests will only be considered if their content uses the MIT License.