Docker Desktop
Required to run the containerized Bifrost environment
Set up a local Bifrost environment for developing and debugging workflows
This guide shows you how to set up a local Bifrost environment for developing workflows using the bifrost-workspace project.
Running ./start.sh will start a complete Bifrost environment locally:
Docker Desktop
Required to run the containerized Bifrost environment
VS Code
Recommended for debugging workflows with breakpoints (with Python extension)
Azure Resources
You’ll need an Entra ID App Registration for authentication. You can create a dedicated dev app registration or use your production one.
Create App Registration:
http://localhost:4280/.auth/login/aad/callbackYour App Registration (not your user account) needs the Key Vault Secrets Officer role on your Key Vault.
Assign the Role:
Web PubSub enables real-time updates in the web interface. Without it, you’ll need to refresh the page to see workflow execution updates.
You can use your production Web PubSub instance or create a free-tier instance for development:
Clone the workspace repository:
git clone https://github.com/jackmusick/bifrost-workspace.gitcd bifrost-workspaceCopy the example environment file:
cp .env.example .envEdit .env with your credentials:
# Azure Entra ID (App Registration)ENTRA_TENANT_ID=your-tenant-idENTRA_CLIENT_ID=your-app-client-idENTRA_CLIENT_SECRET=your-app-client-secret
# Azure Key Vault URLAZURE_KEY_VAULT_URL=https://your-vault-name.vault.azure.net/
# Web PubSub (optional but recommended)WebPubSubConnectionString=your-connection-stringMake start script executable:
chmod +x ./start.sh ./stop.sh| Variable | Required | Description |
|---|---|---|
ENTRA_TENANT_ID | Yes | Your Entra ID tenant ID |
ENTRA_CLIENT_ID | Yes | App Registration client ID |
ENTRA_CLIENT_SECRET | Yes | App Registration client secret |
AZURE_KEY_VAULT_URL | Yes | Key Vault URL (can be production) |
WebPubSubConnectionString | No | Web PubSub connection string (free tier recommended) |
ENABLE_DEBUGGING | No | Enable debugpy for breakpoints (default: true) |
FUNCTIONS_WORKER_PROCESS_COUNT | No | Worker processes (must be 1 when debugging, default: 1) |
Simply run the start script:
./start.shThe script will:
.env file (prompts to create if missing)Once started, you’ll have:
Create Python files in the /workspace directory. These files will be automatically mounted into the container.
def run(context): """ Simple workflow example
Args: context: OrganizationContext containing org, caller, execution_id """ print(f"Hello from workflow!") print(f"Organization: {context.org.name if context.org else 'No org'}") print(f"Caller: {context.caller.email}")
return { "status": "success", "message": "Workflow completed successfully" }See the Workflows Guide for more information on writing workflows.
One of the major benefits of local development is the ability to debug workflows with breakpoints.
Ensure the environment is running:
./start.shOpen the workspace in VS Code:
code .Set breakpoints in your Python workflow files by clicking in the gutter next to line numbers
Start debugging: Press F5 or go to Run and Debug → Attach to Docker Functions
Trigger your workflow from the web interface at http://localhost:4280
Debugger pauses at your breakpoints. You can now:
The workspace includes a pre-configured .vscode/launch.json that attaches to debugpy running on port 5678 inside the container.
Path Mappings:
${workspaceFolder}/workspace/mounts/workspaceMonitor what’s happening in your containers:
# All servicesdocker compose logs -f
# Just the API (workflow engine)docker compose logs -f api
# Just the client (web interface)docker compose logs -f clientWhen you’re done developing:
./stop.shOr manually:
docker compose downCheck if the required ports are already in use:
# Check for port conflictslsof -i :4280 # Clientlsof -i :7071 # APIlsof -i :5678 # DebugpyKill any conflicting processes or modify the ports in docker-compose.yml.
Verify your .env file has the correct:
ENTRA_CLIENT_IDENTRA_CLIENT_SECRETENTRA_TENANT_IDAnd that your App Registration has:
http://localhost:4280/.auth/login/aad/callbackEnsure your App Registration (not your user) has the Key Vault Secrets Officer role:
# Check role assignmentsaz role assignment list --scope /subscriptions/{subscription-id}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{vault-name}Look for your App Registration’s client ID with the b86a8fe4-44ce-4948-aee5-eccb2c155cd7 role (Key Vault Secrets Officer).
ENABLE_DEBUGGING=true in .envFUNCTIONS_WORKER_PROCESS_COUNT=1 in .envdocker compose logs api | grep debugpy./stop.sh && ./start.shRegenerate type stubs:
./start.sh # Downloads latest types automaticallyOr manually download from GitHub Releases.
Writing Workflows
Learn how to create powerful automation workflows
AI Coding Guide
Use AI assistants to help write workflows faster
SDK Reference
Explore the complete Bifrost SDK API