public async Task AMS_Encode( [ActivityTrigger] IDurableActivityContext activityContext, ILogger log) { try { string inputValue = activityContext.GetInput <string>(); var data = JsonConvert.DeserializeObject <ConfigAssetDTO>(inputValue); var assetAMS = await _amsService.GetAssetAMS(data.AssetID); assetAMS.Status = "encoding"; await _amsService.UpdateAssetAMS(assetAMS.Id, assetAMS); var ams = await _amsService.GetCredentialAsync(JsonConvert .DeserializeObject <Credential>(envAmsCredential)); IAzureMediaServicesClient client = ams.Client; await _amsService.GetOrCreateTransformAsync(client, ams.ResourceGroup, ams.AccountName, envEncoderName); _ = await _amsService.CreateOutputAssetAsync(client, ams.ResourceGroup, ams.AccountName, data.OutputName, assetAMS.Filename); _ = await _amsService.SubmitJobAsync(client, ams.ResourceGroup, ams.AccountName, envEncoderName, data.JobName, data.InputName, data.OutputName); } catch (Exception e) { log.LogError("==================================================="); log.LogError(e.Message); log.LogError(e.StackTrace); log.LogError("==================================================="); throw new FunctionFailedException(e.Message); } }