Skip to content
OpenSmartRoute
Skillv1.0.0

fusion-infra-cli

Provision and migrate Fusion databases using the fusion-infra-cli (finf). USE FOR: provision a database for a service, run SQL migrations, provision PR-specific ephemeral databases, check database sta

by equinor(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from equinor/fusion-skills (skills/fusion-infra-cli/SKILL.md). Install upstream with npx skills add equinor/fusion-skills --skill fusion-infra-cli. Copyright stays with the author (MIT).

Fusion Infra CLI

When to use

Use when a Fusion service database needs to be provisioned or migrated — locally during development or inside CI/CD pipelines.

Typical triggers:

  • "Provision the database for the context service"
  • "Run migrations on the QA database"
  • "Set up a PR database for this pull request"
  • "What does the database provision config look like?"
  • "The pipeline is failing on the database provision step"
  • "Create a PR database that copies from CI"

When not to use

  • Application code or service changes — use the service repo
  • Role or permission management — use fusion-roles-cli
  • Infrastructure other than databases (networking, storage, etc.)
  • Kubernetes or container management

Prerequisites

Install finf as a .NET global tool:

dotnet tool install --global \
  --add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
  Fusion.Infra.Cli

Update to latest:

dotnet tool update --global \
  --add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
  Fusion.Infra.Cli

Auth uses DefaultAzureCredential automatically (picks up az login session). Pass -t <token> to override.

Core workflow — provision a database

1. Create the provisioning config file

The config file defines the database resource. Minimal example (db-config.json):

{
  "name": "my-service",
  "environment": "ci"
}

Full config with SQL permissions:

{
  "name": "my-service",
  "environment": "fqa",
  "sqlPermission": {
    "owners": [
      { "clientId": "<app-registration-client-id>" }
    ],
    "contributors": [
      { "clientId": "<app-registration-client-id>" }
    ]
  }
}

See references/db-config-schema.md for the full schema.

2. Run provisioning

CI / non-production:

finf database provision -f db-config.json -e ci \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

QA:

finf database provision -f db-config.json -e fqa \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

Production (add --production flag):

finf database provision -f db-config.json -e fprd \
  --production \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

Pull Request (ephemeral database, copies from CI):

finf database provision -f db-config.json \
  -e pr -pr <pr-number> -ghr "equinor/my-repo" -c ci \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  --timeout 500 -o response.json --verbose

3. Run migrations

After provisioning, apply SQL migrations:

# Non-production
finf database migrate -d sql-myservice-fqa -m migrations/ \
  -o migrations.json --verbose

# Production
finf database migrate -d sql-myservice-fprd -m migrations/ \
  --production -o migrations.json --verbose

The -m flag accepts a directory of .sql files or a single .sql file.

Environments

Key Purpose
ci Continuous integration
fqa QA / pre-production
fprd Production (requires --production flag)
pr Pull request ephemeral (requires -pr and -ghr)

Full reference

For complete flag reference, run:

finf database provision --help
finf database migrate --help

Or see the source documentation:

Safety

  • Always use --verbose in pipelines to get diagnostic output
  • Always save output with -o response.json so pipeline steps can reference the result
  • The --production flag is an explicit guard — never omit it for fprd provisioning
  • Never pass raw tokens in pipeline YAML — use secret variables and pass via -t
  • database delete is irreversible for non-PR databases — confirm with user before running

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/equinor-fusion-skills-fusion-infra-cli/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

equinor-fusion-skills-fusion-infra-cli.ocm.jsonjson
{
  "ocm": "1",
  "id": "equinor-fusion-skills-fusion-infra-cli",
  "kind": "skill",
  "name": "fusion-infra-cli",
  "description": "Provision and migrate Fusion databases using the fusion-infra-cli (finf). USE FOR: provision a database for a service, run SQL migrations, provision PR-specific ephemeral databases, check database state. DO NOT USE FOR: application code changes, service deployments, role management, or infrastructure other than databases.",
  "publisher": "equinor",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "data_analysis"
    ],
    "tags": [
      "skill-md",
      "fusion",
      "infra",
      "database",
      "cli",
      "provisioning",
      "migrations",
      "devops",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Provision and migrate Fusion databases using the fusion-infra-cli (finf). USE FOR: provision a database for a service, run SQL migrations, provision PR-specific ephemeral databases, check database state. DO NOT USE FOR: application code changes, service deployments, role management, or infrastructure other than databases."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/equinor/fusion-skills",
      "path": "skills/fusion-infra-cli/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/equinor/fusion-skills/blob/HEAD/skills/fusion-infra-cli/SKILL.md",
      "key": "equinor/fusion-skills/skills/fusion-infra-cli/SKILL.md"
    },
    "compatibility": "Requires finf installed as a .NET global tool from the Fusion-Public NuGet feed. Requires Azure CLI login (az login) or explicit token via -t flag.\n",
    "license": "MIT"
  },
  "instructions": "# Fusion Infra CLI\n\n## When to use\n\nUse when a Fusion service database needs to be provisioned or migrated — locally during development or inside CI/CD pipelines.\n\nTypical triggers:\n- \"Provision the database for the context service\"\n- \"Run migrations on the QA database\"\n- \"Set up a PR database for this pull request\"\n- \"What does the database provision config look like?\"\n- \"The pipeline is failing on the database provision step\"\n- \"Create a PR database that copies from CI\"\n\n## When not to use\n\n- Application code or service changes — use the service repo\n- Role or permission management — use `fu",
  "cost": {
    "context_tokens": 1070
  }
}

Fetch it by URL: GET /api/v1/registry/equinor-fusion-skills-fusion-infra-cli/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.