Last active
April 24, 2018 17:29
-
-
Save derek1ee/65eee5655680f7ae13cae7573a24a226 to your computer and use it in GitHub Desktop.
VideoIndexerTemplate
This file contains hidden or 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
| { | |
| "$connections": { | |
| "value": { | |
| "azureblob_1": { | |
| "connectionId": "", | |
| "id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/azureblob" | |
| }, | |
| "azureeventgrid_1": { | |
| "connectionId": "", | |
| "id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/azureeventgrid" | |
| }, | |
| "videoindexer": { | |
| "connectionId": "", | |
| "id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/videoindexer" | |
| } | |
| } | |
| }, | |
| "definition": { | |
| "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
| "actions": { | |
| "Condition": { | |
| "actions": { | |
| "Compose": { | |
| "inputs": "@{split(triggerBody()?['subject'], '/')?[4]}/@{split(triggerBody()?['subject'], '/')?[6]}", | |
| "runAfter": {}, | |
| "type": "Compose" | |
| }, | |
| "Create_SAS_URI_by_path": { | |
| "inputs": { | |
| "body": { | |
| "Permissions": "Read" | |
| }, | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['azureblob_1']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/default/CreateSharedLinkByPath", | |
| "queries": { | |
| "path": "@{outputs('Compose')}" | |
| } | |
| }, | |
| "runAfter": { | |
| "Compose": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Upload_video_and_index_(using_a_URL)": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['videoindexer']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/Api/Partner/Breakdowns", | |
| "queries": { | |
| "name": "@{triggerBody()?['data']?['eTag']}", | |
| "privacy": "Private", | |
| "videoUrl": "@body('Create_SAS_URI_by_path')?['WebUrl']" | |
| } | |
| }, | |
| "runAfter": { | |
| "Create_SAS_URI_by_path": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "expression": { | |
| "and": [ | |
| { | |
| "equals": [ | |
| "@triggerBody()?['eventType']", | |
| "Microsoft.Storage.BlobCreated" | |
| ] | |
| } | |
| ] | |
| }, | |
| "runAfter": {}, | |
| "type": "If" | |
| } | |
| }, | |
| "contentVersion": "1.0.0.0", | |
| "outputs": {}, | |
| "parameters": { | |
| "$connections": { | |
| "defaultValue": {}, | |
| "type": "Object" | |
| } | |
| }, | |
| "triggers": { | |
| "When_a_resource_event_occurs": { | |
| "inputs": { | |
| "body": { | |
| "properties": { | |
| "destination": { | |
| "endpointType": "webhook", | |
| "properties": { | |
| "endpointUrl": "@{listCallbackUrl()}" | |
| } | |
| }, | |
| "filter": { | |
| "subjectEndsWith": ".mov" | |
| }, | |
| "topic": null | |
| } | |
| }, | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['azureeventgrid_1']['connectionId']" | |
| } | |
| }, | |
| "path": "/subscriptions//providers/@{encodeURIComponent('Microsoft.Storage.StorageAccounts')}/resource/eventSubscriptions", | |
| "queries": { | |
| "x-ms-api-version": "2017-09-15-preview" | |
| } | |
| }, | |
| "splitOn": "@triggerBody()", | |
| "type": "ApiConnectionWebhook" | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment