Hello Narender Kumar,
I'm glad that you were able to find a workaround for the ask, and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:
When ADF is connected to GIT, how to create a trigger in the main branch using the APIs(how to prevent replacing everything in the live mode)
Solution:
- Create the trigger using API in live mode.
- Get the trigger details as JSON using the get trigger API.
- Place the JSON as a trigger file in the main branch.
This way trigger will be created in both live mode and the main branch.
Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped so that others in the community facing similar issues can easily find the solution.