Skip to main content

Connection Configuration

flowforger.config.json tells the CLI how to write connection references when it emits Logic Apps JSON, how to generate DSL from existing flows, and how to sign in. flowforger init writes a starting version for a Dataverse environment (see App Registration).

File shape​

{
"auth": {
"clientId": "<client-id>",
"tenantId": "<tenant-id>",
"resources": {
"dataverse": "https://contoso.crm.dynamics.com",
"sharepoint": "https://contoso.sharepoint.com"
}
},
"global": {
"connections": {
"sharepoint": {
"referenceName": "shared_sharepointonline",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
"connectionReferenceLogicalName": "contoso_sharedsharepointonline_1a2b3",
"runtimeSource": "embedded"
}
},
"parser": {
"skipMetadataFields": ["operationMetadataId"],
"skipActionNamesForKinds": ["initializevariable", "setvariable"]
},
"generator": {
"argumentWhitespace": "spaced",
"multilineExpressions": "preserve"
},
"parity": {
"normalizeFunctionCase": true
}
},
"environments": {
"prod": {
"connections": {
"sharepoint": {
"referenceName": "shared_sharepointonline",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
"connectionReferenceLogicalName": "contoso_sharedsharepointonline_prod"
}
}
}
}
}
  • auth — Sign-in settings for --auth. Top level only; it is not overridden per environment. See --auth.
  • global — Settings used by every environment.
  • environments.<name> — Overrides applied with --config-env <name>.

Connections​

connections maps a connector name, as used in the flow (ctx.connectors.sharepoint, ctx.connectors.dataverse, ctx.connectors.office365, ...), to the Logic Apps connection reference its actions use:

FieldMeaning
referenceNameThe connection reference key in the flow definition, e.g. shared_sharepointonline. The connector actions point at it.
apiIdThe connector API, e.g. /providers/Microsoft.PowerApps/apis/shared_sharepointonline.
connectionReferenceLogicalNameThe logical name of the connection reference in your Dataverse solution, e.g. contoso_sharedsharepointonline_1a2b3.
runtimeSourceWritten into the connection reference as is. Default embedded.
Set connectionReferenceLogicalName

Without it, the emitter makes up a new logical name of the form new_<referenceName>_<random hex> every time it compiles, so each push points the flow at a connection reference that does not exist in the environment. flowforger init fills in the logical names of the connection references it finds in the environment; for any it leaves blank, copy the logical name from the connection reference in your solution.

A flow that declares its own connection references (ctx.flow.connectionReferences in the constructor, which every pulled flow does) keeps them as written. connections is then only used for connectors the flow uses without declaring a reference.

If a connector has no entry in connections at all, the emitter falls back to a built-in default referenceName/apiId for sharepoint, dataverse, wordonlinebusiness, excelonlinebusiness, teams, and onedriveforbusiness (an entry for the last three may also be keyed wordonline, excelonline or onedrive, the DSL's short namespace names). Other connectors (e.g. office365, office365users, office365groups) fall back to shared_<connector> with no apiId, so it's worth defining them explicitly.

To add a connector, add an entry under connections with its referenceName, apiId and connectionReferenceLogicalName.

Environments​

# Global config only
flowforger compile flow.ff.ts --emit logicapps --out clientdata.json --config flowforger.config.json

# With environment override
flowforger compile flow.ff.ts --emit logicapps --out clientdata.json --config flowforger.config.json --config-env prod

How an environment is applied depends on the section:

  • connections is replaced, not merged. When an environment defines connections, that object replaces the global one entirely. In the example above, --config-env prod knows only the sharepoint connection; a Dataverse action would get a generated logical name. Repeat every connector you need under the environment, not just the one you are overriding. This applies to compile, push and diff.
  • parser, generator and parity are merged key by key. An environment can change one option and keep the rest from global.

Generator, parser and parity options​

These shape the DSL that pull and generate-dsl write, and how parity and diff compare definitions. Each has a command-line flag that overrides the config value (generate-dsl).

OptionValues (default first)Effect
generator.argumentWhitespacespaced, compactfunc(a, b) or func(a,b) in generated expressions
generator.multilineExpressionspreserve, flattenKeep a multiline expression's formatting, or flatten it to one line
generator.expressionFidelitystrict, relaxedstrict keeps an expression verbatim in ctx.eval(...) when typed DSL would change its spacing or casing; relaxed always writes typed DSL
generator.descriptionStylelineComment, jsdocAction descriptions as // comments or @description tags
generator.skipDefaultConstructorfalse, trueLeave out a constructor that only holds boilerplate compile adds back
parser.skipMetadataFields[]Action metadata fields to drop when reading a flow, e.g. ["operationMetadataId"]. diff also ignores them.
parser.skipActionNamesForKinds[]Action kinds (lowercase) whose names are not kept, so the generator writes default names, e.g. ["initializevariable", "setvariable"]
parity.normalizeFunctionCasetrue, falseTreat @Trim(x) and @trim(x) as equal
parity.normalizeNumberstrue, falseTreat 100.00 and 100 as equal
parity.normalizeSpacestrue, falseTreat repeated spaces as one
parity.normalizeItemFunctiontrue, falseTreat item() and items('Loop') as equal

Which commands read the config​

CommandUsesWhere the file comes from
compileconnectionsOnly with --config
push, diffconnections (to compile a .ff.ts), parser/parity (for diff and push --expect-clean), auth with --auth--config, else flowforger.config.json in the working directory if present
pullparser, generator, auth with --auth--config, else flowforger.config.json in the working directory if present
generate-dsl, parity, optimizeparser, generator, parityOnly with --config
run, activate, runs, run-show, mcpauth with --auth; parser when reading a cloud run (run-show, run --replay-run)--config, else flowforger.config.json in the working directory
scopesauth.resources (optional, for the resource URLs)--config, else flowforger.config.json in the working directory if present
initWrites the file--out, default flowforger.config.json

--auth without a readable config file, or with a config that has no auth section, fails before any sign-in.