Open jikuja opened 1 year ago
Let's put this on hold.
Just after ticket creation I checked code internals and found this: https://github.com/Azure-Player/azure.datafactory.tools/blob/467cd6e023bbac18f883a44980726ceb2bfd58e8/private/Update-PropertiesFromFile.ps1#L122-L136
Never mind. This only controls of deployment fails or prints warning. Maybe Test-AdfCode
should have similar control but that off-topic for this ticket.
Also looks like Test-AdfCode cmdlet is hardcoded to fail with path errors: https://github.com/Azure-Player/azure.datafactory.tools/blob/467cd6e023bbac18f883a44980726ceb2bfd58e8/public/Test-AdfCode.ps1#L123-L137
My workaround
Test-AdfCode
failed$opt.FailsWhenPathNotFound = $false
into CDlinkedService,*,"-$.properties.connectVia",
into test-parameter file
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:
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:
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):
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:
Result:
ERROR: ADFT0010: Wrong path defined in config for object(path): linkedService.*(properties.connectVia)
Fourth try Parameters file:
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 ifproperties.connectVia
does not exist:Add
properties.connectVia
property to all linked services and ignore errors ifproperties.connectVia
already exists:Modify
properties.connectVia
property to all linked services and ignore errors ifproperties.connectVia
does not exists: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
propertyAdditional context N/A