Last active
August 17, 2020 01:38
-
-
Save xximjasonxx/48501320c1fbed25b11293af8e57ff3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("ApproveFile_Start")] | |
public static async Task HttpStart( | |
[BlobTrigger("files/{id}", Connection = "StorageAccountConnectionString")] Stream fileBlob, | |
string id, | |
[Table("metadata", "{id}", "{id}", Connection = "TableConnectionString")] FileMetadata metadata, | |
[Table("metadata", Connection = "TableConnectionString")] CloudTable metadataTable, | |
[DurableClient] IDurableOrchestrationClient starter, | |
ILogger log) | |
{ | |
// Function input comes from the request content. | |
string instanceId = await starter.StartNewAsync("ProcessFileFlow", new ApprovalWorkflowData { TargetId = id }); | |
metadata.WorkflowId = instanceId; | |
var replaceOperation = TableOperation.Replace(metadata); | |
var result = await metadataTable.ExecuteAsync(replaceOperation); | |
log.LogInformation($"Started orchestration with ID = '{instanceId}'."); | |
log.LogInformation("Flow started"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment