public static async Task Run([EventGridTrigger] JObject eventGridEvent, TraceWriter log)
        {
            Guid   newReqId = Guid.NewGuid();
            bool   result   = true;
            string reqId    = string.Empty;

            try
            {
                log.Info($"Start EncodeProcessing requestId: {newReqId} {eventGridEvent.ToString(Formatting.Indented)} ticks: {DateTime.Now.Ticks}");
                var eventGrid = eventGridEvent.ToObject <Event <VideoAssetData> >();
                reqId = eventGrid.Data.RequestId;
                IAsset asset = FaceHelper.GetAsset(eventGrid.Data.AssetName);
                if (asset != null)
                {
                    string assetName = eventGrid.Data.JobName + "_" + VideoAnalysisSteps.Encode;
                    await FaceHelper.EncodeToAdaptiveBitrateMP4Set(asset, assetName, ConfigurationManager.AppSettings["AMSPreset"]);

                    log.Info($"request {newReqId} for {reqId} started encode process, send event grid to start redactor process ticks: {DateTime.Now.Ticks}");
                }
                else
                {
                    log.Info($"request {newReqId} for {reqId} didn't start encode no related asset name {eventGrid.Data.AssetName} ticks: {DateTime.Now.Ticks}");
                }
            }
            catch (Exception ex)
            {
                log.Error($"Exception Message: {ex.Message}, requestId: {newReqId} for {reqId}, ticks: {DateTime.Now.Ticks}", ex);
                result = false;
            }
            string succeed = result ? "" : "unsuccessful";

            log.Info($"Finished {succeed} EncodeProcessing requestId: {newReqId} for {reqId} ticks: {DateTime.Now.Ticks}");
        }
        public static async Task Run([EventGridTrigger] JObject eventGridEvent, TraceWriter log, ExecutionContext executionContext)
        {
            Guid   newReqId = Guid.NewGuid();
            bool   result   = true;
            string reqId    = string.Empty;

            try
            {
                log.Info($"Start RedactorProcessing requestId: {newReqId} {eventGridEvent.ToString(Formatting.Indented)} ticks: {DateTime.Now.Ticks}");
                var eventGrid = eventGridEvent.ToObject <Event <VideoAssetData> >();
                reqId = eventGrid.Data.RequestId;
                IAsset asset = FaceHelper.GetAsset(eventGrid.Data.AssetName);
                if (asset != null)
                {
                    string assetName  = eventGrid.Data.JobName + "_" + eventGrid.Data.Step;
                    string configFile = Directory.GetParent(executionContext.FunctionDirectory).FullName + "\\config.json";
                    await FaceHelper.RunFaceRedactionJob(asset, assetName, configFile, log);

                    log.Info($"request {newReqId} for {reqId} started redactor process send event grid to start copy process ticks: {DateTime.Now.Ticks}");
                }
                else
                {
                    log.Info($"request {newReqId} for {reqId} didn't start redactor no related asset name {eventGrid.Data.AssetName} ticks: {DateTime.Now.Ticks}");
                }
            }
            catch (Exception ex)
            {
                log.Error($"Exception Message: {ex.Message}, requestId: {newReqId} for {reqId}, ticks: {DateTime.Now.Ticks}", ex);
                result = false;
            }
            string succeed = result ? "" : "unsuccessful";

            log.Info($"Finished {succeed} RedactorProcessing requestId: {newReqId} for {reqId} ticks: {DateTime.Now.Ticks}");
        }
        public static async Task Run([EventGridTrigger] JObject eventGridEvent, TraceWriter log, ExecutionContext executionContext)
        {
            Guid   newReqId = Guid.NewGuid();
            bool   result   = true;
            string reqId    = string.Empty;

            try
            {
                log.Info($"Start CopyFaceProcessing requestId: {newReqId} {eventGridEvent.ToString(Formatting.Indented)} ticks: {DateTime.Now.Ticks}");
                var eventGrid = eventGridEvent.ToObject <Event <VideoAssetData> >();
                reqId = eventGrid.Data.RequestId;
                IAsset asset = FaceHelper.GetAsset(eventGrid.Data.AssetName);
                if (asset != null)
                {
                    Func <string, bool> op = FaceHelper.IsPictureType;
                    if (eventGrid.Data.PrevStep == VideoAnalysisSteps.Subclip)
                    {
                        op = FaceHelper.IsVideoType;
                    }
                    string container  = eventGrid.Data.ContainerName;
                    string sourceConn = ConfigurationManager.AppSettings["myamsconn"];
                    string targetConn = ConfigurationManager.AppSettings["myblobconn"];
                    await FaceHelper.CopyFromAssetToBlob(asset, sourceConn, targetConn, container, eventGrid.Data.VideoName, op);

                    log.Info($"request {newReqId} for {reqId} completed copy process to {container} ticks: {DateTime.Now.Ticks}");
                }
                else
                {
                    log.Info($"request {newReqId} for {reqId} didn't start copy no related asset name {eventGrid.Data.AssetName} ticks: {DateTime.Now.Ticks}");
                }
            }
            catch (Exception ex)
            {
                log.Error($"Exception Message: {ex.Message}, requestId: {newReqId} for {reqId}, ticks: {DateTime.Now.Ticks}", ex);
                result = false;
            }
            string succeed = result ? "" : "unsuccessful";

            log.Info($"Finished {succeed} CopyFaceProcessing requestId: {newReqId} for {reqId} ticks: {DateTime.Now.Ticks}");
        }