Overview
This Action programmatically exports decrypted SendSafely package contents to Global Relay for long-term storage.
Please note that this Action requires access to the contents of SendSafely packages, and thus must be configured with a Portal Master Key.
Getting Started
- Work with Global Relay to enable your SendSafely archive feed. A provisioning specialist will provide your credentials. Please do not share these credentials with the SendSafely team.
- Contact SendSafely for the Global Relay Action (an Azure ARM template).
- The Action template requires you to have an Azure subscription with permissions to create resource groups, Function Apps, Key Vaults, Storage Accounts, and role assignments.
- Configure your SendSafely Actions workflow in the SendSafely portal. Define your archiving event triggers and data filters and connect the integration, as described in the Setup Instructions below.
- Activate and validate. Confirm data is flowing into your Global Relay archive.
Setup Instructions
1. Deploy the ARM Template
To deploy the template, you'll need the following permissions in Azure:
- Create a Resource Group
- Create a Function App, Storage Account, Key Vault, and Application Insights instance
- Create Role Assignments (RBAC) on those resources
Follow these steps:
- In the Azure Portal, search for Deploy a custom template and select Build your own template in the editor.
- Paste the full contents of the ARM template JSON file provided by your SendSafely account rep, then click Save.
- Fill in the required parameters:
- Stack Name — a short prefix used for all resource names (e.g.
ss-globalrelay). - Owner Alias — must exactly match a Global Relay User Profile alias.
- Display Name — display name for the event owner in Global Relay.
- Enable Secure Message Export — set to
trueto also archive the SendSafely secure message body. - Deployer Object Id — your Azure AD object ID. When provided, grants you Key Vault Secrets Officer so you can view and manage secrets in the portal after deployment. Leave blank to skip. To find your object ID:
- Azure CLI: run
az ad signed-in-user show --query id -o tsvand copy the output. - Azure Portal: navigate to Microsoft Entra ID → Users, search for your name, open your profile, and copy the Object ID field.
- Azure CLI: run
- Global Relay Base64 Credential — base64-encoded
clientId:clientSecretfor the Global Relay Event scope, provided by Global Relay. - Send Safely Host — your SendSafely portal hostname (e.g.
https://company.sendsafely.com). - Send Safely Api Key — your SendSafely API Key.
- Send Safely Api Secret — your SendSafely API Secret.
- Pgp Public Key Id — the public key ID of your Portal Master Key. The SendSafely Support team will provide this ID when you submit your public key.
- Pgp Private Key — the full text of the PGP private key, including opening and closing tags:
-----BEGIN PGP PRIVATE KEY BLOCK----------END PGP PRIVATE KEY BLOCK-----
- Stack Name — a short prefix used for all resource names (e.g.
- Click Review + create, then Create.
- Wait for the deployment status to change from Deployment is in progress to Your deployment is complete.
All credentials are written directly to Azure Key Vault as individual secrets during deployment.
After deployment completes, click Outputs to find the WebhookUrl and KeyVaultConsoleUrl — you will need both in later steps.
2. Deploy the Function Code
The ARM template provisions the infrastructure but does not include the function code. The ZIP file is provided by your SendSafely account rep. Deploy it using one of the methods below — the FunctionAppName from the deployment Outputs tab is the app name to use in both.
Option A — Azure Portal (no CLI required)
- In the Azure Portal, navigate to your Function App (
<FunctionAppName>). - In the left menu, under Deployment, select Deployment Center, then click Manual Deployment(Push).
- Under Publish Files select the
global-relay-azure.zipfile provided by SendSafely. - Then click Save.
- Wait for the upload to complete. The page will show a success message on top right when done.
Option B — Azure CLI
Run the following command, replacing the placeholders with the values from the deployment Outputs tab:
az functionapp deployment source config-zip \ --resource-group <resource-group> \ --name <FunctionAppName> \ --src /path/to/global-relay-azure.zip
3. Trigger Initial Token Rotation
After the deployment completes, the Function App needs to fetch and store a valid Global Relay access token in Key Vault before it can process any packages. Do this once manually.
First, enable the Azure Portal as an allowed CORS origin so the portal can invoke the function. This is a one-time configuration and does not affect how the function processes SendSafely webhooks:
- In your Function App, navigate to API → CORS.
- Add
https://portal.azure.comto the Allowed Origins list. Click Save.
Then trigger the token rotation:
- In the Azure Portal, navigate to your Function App (named
<stackName>-fn). - Under Functions, select GlobalRelayTokenRotation.
- Click Code + Test in the left menu, then click Test/Run and Run.
The portal shows a 202 Accepted response code and Executed ... (Succeeded) in the logs panel. Also the gr-authentication-token secret in your Key Vault will now be populated with a valid token.
From this point on, the token will be automatically refreshed every 12 hours.
Note: If this step is skipped, the first package finalization or workspace upload will fail because the Function App will not have a valid Global Relay token to authenticate with.
4. Create a New Workflow
As an admin logged into your SendSafely portal, click the circle containing your initials in the top-right corner of the screen and select SendSafely Actions. Here, click New Workflow. Edit the name of the workflow to reflect the Workflow purpose.
5. Choose the Trigger Event
At the time of this writing, the Actions framework supports two relevant trigger events: A file is uploaded to a Workspace or A package is finalized. If you wish to perform this Action on both events, you'll need to go through this process twice, setting up two Workflows: one for each event.
6. Decide Whether This Workflow Will Apply to a Specific User, or a Group of Users (Optional)
This Workflow, by default, will apply to all packages portal-wide. You can limit its scope to packages owned by a specific user or a group of users (defined in an Enterprise Contact group) by taking the following steps:
Specific User
- Click the plus button and select Add an Event Filter.
- From the Criteria dropdown, select Package Owner Email.
- From the Operator dropdown, select equals.
- In the Value input, type the email of the user in question and click Save.
Group of Users
- Create an Enterprise Contact Group in the SendSafely Enterprise Console. Note you must be a SendSafely admin to create Enterprise Contact groups. Add the email address for each member of the group (you can add up to 50 emails at a time in a comma-separated list).
- Return to editing the Actions workflow. Click the plus button and select Add an Event Filter.
- From the Criteria dropdown, select Package Owner Email.
- From the Operator dropdown, select Is in Contact Group.
- In the Value input, select the Contact Group created in step 1 from the dropdown list and click Save.
7. Add the Actions
Three Actions comprise this Workflow. We will add them one at a time.
Action 1
First, we'll hold the package or file, preventing your recipients from deleting or moving the package or file before the workflow completes.
- Click the plus button and select Add an Action.
- From the Action dropdown, select Hold Package (or, if the trigger event is "A file is uploaded to a Workspace," select Hold File).
- From the Notification dropdown, select Notify on Error or Timeout.
Action 2
Next, we'll invoke the webhook of the Function App, which will use the Master Key to decrypt the package or file's contents, upload them to Global Relay for storage, and return a verdict.
- Click the plus button and select Add another Action.
- From the Action dropdown, select Invoke an External Webhook.
- From the Notification dropdown, select Notify on False, or Timeout.
Retrieve the WebhookUrl from the Outputs tab of your Azure deployment, then paste it into the input in SendSafely and click Save.
Action 3
Last, we'll release the package or file, rendering its contents available to its recipients.
- Click the plus button and select Add another Action.
- From the Action dropdown, select Release Package (or, if the trigger event is "A file is uploaded to a Workspace," select Release File).
- From the Notification dropdown, select Notify on Error or Timeout.
Add Action Filter
We'll now add an Action Filter to this 3rd Action, so that it only runs if the 2nd Action succeeds. Packages successfully uploaded to Global Relay will be released, whereas packages whose upload failed will remain held.
- Click Add Action Filter.
- From the Criteria dropdown, select Action Step 2 Result.
- From the Operator dropdown, select Equals.
- From the Value dropdown, select True.
8. Add Action Secrets to Key Vault
When you saved the webhook action in Step 6, SendSafely generated an action ID and an action secret for it. The Function App uses these to verify that incoming webhook requests are genuine. You need to store the action secret in Azure Key Vault before activating the workflow.
Repeat the following steps for each trigger event you configured (once for Finalize Package, once for Workspace Upload, if applicable):
- In the SendSafely Actions editor, click the text that says "Click here to view the action secret" and copy both the Action ID and the Action Secret.
- In the Azure Portal, open your Key Vault using the KeyVaultConsoleUrl from the deployment Outputs tab.
- Under Objects, click Secrets, then click + Generate/Import.
- Set the Name to
action-secret-id-<actionId>, replacing<actionId>with the Action ID copied from SendSafely. - Set the Secret value to the Action Secret copied from SendSafely, then click Create.
9. Activate the Workflow
At the top of the page, click the toggle next to the text "Disabled" to enable the Action. The text will change from "Disabled" to "Live."
10. Test the Workflow
Now that we've activated the Workflow, let's trigger it. If the triggering event is "A package is finalized," we'll make a Dropzone submission or create a Transfer package. If the triggering event is "A file is uploaded to a Workspace," we'll upload a file to a Workspace.
If the package or file that triggered the Action is not successfully uploaded to Global Relay, it will remain held. If the package or file that triggered the Action is successfully uploaded to Global Relay, it will be released.
Scaling Considerations
The default ARM template deploys a Premium (EP1) plan with minimumElasticInstanceCount: 1, which keeps one instance permanently pre-warmed.
| Premium (EP1) — default | |
|---|---|
| Cost | ~$125/month |
| Function timeout | 30 minutes |
| Cold start | None — pre-warmed workers are always ready |
| Concurrent scale-out | Yes — additional pre-warmed instances promote on demand |
EP1 is required rather than optional because the Consumption (Y1) plan has a cold start race condition where the Azure Functions host accepts incoming webhook requests before the Node.js worker finishes connecting. This causes the host to return a 204 response — SendSafely treats 204 as a success and does not retry, silently skipping the export. EP1 eliminates this with permanently pre-warmed workers.
Comments
0 comments
Please sign in to leave a comment.