Azure Container Apps
This guide walks you through deploying the Superblocks On-Prem Agent on Azure Container Apps using either a YAML File, the Azure CLI or the Azure Portal.
Prerequisites
- Azure subscription with permissions to create resources
- Superblocks Agent Key (generate one)
- Install Azure CLI
- Install Docker
- Create Azure Container Apps Environment
Deploy
Environment Creation - Azure Portal
- Go to Azure Portal > Container Apps Environments > + Create
- Enter environment name and region
- For public access: choose External, or for private deployment choose Internal with a connected VNet + /27 subnet
For More Information on Public vs. Private Endpoints: Networking in Azure Container Apps Environment
Environment Creation - Azure CLI
az containerapp env create \
--name superblocks-env \
--resource-group myresourcegroup \
--location eastus
- YAML Template
- Azure CLI
- Azure Portal
Deploy with YAML
You can deploy the On-Premise Agent on Azure Container Apps by creating a .yaml
file and calling it when running az containerapp create
.
properties:
environmentId: "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.App/managedEnvironments/<environment_name>"
configuration:
ingress:
external: <true/false>
allowInsecure: <true/false>
targetPort: 8080
secrets:
- name: "agent-key"
value: "<agent_key_value>"
template:
containers:
- image: ghcr.io/superblocksteam/agent:latest
name: <container_app_name>
resources:
cpu: 2.0
memory: 4.0Gi
env:
- name: "SUPERBLOCKS_ORCHESTRATOR_SUPERBLOCKS_KEY"
secretRef: "agent-key"
- name: "SUPERBLOCKS_AGENT_KEY"
secretRef: "agent-key"
- name: "SUPERBLOCKS_AGENT_DATA_DOMAIN"
value: "app.superblocks.com"
- name: "SUPERBLOCKS_ORCHESTRATOR_AGENT_HOST_URL"
value: "https:<container_app_name>.<defaultDomain>"
- name: "SUPERBLOCKS_ORCHESTRATOR_AGENT_TAGS"
value: "profile:*"
scale:
minReplicas: 1
maxReplicas: 1
Run:
az containerapp create -n <container_app_name> -g <MyResourceGroup> --environment <MyContainerappEnv> --yaml "path/to/yaml/file.yml"
Deploy with CLI
First, install the required extensions and providers:
az extension add --name containerapp --upgrade
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
APP_NAME="superblocks-agent"
AGENT_KEY="<YOUR_GENERATED_AGENT_KEY>"
AGENT_URL="<AZURE_APPLICATION_URL>"
az containerapp create \
--name $APP_NAME \
--resource-group myresourcegroup \
--environment superblocks-env \
--image superblocksteam/agent:latest \
--cpu 2.0 --memory 4.0Gi \
--ingress external --target-port 8080 \
--secrets agent-key=$AGENT_KEY \
--env-vars SUPERBLOCKS_AGENT_KEY=secretref:agent-key \
SUPERBLOCKS_ORCHESTRATOR_SUPERBLOCKS_KEY=secretref:agent-key \
SUPERBLOCKS_AGENT_DATA_DOMAIN="app.superblocks.com" \
SUPERBLOCKS_ORCHESTRATOR_AGENT_HOST_URL=$AGENT_URL \
SUPERBLOCKS_ORCHESTRATOR_AGENT_TAGS="profile:*" \
--min-replicas 1 --max-replicas 1
Note: If using a private registry, provide full image path and configure credentials accordingly.
Verify Agent is Running
Check the application status:
az containerapp show \
--name superblocks-agent \
--resource-group myresourcegroup \
--query properties.configuration.ingress.fqdn -o tsv
View application logs:
az containerapp logs show \
--name my-container-app \
--resource-group my-container-apps
Deploy with Azure Portal
- Go to Container Apps > + Create
- Select your environment, resource group, and app name
- Under Container:
- Image:
superblocksteam/agent:latest
- Set 2 CPU, 4.0 GiB memory
- Enable ingress, set Target port = 8080
- Image:
- Under Environment Variables:
- Add
SUPERBLOCKS_AGENT_KEY
(secret reference to a secret namedagent-key
) - Add
SUPERBLOCKS_ORCHESTRATOR_SUPERBLOCKS_KEY
(secret reference to a secret namedagent-key
) - Add
SUPERBLOCKS_AGENT_DATA_DOMAIN = app.superblocks.com
- Add
SUPERBLOCKS_ORCHESTRATOR_AGENT_HOST_URL = https://<your-app-url>
- Add
SUPERBLOCKS_ORCHESTRATOR_AGENT_TAGS = profile:*
- Add
- Under Secrets:
- Create a secret named
agent-key
with your Superblocks Agent Key value
- Create a secret named
- Click Create
Note: If using a private registry, provide full image path and configure credentials accordingly.
Verify Agent is Running
- Go to your Container App → Overview
- Check that the status is Running
- Copy the Application URL for later use in Superblocks
Final Steps
In Superblocks:
- Visit Superblocks > Settings > On-Prem Agents
- Confirm the agent appears as Active
Billable services
The Superblocks On-Premise Agent may make use of the following Azure services. Be aware of the pricing associated with these.
- Azure Container Apps - Serverless container platform with consumption-based pricing (includes free monthly grants of 180,000 vCPU-seconds, 360,000 GiB-seconds, and 2M requests)
- Azure Monitor & Log Analytics - Logging and monitoring solution for diagnostics (optional)
- Azure Key Vault - Secure secret storage for credentials and configuration (optional)
- Virtual Network - Network infrastructure for private deployments (optional)