Azure Container App
Simple Deployment with Azure Container App

Overview
This guide provides step-by-step instructions to publish Keeper Automator to the Azure Container App service. This provides a simple and straightforward way to host the Automator service in the cloud.
(1) Create an Automator Config key
Open a command line interface and generate a 256-bit AES key in URL-encoded format using one of the methods below, depending on your operating system:
Generate a Key
Save the resulting value produced by this command for Step (3).


AUTOMATOR_CONFIG_KEY provides stable encryption key material. It does not replace Automator’s saved configuration. The /usr/mybin/config directory must use persistent storage.
(2) Create a Container Registry
If you do not already have a container registry, you must create one and configure as you see fit, see the example below.


(3) Create a Container App
From Azure, create a new Container App.

Select or create a new Resource Group
Set the Container App Name to "keeperautomator" or whatever you prefer
Select "Container Image" as the Deployment Source
Select the region where you would like the service hosted
Create a new Apps Environment or select an existing environment
Click "Next: Container"

(4) Setup Container Details
In the "Container" step, make the following selections:
Uncheck the "Use quickstart image"
Select "Docker Hub or other registries"
Select "Public"
Select Registry login server as
docker.ioSet the Image and tag as
keeper/automator:latestSkip to "Container resource allocation"
For CPU and Memory, 0.5 CPU cores and 1Gi memory is sufficient, but this can be updated based on your volume of new device logins.
Create an environment variable called
AUTOMATOR_CONFIG_KEYwith the value from Step 1 above of the setup guide.Create an environment variable called
AUTOMATOR_PORTwith the value of8089Create an environment variable called
SSL_MODEwith the value ofnoneClick "Next : Ingress >"

(5) Ingress Setup
On the Ingress setup screen, select the following:
Enable "Ingress"
For Ingress traffic, select "Accepting traffic from anywhere" (we'll modify this in a later step)
For Ingress type, select "HTTP"
Set Target port to "8089"

(6) Create Container App
Click "Review + Create" > "Create"
After a few minutes, the container app will be created and automatically start up.
Clicking on "Go to Resource" will take you to the container environment.

(7) Finish the Ingress Setup
To restrict communications to the Keeper Automator service, click on the "Ingress" link on the left side of the screen under the "Network" section.
Click on "Ingress"
Select "Allow traffic from IPs configured below, deny all other traffic"
Click "Add" to add Keeper's IPs as documented here
Click "Save"

(8) Set Scaling
Select "Application > Scale" and set min and max replicas to "1"
Click "Save as a new revision"

(9) Create or Select Azure Storage
Open the Storage accounts in the Azure Portal.
Click "Create".

Select the same resource group and region as the Container Apps environment
Select the redundancy, billing, and access tier required by your organization - what is shown is the minimum.

Create the storage account - remaining default options are acceptable, but if additional hardening is required by your organization follow those policies
In the storage account select "Security + networking > Access keys"
Click "Show" next to "key1" and copy the Key value (Save this for step 11)

(10) Create the File Share
Open the storage account

Select "Data Storage > Classic file share"
Click + "Classic file Share"

Create a share for Automator configuration
Use the smallest provisioned storage value allowed by the selected Azure Files configuration. The portal may require a larger minimum, such as 32 GiB. This share stores Automator config files and logs. Configure Backup according to your organization's policy.

(11) Register the Azure Files Share
Open your Container App (e.g.,
keeperautomator) in the Azure Portal.On the Overview page, in the Essentials section at the top, find "Container Apps Environment" and click the environment name link. This opens the environment resource.
Alternatively: in the Azure Portal search bar at the top, search for “Container Apps Environments”, open the service, and select the environment created in Step 3.
Tip: the environment is a separate resource in the same resource group, with the resource type “Container Apps Environment”.
Select "Settings > Volume mounts"
Click "Add > Server Message Block (SMB)"

Provide a
Name, the previously selected/createdStorage account name, the previously savedStorage account key, and aFile share name.

(12) Attach Storage to Container App
Back in the container app configuration, under Application > Volumes click 'Add'
Select Azure file volume, and select the previously created file share name

Click 'Save as a new revision'
(13) Set up Health Probes and Volume Mount
Navigate to the "Application > Revisions and Replicas" section
Click on "Create new revision"

Click on "Application > Revisions" and replicas an observe a new revision being activated
Next, click on the "Container" tab
Click on the container image name link, in this case "keeperautomator" at the bottom

Navigate to Health Probes and enter the following under each section:
Under "Liveness probes"
Enable "liveness probes"
Transport: HTTP
Path: /health
Port: 8089
Initial delay seconds: 5
Period seconds: 30

Under "Startup probes":
Enable startup probes
Transport: HTTP
Path: /health
Port: 8089
Initial delay seconds: 5
Period seconds: 30
Under "Volume Mounts" tab:
Select "+ Add"
Select the volume you created in a previous step and Add Mount Path as "/usr/mybin/config"

Finish the configuration
Click on "Save"
Then click on "Create" to build the new configuration
After a few minutes, the new containers should start up
(14) Retrieve the Application URL
Wait until the revision is done activating.
From the Overview section of the Container App, on the right side is the "Application URL" that was assigned. Copy that and use this Application URL in the next step. For example: https://craigautomator1.xyx -1234.azurecontainerapps.io

(15) Login to Keeper Commander
Keeper Commander is required to perform the final step of Automator configuration. This can be run from anywhere, it does not need to be installed on the server.
On your workstation or server, install Keeper Commander CLI. The installation instructions including binary installers are here.
After Commander is installed, launch Keeper Commander, or from an existing terminal you can type keeper shell to open the session, then login using the login command. In order to set up Automator, you must login as a Keeper Administrator, or an Admin with the ability to manage the SSO node.
(16) Create the Automator
Create the Automator using a series of commands, starting with automator create with your node name.
The Node Name (in this case "Azure Cloud") comes from the Admin Console UI as seen below.

The output of the command will display the Automator settings, including metadata from the identity provider.
Note that the "URL" is not populated yet. This is the Application URL from Step 8.
Run the "automator edit" command as displayed below, which sets the URL and also sets up the skills (team, team_for_user and device).
Next we exchange keys: The enterprise private key encrypted with the Automator public key is provided to Automator:
Initialize the Automator with the new configuration
Enable the service
At this point, the configuration is complete.
For external health checks, you can use the below URL:
https://<server>/health
Example curl command:
Testing the User Experience
Now that Keeper Automator is deployed, you can test the end-user experience. No prompts for approval will be required after the user authenticates with the SSO identity provider.
The easiest way to test is to open an incognito mode window to the Keeper Web Vault and login with SSO Cloud. You will not be prompted for device approval.
Advanced
Azure Container Apps have many advanced capabilities that are beyond the scope of this documentation. A few of the capabilities are provided below.
Scaling with Multiple Containers
If you would like to have multiple containers running the Keeper Automator service:
Click on "Scale and replicas"
Click "Edit and deploy"
Click on the "Scale" tab
Select the min and max number of containers. The minimum should be at least 1.
Click Create
After a minute, the new version will deploy
Run
automator setup xxxmultiple times (one for each container)Run
automator init xxxmultiple times (one for each container)
Logging
The Keeper Automator logs can be viewed and monitored using the "Console" or "Log stream" section.
For example, to tail the log file of a running Automator service:
Click on Console
Select "/bin/sh"
Click Connect
At the prompt, type:
tail -f logs/keeper-automator.log
Advanced Settings
Environment variables can be passed into the Container to turn on/off features of the runtime environment. The variables with their description can be found at the Advanced Settings page.
Last updated

