Skip to content

docusign/connect-node-listener-azure

Repository files navigation

Connect Node Listener for Azure

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.

Architecture

Connect listener architecture

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.

Installation

Short form instructions are below. Long form instructions are also available.

Infrastructure

To deploy the needed infra using the Serverless framework follow these instructions below.

Azure Service Bus Namespace

  1. Provision an Azure Service Bus Namespace.

  2. Add a Shared access policy for the namespace. The policy will need Send and Listen scopes.

  3. 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.

  4. 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.

Azure Function

  1. 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.

  2. Download/clone this repo to a local directory.

  3. Install Node.js version 8.x or later.

  4. Navigate to ConnectMessage folder and run npm install.

    Note: If the package-lock.json contains references to packages that are inaccessible, delete this file and run command again.

  5. Use the VS Code or other tools suggested by Azure to upload the directory to your Azure function.

  6. Set the environment (settings) variables for the function:

    1. BASIC_AUTH_NAME: optional. The Basic Authentication name set in the Connect subscription.
    2. BASIC_AUTH_PW: optional. The Basic Authentication password set in the Connect subscription.
    3. HMAC_1: optional. The HMAC secret used by the Connect subscription.
    4. SVC_BUS_CONNECTION_STRING: required. The connection string for a Shared access policy to the queue.
    5. SVC_BUS_QUEUE_NAME: required.

    Note: Make sure Azure Authentication is disabled for your function app, otherwise it may not receive any messages.

Testing

Configure a DocuSign Connect subscription to send notifications to the Azure Function. Create / complete a DocuSign envelope. Check the Connect logs for feedback.

Test messages feature

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.

Integration testing

The worker application includes the test tool runTest.js

See the worker application for information on running the integration tests.

Usage

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.

License and Pull Requests

License

This repository uses the MIT License. See the LICENSE file for more information.

Pull Requests

Pull requests are welcomed. Pull requests will only be considered if their content uses the MIT License.

About

Connect listener example for Azure: a Node.js listener

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published