Paniz Asghari
Paniz Asghari

Reputation: 305

Automating Azure Logic App job creation and deployments

I am new to cloud and Azure, so I do not know how logical my thoughts seem. Please tell me if there are better approaches to solve the issue.

There is a SharePoint list of jobs with their corresponding Cron expressions. The jobs all execute same tasks but with different parameters and schedules.

What already is done is a logic app that is scheduled to run every 5 minutes to scan the list and run the jobs which match the current timestamp but I do not find it really logical. I was thinking of something like having a script which creates separate jobs for each list item (like dynamic DAG creation in Airflow based on a template); however, I cannot find any resources to learn how to do it.

Can I create separate logic apps by using JSON representations of tasks for each item in SharePoint list with their corresponding parameters and deploying them on Azure using a Python script?

Upvotes: 0

Views: 147

Answers (1)

SwethaKandikonda
SwethaKandikonda

Reputation: 8234

Below is something that you can follow to achieve your requirement, I have created the same flow as yours over logic apps expect for the part where I have added Azure function which creates separate jobs for each list item through HTTP trigger. Below is the flow of my logic app.

enter image description here

I'm using the below sample code in my Function.

import logging

import azure.functions as func

def main(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')

    body = req.params.get('name')

    return func.HttpResponse(f"{body}")

However, you can write your custom code inside it.

IN SHAREPOINT FILE

enter image description here

RESULTS:

enter image description here

Upvotes: 1

Related Questions