Service: .NET Runner - EyevinnOSC/community GitHub Wiki

.NET Runner

The .NET Runner (serviceId eyevinn-dotnet-runner) deploys an ASP.NET Core application from a Git repository as a public, long-running service instance in Eyevinn Open Source Cloud (OSC). OSC builds the application from the repository and hosts it with a public HTTPS URL, so no Dockerfile is needed. Source: Eyevinn/dotnet-runner.

For private code that needs CI/CD and HA, use My Apps instead. The .NET Runner is intended for open source .NET projects exposed as a shared service instance.

What it can do

  • Build and run an ASP.NET Core app straight from a public Git repository (or a private one with an access token).
  • Target a branch (#branch suffix on the URL) or a subdirectory of the repository.
  • Override the build command and the entry DLL when auto-detection is not enough.
  • Load environment variables for the app from an App Config Service instance.

Creating an instance

The application must listen on the port given by the PORT environment variable:

var builder = WebApplication.CreateBuilder(args);
var port = Environment.GetEnvironmentVariable("PORT") ?? "8080";
builder.WebHost.UseUrls($"http://0.0.0.0:{port}");

var app = builder.Build();
app.MapGet("/health", () => "OK");
app.Run();

Push the code to a Git host reachable over HTTPS. Then call create-service-instance with serviceId: "eyevinn-dotnet-runner":

{ "name": "myapp", "SourceUrl": "https://github.com/myorg/myapp#main" }

Check that it runs with wait-for-service-ready or get-instance-status, and use describe-service-instance to read the URL. The instance is reachable at https://<name>.eyevinn-dotnet-runner.auto.prod-se.osaas.io. Use get-logs-for-instance to see build and runtime output.

Options

Option Required Type Meaning
name Yes string Name of the instance. Alphanumeric/underscore only (^\w+$), at most 20 characters.
SourceUrl Yes string HTTPS URL to the Git repository with the .NET application. Append #branch to use a specific branch, for example https://github.com/myorg/myapp#main. Also aliased as GITHUB_URL.
GitHubToken No string, sensitive Personal access token for private repositories; not needed for public ones. Alias for GIT_TOKEN.
OscAccessToken No string, sensitive OSC personal access token. Required when ConfigService is set, so the runner can read the config service.
ConfigService No string Name of an App Config Service instance to load additional environment variables from. Requires OscAccessToken.
ConfigApiKey No string, sensitive API key used to decrypt secret parameters from the parameter store before they are injected as environment variables. Must be used together with OscAccessToken and ConfigService.
SubPath No string Subdirectory within the repository where the .NET project is located, for example src/Api.
OscBuildCmd No string Replaces the auto-detected dotnet publish build command.
OscEntry No string Entry DLL filename inside the published output, for example MyApp.dll. Without it the runner uses the first .dll found in /app/published/ (excluding .deps.dll files).

Store GitHubToken, OscAccessToken and ConfigApiKey as service secrets with create-service-secret (serviceId eyevinn-dotnet-runner) and pass them as {{secrets.NAME}}; the reference must be the entire field value. Overwriting a secret does not restart a running instance.

Using the instance

To give the app environment variables (connection strings, API keys, feature flags):

  1. Create an App Config Service instance (eyevinn-app-config-svc) and populate its key-value pairs.
  2. Create the .NET Runner instance with ConfigService set to that instance name and OscAccessToken set to your OSC personal access token (as a secret).

Example with branch and subdirectory:

{ "name": "myapi", "SourceUrl": "https://github.com/myorg/monorepo#main", "SubPath": "src/Api" }

OSC CLI equivalents:

osc create eyevinn-dotnet-runner myapp -o SourceUrl="https://github.com/myorg/myapp"
osc create eyevinn-dotnet-runner myapi -o SourceUrl="https://github.com/myorg/monorepo#main" -o SubPath="src/Api"
osc list eyevinn-dotnet-runner
osc remove eyevinn-dotnet-runner myapp

Resources

⚠️ **GitHub.com Fallback** ⚠️