npx skills add ...
npx skills add equinor/fusion-skills --skill 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 state. DO NOT USE FOR: application code changes, service deployments, role management, or infrastructure other than databases.
npx skills add equinor/fusion-skills --skill fusion-infra-cli
Use when a Fusion service database needs to be provisioned or migrated — locally during development or inside CI/CD pipelines.
Typical triggers:
fusion-roles-cliInstall finf as a .NET global tool:
Update to latest:
Auth uses DefaultAzureCredential automatically (picks up az login session). Pass -t <token> to override.
The config file defines the database resource. Minimal example (db-config.json):
Full config with SQL permissions:
See references/db-config-schema.md for the full schema.
CI / non-production:
QA:
Production (add --production flag):
Pull Request (ephemeral database, copies from CI):
After provisioning, apply SQL migrations:
The -m flag accepts a directory of .sql files or a single .sql file.
| Key | Purpose |
|---|---|
ci | Continuous integration |
fqa | QA / pre-production |
fprd | Production (requires --production flag) |
pr | Pull request ephemeral (requires -pr and -ghr) |
For complete flag reference, run:
Or see the source documentation:
--verbose in pipelines to get diagnostic output-o response.json so pipeline steps can reference the result--production flag is an explicit guard — never omit it for fprd provisioning-tdatabase delete is irreversible for non-PR databases — confirm with user before running{
"name": "my-service",
"environment": "ci"
}{
"name": "my-service",
"environment": "fqa",
"sqlPermission": {
"owners": [
{ "clientId": "<app-registration-client-id>" }
],
"contributors": [
{ "clientId": "<app-registration-client-id>" }
]
}
}finf database provision -f db-config.json -e ci \
--sql-owner-client-id <client-id> \
--sql-contributor-client-id <client-id> \
-o response.json --verbosefinf database provision -f db-config.json -e fqa \
--sql-owner-client-id <client-id> \
--sql-contributor-client-id <client-id> \
-o response.json --verbosefinf database provision -f db-config.json -e fprd \
--production \
--sql-owner-client-id <client-id> \
--sql-contributor-client-id <client-id> \
-o response.json --verbosefinf 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# 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 --verbosefinf database provision --help
finf database migrate --help