Skip to content

Job Development

github-actions[bot] edited this page Apr 13, 2026 · 5 revisions

Job Development

job-development-overview

You can write, compile, and deploy C# and Python automation jobs from an in-browser Monaco editor with AI code assistance β€” no local tooling required beyond a web browser. For complex jobs that benefit from full IDE support and debugging, a Visual Studio-based workflow is also available.


What is a Job?

what-is-a-job

A job is a unit of work packaged as a NuGet package (.nupkg). Each package contains code files, configuration, and dependency metadata. When a job is triggered, the Agent downloads the package from Azure Blob Storage, extracts it, resolves dependencies, and executes the code.


Supported Languages

Language Entry Point Execution Method
C# BlazorDataOrchestratorJob.ExecuteJob() in main.cs Compiled and executed via CS-Script/Roslyn
Python execute_job() function in main.py Executed via Python subprocess

The language is set via the SelectedLanguage field in configuration.json inside the NuGet package (valid values: CSharp or Python).


Package Structure

BlazorDataOrchestrator.Job.1.0.nupkg
β”œβ”€β”€ BlazorDataOrchestrator.Job.nuspec        # Package manifest with dependencies
└── contentFiles/
    └── any/
        └── any/
            β”œβ”€β”€ configuration.json            # Language and settings
            β”œβ”€β”€ main.cs (or main.py)          # Primary code file
            β”œβ”€β”€ additional-file.cs            # Optional additional code files
            β”œβ”€β”€ appsettings.json              # Default configuration
            β”œβ”€β”€ appsettingsProduction.json    # Production overrides
            └── appsettingsStaging.json       # Staging overrides (optional)

Job Execution Pipeline

sequenceDiagram
    autonumber
    participant Trigger as ⚑ Trigger<br/>(Schedule / Manual / Webhook)
    participant Web as πŸ’» Web App
    participant Queue as πŸ“¨ Azure Queue
    participant Agent as πŸ€– Agent Worker
    participant Blob as πŸ“„ Blob Storage
    participant Code as πŸ“œ Job Code

    Trigger->>Web: Initiate job run
    Web->>Web: Create JobInstance record
    Web->>Queue: Send JobQueueMessage
    Agent->>Queue: Receive message
    Agent->>Blob: Download .nupkg
    Agent->>Agent: Extract & validate package
    Agent->>Agent: Resolve NuGet dependencies
    Agent->>Agent: Load appsettings for environment
    Agent->>Code: Execute main.cs / main.py
    Code-->>Agent: Execution logs
    Agent->>Agent: Update JobInstance status
Loading

C# Job Template

A minimal C# job looks like this:

using System;

public class BlazorDataOrchestratorJob
{
    public static void ExecuteJob()
    {
        Console.WriteLine("Hello from Blazor Data Orchestrator!");
        // Your job logic here
    }
}

Adding NuGet Dependencies

Declare dependencies in the .nuspec file:

<?xml version="1.0" encoding="utf-8"?>
<package>
  <metadata>
    <id>BlazorDataOrchestrator.Job</id>
    <version>1.0.0</version>
    <description>My job package</description>
    <authors>Author</authors>
  </metadata>
  <dependencies>
    <dependency id="Newtonsoft.Json" version="13.0.3" />
    <dependency id="Dapper" version="2.1.35" />
  </dependencies>
</package>

Dependencies are resolved automatically at execution time via dotnet restore. Transitive dependencies are included.

You can also use CS-Script syntax in- code for quick dependency references:

//css_nuget Newtonsoft.Json

Python Job Template

A minimal Python job:

def execute_job():
    print("Hello from Blazor Data Orchestrator!")
    # Your job logic here

execute_job()

Python dependencies can be listed in a requirements.txt file within the package.


Environment-Specific Configuration

Jobs can include per-environment configuration files. The Agent loads the appropriate file based on the job's JobEnvironment setting:

Environment Config File
Development (default) appsettings.json
Production appsettingsProduction.json
Staging appsettingsStaging.json

The Agent also merges its own connection strings into the job's configuration at runtime, so jobs can access shared infrastructure (database, storage, etc.) without hardcoding credentials.


Development Options

Choose the approach that best fits your workflow:

Approach Description Best For
Online Editor Write code directly in the browser using the Monaco editor Quick edits, simple jobs, no local tooling needed
Visual Studio Develop jobs locally using the Job Creator Template project Complex jobs, full IDE support, debugging

Back to Home

Clone this wiki locally