Azure Data Factory Pipeline trigger not showing same values in UI as it does via CLI and CLI commands not updating some triggers

mao 1 Reputation point
2021-07-20T18:23:55.203+00:00

Hi,

I have 2 data factories with several pipelines and scheduled triggers to call these. One of the data factories runs in live mode whilst the other is it GIT mode and tied to a repo/branch.

Recently I tried to update the schedule the triggers run on via Azure CLI with the following commands to stop / update / start each of the triggers:

az datafactory trigger stop --factory-name <factory name> --resource-group <rg-name> --name <trigger name>

az datafactory trigger stop --factory-name <factory name> --resource-group <rg-name> --name <trigger name> --set properties.recurrence.schedule.hours=[9]

az datafactory trigger stop --factory-name <factory name> --resource-group <rg-name> --name <trigger name> --set properties.recurrence.schedule.minutes=[3]

az datafactory trigger stop --factory-name <factory name> --resource-group <rg-name> --name <trigger name>

The responses all seem to be correct with --debug enabled on the above commands, including the updated values for the trigger schedules. This command also shows the triggers with updated values:

az datafactory trigger show --factory-name <factory name> --resource-group <rg-name> --name <trigger name>

I have found that although most work some of the triggers do not run to the expected updated schedule and none of the triggers in the Azure portal Datafactory UI show the updated values.

Can someone please explain where I'm going wrong here or what the correct process is for working with trigger schedules in CLI and web UI?

Is the Data factory tied to GIT maybe showing the GIT schedule values in the UI but accepting changes via CLI in the background? The live mode is also behaving the same so I'm not sure whats going on.

Thanks

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,676 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,086 Reputation points
    2021-07-21T20:42:25.72+00:00

    Hello @mao and welcome to Microsoft Q&A. Please allow me to explain some things.

    As you have noticed, there are two modes, GIT and Factory mode.

    GIT mode reflects what is held in the GIT repo, it loads all objects using GIT as the source of truth. This is only available when you have a GIT /ADO integration.

    Factory mode reflects what triggers and pipelines are running off of. This is updated on Publishing. The is the source of truth for anything running (except debug/sandbox).

    These two modes are separate. Only when the collaboration branch of GIT is published, is the Factory mode updated to match the GIT mode.

    With these two modes and their relation explained, I now move on to how the CLI , Powershell, SDK, or API relate.

    The CLI, Powershell, SDKs and REST API, all directly work on the Factory mode. They have no way to interact with the GIT repo, and so have no affect on GIT mode. The only exception, is altering or removing the repo integration settings. Still, this doesn't change the repo, it only changes which repo will be used by the UI.

    Only the UI can work with GIT mode. Only the UI can push changes to the repo. Only the UI can read from the repo.

    This means when you use the CLI, you are making a partial publish, and ignoring the GIT repo. This causes the two to fall out of sync and will likely cause problems later.

    This also means, the CLI is useful if for some reason you need to stop a trigger, but are not in a position to do a full publish. I advise against using the CLI to author while a GIT/ADO integration is present.

    Does this explain what you are seeing?

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.