Skip to content

Force flag for parameters file path entry #308

Description

@jikuja

Is your feature request related to a problem? Please describe.
We have configured dev environment to use SHIR on some environment and remaining are using default AzureIR.

JSON snippets from DEV:

{
    "name": "xREST",
    "properties": {
        "annotations": [],
        "type": "RestService",
        "typeProperties": {
            // snip
        },
        "connectVia": {
            "referenceName": "SharedVMSHIR",
            "type": "IntegrationRuntimeReference"
        }
    }
}
{
    "name": "other",
    "properties": {
        "annotations": [],
        "type": "RestService",
        "typeProperties": {
            // snip
        }
        // no connectVia when default AzureIR configured on portal
    }
}

I would like to set default integration runtime on test/prod on all linked services and then override setting if needed.

First try
Parameter file:

linkedService,*,"-$.properties.connectVia",

Result: ERROR: ADFT0010: Wrong path defined in config for object(path): linkedService.*(properties.connectVia)

Second try
Parameter file(not sure if this is correct alternative for absent connectVia property):

linkedService,*,"+$.properties.connectVia","{'referenceName': 'AutoResolveIntegrationRuntime','type': 'IntegrationRuntimeReference'}"

Result: ERROR: Cannot add a member with the name "connectVia" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.

Third try
Parameter file:

linkedService,*,"$.properties.connectVia","{'referenceName': 'AutoResolveIntegrationRuntime','type': 'IntegrationRuntimeReference'}"

Result: ERROR: ADFT0010: Wrong path defined in config for object(path): linkedService.*(properties.connectVia)

Fourth try
Parameters file:

linkedService,xREST,"-$.properties.connectVia",

Result: No errors

So it looks like I need to edit linked services one-by-one basis instead of setting default value for all.

Describe the solution you'd like
Support force modifier. E.g.

Remove all properties.connectVia properties from linked services and ignore errors if properties.connectVia does not exist:

#linkedService,*,"-*$.properties.connectVia",

Add properties.connectVia property to all linked services and ignore errors if properties.connectVia already exists:

#linkedService,*,"+*$.properties.connectVia","{'referenceName': 'AutoResolveIntegrationRuntime','type': 'IntegrationRuntimeReference'}"

Modify properties.connectVia property to all linked services and ignore errors if properties.connectVia does not exists:

linkedService,*,"*$.properties.connectVia","{'referenceName': 'AutoResolveIntegrationRuntime','type': 'IntegrationRuntimeReference'}"

Describe alternatives you've considered
AFAIK only other option is to handle resource one-by-one. That adds maintenance burden with parameter files.

For this particular use case we just probably need to edit parameter files every time we move a new linked service to use SHIR and make deployment process to remove connectVia property

Additional context
N/A

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestnice to haveNew feature, low-priority as "nice to have" in the module

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions