Azure Container Apps Setup Guide
Overview
If you are hosting in Microsoft Azure, DataGrail recommends using Azure Container Apps to deploy the Request Manager Agent. Deploying in Azure Container Apps will result in most of the details of load balancing, SSL termination, and service uptime being managed in a simple and standard manner. This toolchain provides simple and robust management of your deployment. To get an overview of Azure Container Apps, check out Microsoft's documentation.
Sourcing the Agent Image
The Request Manager Agent Docker image is hosted in DataGrail's private image registry. Once you have obtained credentials from your DataGrail representative, you can pull the image using the following command:
# Authenticate with the DataGrail registry
docker login contairium.datagrail.io -u $DATAGRAIL_SUBDOMAIN -p $DATAGRAIL_API_KEY
# Pull the latest Request Manager Agent image (or specify a version)
docker pull contairium.datagrail.io/datagrail-rm-agent:latest
Create an Azure Resource Group
- Navigate to Resource Groups (type "Resource group" in the search bar and select the service).
- Click Create.
- Select your preferred Azure subscription.
- Under Resource group, enter a name such as
datagrail-rm-agent
. - Click Create.
Register an Application and Create Application Credentials
Register an Application
- Navigate to App Registrations (type "App registrations" in the search bar).
- Click New registration.
- Under Name, enter a name such as
datagrail-rm-agent
. - Leave all other values as default and click Register.
Create Application Credentials
- Navigate to the Certificates & secrets module in the left-hand menu.
- Click New client secret.
- Enter a description such as
datagrail-rm-agent
. - Copy the Value field immediately after creation. This value will disappear after navigating away from the page.
Create a Key Vault, Store Secrets, and Grant Application RBAC to Key Vault
Create a Key Vault
- Navigate to Key Vaults (type "Key vault" in the search bar).
- Click Create.
- Select your preferred subscription and the
datagrail-rm-agent
resource group. - Name the key vault
dg-agent-secrets
. - Select your preferred region and click Create.
Store Secrets
- Navigate to Secrets in the Key Vault menu.
- Click Generate/Import.
- Create the following secrets:
- DataGrail Application Credentials:
- Name:
datagrail-rm-agent-credentials
- Value (JSON format):
{"client_id": "<arbitrary value>", "client_secret": "<secure string>"}
- Name:
- DataGrail Callback Token:
- Name:
datagrail-credentials
- Value (JSON format):
{"token": "<token provided by DataGrail>"}
- Name:
- Connector Credentials (e.g., Snowflake):
- Name:
snowflake-credentials
- Value (JSON format):
{"user": "<DB username>", "password": "<DB password>", "account": "<Snowflake Account>", "warehouse": "<Snowflake Warehouse>", "database": "<Snowflake DB>"}
- Name:
- DataGrail Application Credentials:
Grant Application RBAC to Key Vault
- Navigate to Access control (IAM) in the Key Vault.
- Click Role assignments > Add > Add role assignment.
- Select Key Vault Secrets User and click Next.
- Search for the registered application by name and select it.
- Click Review and assign.
Create a Container App, Container Apps Environment, Store Secrets, and Modify Ingress
Create a Container App
- Navigate to Container Apps (type "Container Apps" in the search bar).
- Click Create.
- Select your preferred subscription and the
datagrail-rm-agent
resource group. - Enter a name such as
datagrail-rm-agent
for the container app. - Select your preferred region.
- Under Container Apps Environment, select Create new.
Create a Container Apps Environment
- Enter
datagrail-rm-agent
as the environment name. - Under Monitoring, ensure Azure Log Analytics is selected.
- Create a new Logs Analytics workspace.
- Under Networking, select the VNet and subnet for deployment.
- Click Create.
Create a Container App (Continued)
-
De-select Use quickstart image.
-
Select Azure Container Registry and choose the
datagrail-rm-agent
registry. -
Configure the following environment variables:
DATAGRAIL_AGENT_CONFIG
: Filled-in configuration JSON object.AZURE_TENANT_ID
: Your Azure tenant ID.AZURE_CLIENT_ID
: Client ID from step 2.AZURE_CLIENT_SECRET
: Placeholder value (to be updated later).
-
Enable Ingress:
- Set Client certificate mode to Require.
- Set Target port to
80
.
-
Click Review and create.
Store Secrets
- Navigate to Secrets in the Container App menu.
- Create a secret:
- Key:
datagrail-rm-agent-client-id
- Value: Client ID from step 2.
- Key:
- Navigate to Revisions and click Create a new revision.
- Update the
AZURE_CLIENT_SECRET
source to reference the secret created above. - Click Save and then Create.
Modify Ingress
- Navigate to Ingress in the Container App menu.
- Under IP Restrictions Mode, select Allow traffic from IPs configured below, deny all other traffic.
- Add the following IP address:
52.36.177.91/32
(DataGrail’s IP address).
Grant Container App Permission to Write to Azure Blob Storage
- Navigate to Storage accounts (type "Storage accounts" in the search bar).
- Select the pre-created DataGrail container.
- Under Access Control (IAM), click Add > Add role assignment.
- Select Storage Blob Data Contributor and click Next.
- Select the registered application created in step 2.
- Click Review and assign.
Disclaimer: The information contained in this message does not constitute as legal advice. We would advise seeking professional counsel before acting on or interpreting any material.