ECS Tooling to HttpTriggered Azure Function

Hi,
we have been using ECS Tooling to generate index templates with custom schemas.
We plan to have that as HttpTriggered Azure Function which takes in custom schema in the request and generates template dynamically.
I have run into number of issues. ust wondering if anyone has successfully done so and can you please share here?

My init.py for the function (just generate with defaults for now )is as following:

import sys
import azure.functions as func
from .scripts.generator import main as m

def main(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')
    create = req.params.get('create')
    if create:
        try:
            m()
        finally:
            print(sys.argv)
            sys.argv = original_args
            print(sys.argv)    

        return func.HttpResponse("ECS Tooling create function executed successfully.")
    else:
        return func.HttpResponse(
             "This HTTP triggered function executed successfully.",
             status_code=200
        )

And btw, is packaging the ECS Tooling considered in future?

Any help will be greatly appreciated.

mm

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.