Azure Datafactory V2 - IfCondition activity cannot include another IfCondition activity - azure

I'm using Azure Data factory V2 and I need to implement two levels of checks with in a parent check validation. example: IF Condition one is true Then I need to check for Condition 2. And, If Condition2 is True then Check for Condition 3.
It's kind of hierarchical checks. When I implement using multiple IF Condition activities within parent IF condition activity, then it doesn't work. I do see following error, when i implement it.
"ERROR: IfCondition activity cannot include another IfCondition activity"

ADF- V2 doesn't support multiple IfCondition activities with in a single pipeline.
So as a workaround, we used multiple filter activities upfront and split the pipeline flow before IfCondition Activity is invoked.
Thanks

You can use some of the dynamic functions to implement a more complex logic with and() and or().
You can put several continuous if's that set up variables, and use those variables to determine the outcome at the end.
And if that doesn't work for you, or you don't feel like it, you can always Execute a Pipeline inside of the If that uses another If Activity. But I wouldn't recommend this if you want to keep your monitor as easy to read as possible since it launches another pipeline (or more than one)

Related

ARM Template - How to reference a copyIndex() deployment output?

I deploy 30 SQL databases via copyIndex() as sub deployments of the main deployment, I want to be able to reference the outputs of the dynamic deployments when kicking off another deployment. Once all the databases are deployed, I want to then all Azure Monitor metric rules to the DBs, and need their resourceIds (the Output of the db deploy).
The answer here sounds exactly like what I'm trying to do, and I understand that each deployment is chained to have the output of the previous deploy. But then if I want to use the chained up "state" output, is it the very last element in the array that has the full chain? If so is the best way to reference that to just build up the name of the deployment and append on the length of the copyIndex array?
reference(concat('reference', length(variables('types'))).outputs.state.value
As so?
yes, you basically need to construct a name that is the name of the deployment:
referenceX
where X is the number of the last deployment, you can use length() function for that exactly as you suggest it.
the above will work only if you gather the output from all the intermediate steps, obviously

Skip function invocation and return value with custom function filter

I am wanting to share some logic between multiple functions which now seems to be partially achievable by using Function Filters within azure functions however in certain cases I don't want to continue execution of the function and be able to return a result back to the binding provider (same as returning a result from the function it's self).
Taking a look at the code the only way to short circuit the calling of the inner IFunctionInvoker within FunctionInvocationFilterInvoker is to throw an exception inside the custom invocation filter. The only problem with this approach is that the exception will bubble up to the host and cause a failure/retries etc.. somewhere else.
Also taking this approach doesn't allow me to set another return value back binding provider. I did see that we could wrap this in our own IFunctionInvoker but I was wondering if there was a better way to achieve this?
Code executing filters
Not possible yet, but this is something we'll definitely enable. We're tracking this capability in our repo here.

Cucumber reuse value from previously run scenario

I am trying to reuse a value that was created during the previously run scenario. I am not sure if there is a way in cucumber to make a value available across scenarios.
For instance:
1st scenario:
Given inputOfA
When A is created
Then A is returned
And A contains an Id
2nd Scenario:
Given IdOfA
When customer gets A by Id
Then A is returned.
For the 2nd scenario, it would be great if I can get the Id created from the first without having to persist it anywhere.
Can any of you let me know if this is possible using cucumber or do I have to persist the Id created in the first scenario?
This is not something you want.
It would require the scenarios to be executed in a specific order. The scenario execution order isn't specified. It may even be random.
What you want scenarios that are independent. Scenarios you can execute in any order.
If you want to use the result from one scenario in a future scenario, you want to setup the second scenario to execute the same thing as the previous scenario should have done. This may feel like duplication and maybe it is. But the usage of BDD is to drive the implementation. The first scenario was used to drive some behaviour. The second scenario should be used to drive another behaviour.
It is possible that the first scenario can be deleted when the second is implemented. If it is redundant, remove it.
But whatever you do, avoid the path of scenarios that depends on each other. It will only lead to a bad place with seemingly random errors occurring.

Is there a way to call or reference cucumber scenario from a step or step definition?

I have various env configurations (each one of them is setup via a particular scenario). I want to reference one or more env scenario in my feature tests. I cannot use background since for same test case I have to iterate through all or most of the environments.
If I could reference a scenario (not step, which I know is doable in cucumber) from another step or step definition that could solve my problem.
One way to solve this problem is to have data table or set of data tables for env setup and reference those tables (via key) to the current scenario. Defining the data in "fixtures" and defining the behavior in ruby. But by that way I will be bypassing the cucumber layer, which I want to avoid.
I feel cucumber has some short comings in case of scenario reuse. Scenario is collection of data and behavior, which we should be able to reuse.

Do I need two different PartnerLinks for two different calls to the same Web Service in BPEL?

If I want to make two parallel calls (in one flow activity) to the same web service in BPEL, do I need to create two different PartnerLinks or can I use the same one?
You can invoke the same partnerLink multiple times in parallel in the same flow. You do not need to define a new one.
If you expect a result from the invocation, you need different outputVariables, however. If you write to the same variable in parallel, you will have race conditions just like in any other programming language.

Resources