An Azure Function App that acts as middleware between Azure Logic Apps / Power Automate and the Keeper Secrets Manager (KSM) SDK. Deploy it to your Azure subscription with a single click, then create a connection using the certified Keeper Secrets Manager connector available in the Microsoft Power Platform / Azure Logic Apps connector gallery.
| Resource | Purpose |
|---|---|
| Azure Function App | Python 3.11, Linux Consumption plan, hosts the middleware code |
| Azure Key Vault | Stores your KSM config token as a secret (KSM-CONFIG) |
| Storage Account | Required by the Azure Functions runtime |
Plus supporting resources: an App Service Plan, a Key Vault access policy for the Function App's managed identity, a User-Assigned Managed Identity + Contributor Role Assignment (used by the deployment script), and a Deployment Script that pushes the middleware code into the Function App during provisioning. The Deployment Script resource is auto-cleaned on success; the User-Assigned Managed Identity and its role assignment persist after deployment and can be safely deleted manually once provisioning completes.
All resources enforce HTTPS only and TLS 1.2+.
- Azure subscription -- For ARM one-click deployment, you need either Owner on the resource group, or the combination of Contributor + User Access Administrator (the template creates infrastructure, role assignments, and runs a deployment script). Contributor alone works for the Manual Setup path.
- Keeper Enterprise account (or Keeper Business) with Secrets Manager enabled.
- Keeper Secrets Manager Application created in the Keeper Admin Console with at least one shared folder.
- One-Time Access Token generated for the KSM application -- this is the Base64-encoded config string the deployment needs.
- Sign in to the Keeper Admin Console.
- Go to Secrets Manager > Create Application > give it a name.
- Share one or more vault folders with the application.
- Open the Devices tab > Add Device > select Configuration File > choose Base64.
- Copy the Base64 value immediately -- this is your
KSM_CONFIG. It can only be used once; if lost, add a new device to generate a fresh token.
Treat this value like a password. It contains your application credentials in an encrypted, Base64-encoded format.
Click the Deploy to Azure button at the top of this page, then fill in:
| Parameter | Description |
|---|---|
| Resource Group | Select an existing group or create a new one |
| Function App Name | A globally unique name (e.g., keeper-middleware-acme) |
| Keeper Config | Paste the Base64-encoded one-time token from step 1 |
| Location | Azure region (defaults to the resource group's region) |
Click Review + create and wait ~5-7 minutes. The template provisions all resources and deploys the middleware code automatically -- no func publish step needed.
Requires either Owner on the resource group, or Contributor + User Access Administrator for ARM deployment (infrastructure + role assignment + deployment script). With Contributor only, use the Manual Setup path.
- In the Azure portal, navigate to your new Function App.
- Go to App keys (under the Functions section in the left menu).
- Copy the default host key value -- you'll need it in step 4.
The Keeper Secrets Manager connector is published as a certified connector in the Microsoft Power Platform and Azure Logic Apps connector gallery. There is nothing to import -- just create a connection.
- In Azure Logic Apps or Power Automate, add a new action and search for "Keeper Secrets Manager" in the connectors list.
- Pick any Keeper action (e.g. List Secrets) -- the first time you use it, you'll be prompted to create a connection.
- Fill in the connection form:
- Connection name -- any friendly label (e.g.
keeper-prod) - Function App hostname --
<your-function-app-name>.azurewebsites.net - API key -- paste the host key you copied in step 3 (it's sent as the
x-functions-keyheader)
- Connection name -- any friendly label (e.g.
- Click Create.
You can now use List Secrets, Get Secret, Create Secret, Update Secret, and List Folders in any workflow.
Three ready-to-deploy Consumption Logic Apps live under workflowTemplates/ so you can validate the connector end-to-end without building a workflow by hand:
get-secret-- HTTP-triggered. POST{ "uid": "<secret-uid>" }to its callback URL and the response body is the full secret JSON.create-secret-- HTTP-triggered. POST a secret payload (folder_uid,title,login,password,url,notes) and the response body is the newly created secret JSON (including its UID).update-secret-- Recurrence-triggered. StampsUpdated at <utcNow()>into thenotesfield of a single secret on a schedule -- a tiny smoke test for the connector + middleware.
Each template creates only the Logic App and binds it to an existing Keeper API connection -- so the order of operations is:
- Create the API connection once (Step 1 below).
- Deploy any of the workflow templates, passing that connection's name (Step 2).
Deploying these workflow templates requires only Contributor on the resource group (no role assignments are created, unlike the infrastructure template).
Sample-only notice: The HTTP-triggered workflows (
get-secret,create-secret) rely on the Logic Apps callback URL as their sole authentication mechanism. For production use, add additional access controls such as Azure API Management, IP restrictions, or Entra ID authentication on the HTTP trigger.
This step is what Step 4 of the Quick Start walks through. The short version:
- Azure portal > API Connections > + Add.
- Search for "Keeper Secrets Manager" (certified connector) and pick it.
- Fill the form fields -- typically the Function App hostname (e.g.
keeper-middleware-acme.azurewebsites.net) and the Function App's default host key. - Give the connection a memorable name (e.g.
keeper-conn) and click Create. - Confirm Status is Connected in the API Connections list.
You'll reuse this single connection for all three workflows below.
Click any of the buttons below (or use the equivalent CLI line):
| Workflow | Deploy |
|---|---|
| Get secret (HTTP) | |
| Create secret (HTTP) | |
| Update secret (recurrence) |
Or from a terminal, using the sibling parameters file (one per workflow):
az deployment group create \
--resource-group <your-rg> \
--template-file workflowTemplates/get-secret/azuredeploy.json \
--parameters @workflowTemplates/get-secret/azuredeploy.parameters.jsonEdit the placeholders in each workflow's azuredeploy.parameters.json before deploying:
connectionName-- the exact name of the connection you created in Step 1 (it must already exist in the same resource group you're deploying the Logic App into).secretUid-- (update-secret only) UID of the Keeper secret the recurrence run will stamp.
That's all the templates need. logicAppName and location fall back to defaults (la-keeper-<workflow>-sample and the resource group's location); add them to the parameters file only if you want to override.
The same connection works for all three workflows. Pass the same connectionName value to each deploy and they all bind to the same Microsoft.Web/connections resource -- one set of credentials, three workflows.
If you prefer to provision resources by hand (for example, to fit into existing Bicep/Terraform pipelines, or because your environment restricts portal templates), follow these steps instead of clicking the Deploy to Azure button. Once the resources are in place and the code is deployed, return to Step 3 above to wire the connector up.
- Azure portal > Resource groups > Create.
- Pick a subscription, name (e.g.
rg-keeper-middleware), and region. - Review + create.
- Storage accounts > Create.
- Select your resource group, give it a name (e.g.
stksmyourorg). - Redundancy: LRS. Under Advanced, confirm Secure transfer is enabled and Minimum TLS is 1.2.
- Review + create.
- Key vaults > Create. Select your resource group, name it (e.g.
kv-ksm-yourorg), same region. - Review + create.
- Once created, go to Secrets > Generate/Import.
- Name:
KSM-CONFIG, Value: paste the Base64 token from Quick Start step 1. - Create.
- Function App > Create.
- Select your resource group. Set a globally unique name (e.g.
keeper-middleware-yourorg). - Runtime: Python 3.11, OS: Linux, Plan: Consumption (Serverless).
- Storage: select the account from 1b.
- Review + create.
- Open the Function App > Identity > set System assigned to On > Save.
- Note the Object (principal) ID.
- Go to your Key Vault > Access policies > Create.
- Secret permissions: check Get.
- Principal: search for your Function App name or paste the Object ID.
- Create.
Open Function App > Environment variables and add:
| Name | Value |
|---|---|
FUNCTIONS_WORKER_RUNTIME |
python |
FUNCTIONS_EXTENSION_VERSION |
~4 |
KSM_CONFIG |
@Microsoft.KeyVault(SecretUri=https://<your-keyvault>.vault.azure.net/secrets/KSM-CONFIG/) |
Replace <your-keyvault> with your Key Vault name. Click Save.
git clone https://github.com/Keeper-Security/azure-logic-apps.git
cd azure-logic-apps/keeperLogicAppMiddleware
func azure functionapp publish <FUNCTION_APP_NAME> --pythonReplace <FUNCTION_APP_NAME> with the name from step 1d. Wait for "Remote build succeeded!" (2-5 minutes).
Requires Azure Functions Core Tools (v4) and Python 3.11+.
Once the code is published, continue with Quick Start step 3 to grab the host key and create the connector connection.
Linux Consumption Function Apps need Dynamic VM quota in the chosen region. Some new subscriptions have 0 quota in certain regions. Either redeploy in another region (e.g. East US, West Europe), or request a quota increase under Subscriptions > Usage + quotas.
The template grants the Function App's managed identity access to the secret -- not your user account (Azure separates control-plane and data-plane permissions on Key Vault). To view or edit the secret yourself, open the Key Vault > Access policies > Create, and grant your user Get / List / Set / Delete on secrets. The Function App keeps working either way.
Normal -- typically 3-7 minutes end to end. If it exceeds 15 minutes, the script times out; re-running the deployment usually resolves it.
Wait 30-60 seconds and refresh -- the runtime needs a moment to discover the deployed code. If still missing, check Deployment Center > Logs in the Function App for build errors.
All endpoints require the x-functions-key header for authentication. The custom connector adds this header automatically using the API key you provided when creating the connection.
Best-effort rate limiting is enforced per x-functions-key: 180 requests per 10-second window per worker (in-memory, resets on cold start). This sits below Keeper's upstream API throttle of 200 req/10s per Device ID (docs). When exceeded, returns 429 Too Many Requests with a Retry-After header.
GET /api/health
Returns {"status": "ok"} -- use this to verify the Function App is running.
GET /api/secrets
Returns an array of secret summaries:
[
{
"uid": "xxxxxxxxxxxx",
"title": "My Login",
"type": "login",
"folder_uid": "xxxxxxxxxxxx"
}
]GET /api/secrets/{uid}
Returns the full record with all standard and custom fields:
{
"uid": "xxxxxxxxxxxx",
"title": "My Login",
"type": "login",
"login": "admin",
"password": "Secret123",
"url": "https://example.com",
"notes": "",
"oneTimeCode": "",
"passkey": [],
"fileRef": [],
"custom": [],
"folder_uid": "xxxxxxxxxxxx",
"is_editable": true
}POST /api/secrets
Content-Type: application/json
{
"folder_uid": "xxxxxxxxxxxx",
"title": "New Credential",
"login": "user@example.com",
"password": "StrongP@ss!",
"url": "https://app.example.com",
"notes": "Created by Logic App workflow"
}
PUT /api/secrets/{uid}
Content-Type: application/json
{
"password": "NewPassword!2025",
"notes": "Rotated on 2025-04-09"
}
Supports updating: title, login, password, url, and notes fields.
GET /api/folders
Returns all shared folders accessible to the KSM application:
[
{
"uid": "xxxxxxxxxxxx",
"name": "Production Credentials",
"parent_uid": ""
}
]- Python 3.11+
- Azure Functions Core Tools v4
- A Base64-encoded KSM configuration token (the same one-time access token used in production)
cd keeperLogicAppMiddleware
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a local.settings.json file (excluded from Git by .gitignore):
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "python",
"KSM_CONFIG": "<YOUR_BASE64_KSM_CONFIG>"
}
}Replace <YOUR_BASE64_KSM_CONFIG> with the raw Base64-encoded token from the Keeper Admin Console. In production this value comes via an Azure Key Vault reference, but locally you provide it directly.
Important: Do not commit
local.settings.jsonto source control -- it is already excluded by.gitignore.
func startThe API will be available at http://localhost:7071/api/.
Note: Function-level auth (
x-functions-key) is not enforced when running locally with Azure Functions Core Tools. You can call the endpoints directly without an API key.
curl http://localhost:7071/api/health
curl http://localhost:7071/api/secretsSee API Reference for the full set of endpoints and request bodies.
Recurrence (every 30 days)
-> Get secret (fetch current credential by UID)
-> Compose (generate new password)
-> Update secret (set new password + rotation timestamp in notes)
-> Send email (notify the security team)
When a new issue is opened (GitHub trigger)
-> Get secret (fetch API key from Keeper by UID)
-> HTTP action (call external API using the fetched credential)
-> Update issue (post results back)
No. The middleware uses the Keeper Secrets Manager SDK, which operates on a zero-knowledge, zero-trust architecture. Your master password is never transmitted, stored, or accessible to the middleware or the connector. Authentication is handled entirely through the KSM one-time access token and derived encryption keys.
No. Keeper Secrets Manager is an add-on feature available exclusively with Keeper Enterprise subscriptions. Contact Keeper Sales for licensing information.
- Go to the Keeper Admin Console.
- Navigate to Secrets Manager and select your application.
- Generate a new one-time access token.
- In the Azure portal, go to your Key Vault and update the KSM-CONFIG secret with the new Base64-encoded value. The Function App reads
KSM_CONFIGvia a Key Vault reference (@Microsoft.KeyVault(SecretUri=https://<your-keyvault>.vault.azure.net/secrets/KSM-CONFIG/)), so updating the Key Vault secret is all that's needed. - The Function App refreshes its KSM client every ~10 minutes, so the new token takes effect automatically. For immediate effect, restart the Function App from the portal.
Yes. Once a connection is created with a Function App URL and host key, any flow within the same environment can reuse that connection. Each connection points to a single KSM application, so the accessible secrets are determined by the folders shared with that application.
The Get secret and Update secret operations will return a 404 (Not Found) error. Design your workflows to handle this case using a Condition action or error handling (Configure Run After).
Access is controlled at the Keeper Secrets Manager application level. In the Admin Console, share only the specific folders that the connector should have access to. The connector cannot access secrets in folders that have not been explicitly shared with the KSM application.
- Zero-Knowledge Architecture -- The KSM config token is the only credential stored. Keeper's zero-knowledge SDK decrypts secrets locally inside the Function App; plaintext secrets never transit through Keeper's servers.
- Key Vault Storage -- The KSM config is stored in Azure Key Vault and accessed via a Managed Identity Key Vault reference. It never appears in plaintext in App Settings.
- HTTPS Only -- The Function App rejects all HTTP traffic.
- TLS 1.2+ -- Minimum TLS version is enforced at the App Service level.
- Function-Level Auth -- Every API call requires the
x-functions-keyheader, preventing unauthorized access.
+-----------------+
| Logic Apps / |
| Power Automate |
+--------+--------+
|
v
+-----------------+
| Keeper Secrets |
| Manager |
| Connector |
+--------+--------+
|
Function App URL +
Host Key (x-functions-key)
|
v
+-----------------+ +----------------+
| Azure Function | -----> | Azure Key Vault|
| (this repo) | MSI | (KSM config) |
+--------+--------+ +----------------+
|
KSM SDK
v
+-----------------+
| Keeper Vault |
| (your secrets) |
+-----------------+
The connector is created with the Function App URL and Function App Host Key (collected in Quick Start step 3). On every call, the connector adds the host key as the x-functions-key header.
Copyright (c) Keeper Security, Inc. All rights reserved.