%3CLINGO-SUB%20id%3D%22lingo-sub-1672198%22%20slang%3D%22en-US%22%3EGenerating%20Captions%20with%20Video%20Indexer%20and%20Logic%20Apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1672198%22%20slang%3D%22en-US%22%3E%3CP%3EWouldn't%20it%20be%20nice%20if%20you%20could%20set%20up%20custom%20workflows%20with%20connectors%20to%20effectively%20index%20and%20generate%20captions%20from%20a%20large%20volume%20of%20video%20and%20audio%20files%2C%20%3CEM%3Ewithout%20needing%20to%20write%20a%20single%20line%20of%20code%3F%26nbsp%3B%26nbsp%3B%3C%2FEM%3EWith%20Azure%20Media%20Services%20Video%20Indexer%2C%20you%20can%20utilize%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fservices%2Flogic-apps%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELogic%20Apps%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fpreview.flow.microsoft.com%2Fconnectors%2Fshared_videoindexer-v2%2Fvideo-indexer-v2%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPower%20Automate%3C%2FA%3E%20connectors%20that%20are%20compatible%20with%20our%20API%2C%20without%20coding!%20The%20resulting%20solution%20provides%20better%20visibility%20into%20the%20health%20of%20your%20workflow%2C%20while%20making%20debugging%20easier.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20Media%20Services%20%3CA%20href%3D%22https%3A%2F%2Fapi-portal.videoindexer.ai%2Fdocs%2Fservices%2FOperations%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVideo%20Indexer%20v2%20REST%20API%3C%2FA%3E%20supports%20both%20server-to-server%20and%20client-to-server%20communication.%20Video%20Indexer%20users%20can%20integrate%20video%20and%20audio%20insights%20(including%20captions)%20easily%20into%20their%20application%20logic%2C%20unlocking%20new%20experiences%20and%20monetization%20opportunities.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3EIn%20this%20tutorial%2C%20you%20will%20learn%20how%20to%3A%20%3C%2FU%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETrigger%20a%20Logic%20Apps%20%2F%20Power%20Automate%20flow%20every%20time%20a%20video%20file%20is%20added%20to%20a%20specific%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fonedrive%2Fonline-cloud-storage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOneDrive%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fonedrive.live.com%2Fabout%2Fen-us%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOneDrive%20Business%3C%2FA%3E%20folder.%3C%2FLI%3E%0A%3CLI%3EUse%20the%20flow%20to%20automatically%20index%20and%20generate%20captions%20for%20the%20video%20file.%3C%2FLI%3E%0A%3CLI%3ESet%20a%20second%20flow%20to%20save%20the%20video%20captions%20to%20a%20different%20OneDrive%20folder.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPrerequisites%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECreate%20an%20Azure%20subscription%20if%20you%20do%20not%20have%20one.%20You%20can%20create%20a%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffree%2F%3Fref%3Dmicrosoft.com%26amp%3Butm_source%3Dmicrosoft.com%26amp%3Butm_medium%3Ddocs%26amp%3Butm_campaign%3Dvisualstudio%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Efree%20account%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Ffree%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EA%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Fvideo-indexer-get-started%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVideo%20Indexer%20account%3C%2FA%3E%2C%20with%20access%20to%20the%20APIs%20via%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Fvideo-indexer-use-apis%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAPI%20key%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EA%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fonedrive%2Fonline-cloud-storage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOne%20Drive%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fonedrive.live.com%2Fabout%2Fen-us%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOneDrive%20Business%3C%2FA%3E%20Account.%20In%20your%20OneDrive%2C%20create%20two%20folders%20%E2%80%93%20one%20to%20store%20videos%20and%20the%20other%20to%20store%20the%20captions%20generated%20by%20Video%20Indexer.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20tutorial%2C%20we%20will%20use%20the%20term%20%E2%80%9Cflow%E2%80%9D%20to%20describe%20both%20Power%20Automate%20flows%20and%20Logic%20Apps%20automations.%20Since%20the%20editors%20and%20capabilities%20are%20almost%20identical%20in%20both%20solutions%2C%20please%20note%20that%20the%20diagrams%20and%20explanations%20are%20applicable%20to%20both%20Logic%20Apps%20and%20Power%20Automate.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EIndex%20video%20automatically%20by%20copying%20it%20to%20OneDrive%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20scenario%20is%20comprised%20of%20two%20separate%20flows%20that%20work%20together.%20The%26nbsp%3Bfirst%20flow%26nbsp%3Bis%20triggered%20when%20a%20file%20is%20added%20to%20a%20OneDrive%20or%20OneDrive%20for%20Business%20account.%20The%20flow%20uploads%20the%20new%20file%20to%20Video%20Indexer%20with%20a%20callback%20URL%20to%20send%20a%20notification%20once%20the%20indexing%20operation%20is%20completed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%26nbsp%3Bsecond%20flow%26nbsp%3Bis%20triggered%20from%20the%20callback%20URL.%20It%20saves%20the%20generated%20captions%20back%20to%20a%20JSON%20file%20in%20OneDrive.%20This%20two-flow%20approach%20can%20effectively%20be%20used%20to%20support%20async%20upload%20and%20indexing%20of%20a%20large%20volume%20of%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20create%20a%20similar%20flow%20that%20will%20be%20triggered%20when%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Flogic-apps-connector-tutorial%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eblob%20is%20added%20or%20modified%20in%20an%20Azure%20Storage%20account%3C%2FA%3E%20to%20save%20the%20captions%20to%20your%20blob.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESet%20up%20the%20file%20upload%20flow%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20first%20flow%20is%20triggered%20whenever%20a%20file%20is%20added%20to%20your%20OneDrive%20folder.%20When%20triggered%2C%20it%20will%20create%20a%20URL%20that%20enables%20you%20to%20upload%20and%20index%20your%20file%20in%20Video%20Indexer.%20Let%E2%80%99s%20start%20by%20creating%20the%20following%20flow%20in%20Logic%20Apps%20or%20Power%20Automate.%20Below%20is%20a%20workflow%20diagram%20from%20Logic%20Apps%20editor%2C%20but%20since%20the%20Power%20Automate%20editor%20is%20practically%20the%20same%20you%20can%20follow%20the%20steps%20in%20both%20solutions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20553px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218688i96EA503ADC07C293%2Fimage-dimensions%2F553x262%3Fv%3D1.0%22%20width%3D%22553%22%20height%3D%22262%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ENote%20that%20every%20OneDrive%20trigger%20or%20action%20is%20available%20both%20for%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fonedrive%2Fonline-cloud-storage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOneDrive%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fonedrive.live.com%2Fabout%2Fen-us%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOneDrive%20for%20Business%3C%2FA%3E.%20Make%20sure%20to%20choose%20the%20one%20you%20use%20when%20you%20create%20the%20flow.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ETo%20set%20up%20the%20first%20flow%2C%20you%20will%20need%20to%20provide%20your%E2%80%AFOneDrive%20credentials%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Fvideo-indexer-use-apis%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVideo%20Indexer%20API%20Key%3C%2FA%3E.%3CBR%20%2F%3E%E2%80%9CConnection%20name%E2%80%9D%20can%20be%20a%20value%20of%20your%20choosing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218689i832B4ACC72AE66EE%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218690i10875159F89BCEFC%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20are%20connected%20to%20your%20OneDrive%20and%20Video%20Indexer%20accounts%2C%20go%20to%20the%20%E2%80%9CWhen%20a%20file%20is%20created%E2%80%9D%20trigger%20and%20select%20the%20folder%20where%20you%20want%20your%20video%20files%20to%20be%20stored.%20In%20this%20example%20we%E2%80%99ve%20called%20the%20folder%20%E2%80%9CVideoIndexer%E2%80%9D.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218691iD1A0E59F7618CE93%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%224.png%22%20alt%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%2C%20go%20to%20the%20%E2%80%9CCreate%20share%20link%E2%80%9D%20action.%20%26nbsp%3BSelect%20%E2%80%9CFile%20identifier%E2%80%9D%20from%20the%20Dynamic%20content%20options%20to%20send%20the%20new%20file%20to%20the%20%E2%80%9CCreate%20share%20link%E2%80%9D%20action%20and%20set%20the%20Link%20type%20to%20%E2%80%9CDirect%E2%80%9D%20so%20Video%20Indexer%20could%20access%20the%20file%20in%20the%20next%20steps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218692i8AC4963C2C860262%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%225.png%22%20alt%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFill%20out%20your%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Fvideo-indexer-use-apis%23account-id%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eaccount%20Location%20and%20ID%3C%2FA%3E%26nbsp%3Bto%20get%20the%20Video%20Indexer%20account%20token.%20Access%20tokens%20are%20needed%20to%20use%20the%20Video%20Indexer%20APIs%20for%20security%20purposes.%20This%20ensures%20that%20all%20calls%20are%20either%20coming%20from%20you%20or%20those%20who%20have%20access%20permissions%20to%20your%20account.%20You%20can%20read%20more%20about%20access%20tokens%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Ffaq%23what-is-an-api-access-token-and-why-do-i-need-it%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%226.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218693i08491D59EDC4CFFB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%226.png%22%20alt%3D%226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20%E2%80%9CUpload%20video%20and%20index%E2%80%9D%2C%20fill%20out%20the%20required%20parameters%20and%20Video%20URL.%20Select%20%E2%80%9CAdd%20new%20parameter%E2%80%9D%20and%20select%20%E2%80%9CCallback%20URL%E2%80%9D.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%227.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218694i4D07C44FE70CE972%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%227.png%22%20alt%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELeave%20the%20callback%20URL%20empty%20for%20now.%20You%20will%20add%20it%20after%20you%20have%20finished%20the%20second%20flow%20and%20when%20the%20callback%20URL%20is%20created.%3C%2FP%3E%0A%3CP%3EAdd%20the%20parameter%20%E2%80%9CIndexing%20Preset%E2%80%9D%20and%20set%20it%20to%20%E2%80%9CAudioOnly%E2%80%9D.%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20choose%20the%20default%20value%20for%20the%20other%20parameters%20or%20set%20them%20according%20to%20your%20needs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20%E2%80%9CSave%E2%80%9D%2C%20and%20you%20are%20ready%20to%20move%20on%20to%20configuring%20the%20second%20flow%2C%20which%20will%20be%20used%20to%20generate%20the%20captions%20once%20the%20upload%20and%20indexing%20process%20is%20completed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESet%20up%20the%20caption's%20Generating%20flow%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EOnce%20the%20uploading%20and%20indexing%20from%20the%20first%20flow%20is%20completed%2C%20it%20will%20send%20an%20HTTP%20request%20with%20the%20correct%20callback%20URL%20to%20trigger%20the%20second%20flow.%20It%20will%20also%20retrieve%20the%20captions%20generated%20by%20the%20Video%20Indexer.%20In%20this%20example%2C%20the%20output%20of%20your%20indexing%20job%20is%20stored%20in%20the%20OneDrive%20folder%20you%20set%20up.%20However%2C%20it%20is%20up%20to%20you%20to%20decide%20on%20how%20or%20where%20you%20would%20like%20to%20store%20the%20output.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ECreate%20the%20second%20flow%20separately%20from%20the%20first%20one%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%228.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218695iF1F367CFA247067E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%228.png%22%20alt%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20set%20up%20this%20flow%2C%20you%20will%20need%20to%20provide%20your%20Video%20Indexer%20API%20Key%20and%20OneDrive%20Business%20credentials%20again.%20Update%20the%20same%20parameters%20as%20you%20did%20for%20the%20first%20flow.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20your%20trigger%2C%20you%20will%20see%20the%20HTTP%20POST%20URL%20field.%20The%20URL%20will%20not%20be%20generated%20until%20after%20you%20save%20your%20flow%3B%20however%2C%20you%20will%20need%20the%20URL%20eventually.%20We%20will%20come%20back%20to%20this%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFill%20out%20your%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Fvideo-indexer-use-apis%23account-id%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eaccount%20Location%20and%20ID%3C%2FA%3E%E2%80%AFto%20get%20the%20Video%20Indexer%20account%20token.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGo%20to%20the%20%E2%80%9CGet%20Video%20Index%E2%80%9D%20action%20and%20fill%20out%20the%20required%20parameters.%20For%20Video%20ID%2C%20put%20in%20the%20following%20expression%3A%20triggerOutputs()%5B'queries'%5D%5B'id'%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%229.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218697i6CF904ECCF46E6A3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%229.png%22%20alt%3D%229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20expression%20tells%20the%20connector%20to%20get%20the%20Video%20ID%20from%20the%20output%20of%20your%20trigger.%20In%20this%20case%2C%20the%20output%20of%20your%20trigger%20will%20be%20the%20output%20of%20%E2%80%9CUpload%20video%20and%20index%E2%80%9D%20from%20your%20first%20trigger.%3C%2FP%3E%0A%3CP%3ENote%3A%20This%20flow%20can%20be%20built%20without%20the%20%E2%80%9CGet%20Video%20Index%E2%80%9D%20action%20but%20using%20it%20will%20provide%20the%20%22Video%20Name%22%20field%20which%20we%20will%20use%20later%20to%20name%20the%20captions%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGo%20to%20the%20%E2%80%9CGet%20Video%20Captions%E2%80%9D%20action%20and%20fill%20out%20the%20required%20parameters.%20For%20Video%20ID%2C%20put%20in%20the%20same%20value%20you%20used%20in%20the%20last%20action%3A%20triggerOutputs()%5B'queries'%5D%5B'id'%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2210.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218696i15B44DFF3323C01D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2210.png%22%20alt%3D%2210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGo%20to%20the%20%E2%80%9CCreate%20file%E2%80%9D%20action%20and%20select%20the%20folder%20in%20which%20you%20want%20the%20captions%20to%20be%20saved.%20Every%20video%20you%20upload%20will%20create%20a%20separate%20VTT%20caption%20file.%20You%20can%20set%20the%20caption%20file%20name%20to%20be%20identical%20to%20your%20video%20name%20by%20using%20the%20Name%20field%20from%20the%20%E2%80%9CGet%20Video%20Index%E2%80%9D%20action.%20For%20File%20Content%2C%20go%20to%20the%20Dynamic%20Fields%20of%20%E2%80%9CGet%20Video%20Caption%E2%80%9D%20and%20click%20on%20%E2%80%9CSee%20more%E2%80%9D.%20Select%20the%20Body%20field.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2211.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218698i6AE615C186C962CA%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2211.png%22%20alt%3D%2211.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20%E2%80%9CSave%20flow.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20flow%20is%20saved%2C%20an%20HTTP%20POST%20URL%20is%20created%20in%20the%20trigger.%20Copy%20the%20URL%20from%20the%20trigger.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218699iFBD2F6C58CC9D10E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2212.png%22%20alt%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20go%20back%20to%20the%20first%20flow%20and%20paste%20the%20URL%20in%20the%20%E2%80%9CUpload%20video%20and%20index%E2%80%9D%20action%20for%20the%20Callback%20URL%20parameter.%3C%2FP%3E%0A%3CP%3EMake%20sure%20both%20flows%20are%20saved%2C%20and%20you%E2%80%99re%20good%20to%20go!%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ETry%20out%20your%20newly%20created%20Logic%20App%20or%20Power%20Automate%20solution%20by%20adding%20a%20video%20to%20your%20OneDrive%20folder.%20Go%20back%20a%20few%20minutes%20later%20and%20you%20will%20see%20that%20the%20captions%20appear%20in%20the%20destination%20folder.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EClean%20up%20resources%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAfter%20you%20are%20done%20with%20this%20tutorial%2C%20feel%20free%20to%20keep%20this%20Logic%20App%20or%20Power%20Automate%20solution%20up%20and%20running.%20However%2C%20if%20you%20do%20not%20want%20to%20keep%20this%20solution%20running%2C%20turn%20off%20both%20of%20your%20flows%20if%20you%20are%20using%20Power%20Automate%20or%20disable%20both%20flows%20if%20you%E2%80%99re%20using%20Logic%20Apps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENext%20steps%20and%20further%20reading%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EFor%20further%20exploration%2C%20read%20our%20tutorial%20on%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fvideo-indexer%2Flogic-apps-connector-tutorial%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehow%20to%20use%20Video%20Indexer%20with%20Logic%20Apps%20and%20Power%20Automate%20to%20automatically%20index%20videos%20on%20your%20blob%20storage%20and%20extract%20the%20insights%20JSON%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20tutorial%20showed%20an%20example%20of%20Video%20Indexer%20connectors.%20You%20can%20use%20the%20Video%20Indexer%20connectors%20for%20any%20API%20call%20provided%20by%20Video%20Indexer.%20For%20example%2C%20you%20can%20upload%20and%20retrieve%20insights%2C%20translate%20the%20results%2C%20get%20embed-able%20widgets%20and%20even%20customize%20your%20models.%20In%20addition%2C%20you%20can%20choose%20to%20trigger%20those%20actions%20based%20on%20different%20sources%20like%20updates%20to%20file%20repositories%20or%20emails%20sent.%20Next%2C%20choose%20to%20have%20the%20results%20updated%20to%20our%20relevant%20infrastructure%2Fapplication%20or%20generate%20other%20action%20items.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1672198%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22evolve-user-engagement%20(2).jpg%22%20style%3D%22width%3A%20806px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218706i09D32D6E930A909C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22evolve-user-engagement%20(2).jpg%22%20alt%3D%22evolve-user-engagement%20(2).jpg%22%20%2F%3E%3C%2FSPAN%3ECreate%20an%20automatic%20flow%20to%20generate%20video%20captions%20from%20Video%20Indexer%20using%20OneDrive%20and%20Logic%20Apps%20or%20Power%20Automate.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Wouldn't it be nice if you could set up custom workflows with connectors to effectively index and generate captions from a large volume of video and audio files, without needing to write a single line of code?  With Azure Media Services Video Indexer, you can utilize Logic Apps and Power Automate connectors that are compatible with our API, without coding! The resulting solution provides better visibility into the health of your workflow, while making debugging easier. 

 

Azure Media Services Video Indexer v2 REST API supports both server-to-server and client-to-server communication. Video Indexer users can integrate video and audio insights (including captions) easily into their application logic, unlocking new experiences and monetization opportunities.

 

In this tutorial, you will learn how to:

  • Trigger a Logic Apps / Power Automate flow every time a video file is added to a specific OneDrive or OneDrive Business folder.
  • Use the flow to automatically index and generate captions for the video file.
  • Set a second flow to save the video captions to a different OneDrive folder.

 

Prerequisites

  1. Create an Azure subscription if you do not have one. You can create a free account here.
  2. A Video Indexer account, with access to the APIs via API key.
  3. A One Drive or OneDrive Business Account. In your OneDrive, create two folders – one to store videos and the other to store the captions generated by Video Indexer.

 

In this tutorial, we will use the term “flow” to describe both Power Automate flows and Logic Apps automations. Since the editors and capabilities are almost identical in both solutions, please note that the diagrams and explanations are applicable to both Logic Apps and Power Automate.

 

Index video automatically by copying it to OneDrive

This scenario is comprised of two separate flows that work together. The first flow is triggered when a file is added to a OneDrive or OneDrive for Business account. The flow uploads the new file to Video Indexer with a callback URL to send a notification once the indexing operation is completed.

 

The second flow is triggered from the callback URL. It saves the generated captions back to a JSON file in OneDrive. This two-flow approach can effectively be used to support async upload and indexing of a large volume of files.

 

You can create a similar flow that will be triggered when a blob is added or modified in an Azure Storage account to save the captions to your blob.

 

Set up the file upload flow

The first flow is triggered whenever a file is added to your OneDrive folder. When triggered, it will create a URL that enables you to upload and index your file in Video Indexer. Let’s start by creating the following flow in Logic Apps or Power Automate. Below is a workflow diagram from Logic Apps editor, but since the Power Automate editor is practically the same you can follow the steps in both solutions.

 

1.png


Note that every OneDrive trigger or action is available both for OneDrive and OneDrive for Business. Make sure to choose the one you use when you create the flow.


To set up the first flow, you will need to provide your OneDrive credentials and Video Indexer API Key.
“Connection name” can be a value of your choosing.

 

2.png

 

3.png

 

Once you are connected to your OneDrive and Video Indexer accounts, go to the “When a file is created” trigger and select the folder where you want your video files to be stored. In this example we’ve called the folder “VideoIndexer”.

 

4.png

 

Next, go to the “Create share link” action.  Select “File identifier” from the Dynamic content options to send the new file to the “Create share link” action and set the Link type to “Direct” so Video Indexer could access the file in the next steps.

 

5.png

 

Fill out your account Location and ID to get the Video Indexer account token. Access tokens are needed to use the Video Indexer APIs for security purposes. This ensures that all calls are either coming from you or those who have access permissions to your account. You can read more about access tokens here.

 

6.png

 

For “Upload video and index”, fill out the required parameters and Video URL. Select “Add new parameter” and select “Callback URL”.

 

7.png

 

Leave the callback URL empty for now. You will add it after you have finished the second flow and when the callback URL is created.

Add the parameter “Indexing Preset” and set it to “AudioOnly”.

You can also choose the default value for the other parameters or set them according to your needs.

 

Click “Save”, and you are ready to move on to configuring the second flow, which will be used to generate the captions once the upload and indexing process is completed.

 

Set up the caption's Generating flow

Once the uploading and indexing from the first flow is completed, it will send an HTTP request with the correct callback URL to trigger the second flow. It will also retrieve the captions generated by the Video Indexer. In this example, the output of your indexing job is stored in the OneDrive folder you set up. However, it is up to you to decide on how or where you would like to store the output.


Create the second flow separately from the first one:

 

8.png

 

To set up this flow, you will need to provide your Video Indexer API Key and OneDrive Business credentials again. Update the same parameters as you did for the first flow.

 

For your trigger, you will see the HTTP POST URL field. The URL will not be generated until after you save your flow; however, you will need the URL eventually. We will come back to this later.

 

Fill out your account Location and ID to get the Video Indexer account token.

 

Go to the “Get Video Index” action and fill out the required parameters. For Video ID, put in the following expression: triggerOutputs()['queries']['id']

 

9.png

 

This expression tells the connector to get the Video ID from the output of your trigger. In this case, the output of your trigger will be the output of “Upload video and index” from your first trigger.

Note: This flow can be built without the “Get Video Index” action but using it will provide the "Video Name" field which we will use later to name the captions file.

 

Go to the “Get Video Captions” action and fill out the required parameters. For Video ID, put in the same value you used in the last action: triggerOutputs()['queries']['id']

 

10.png

 

Go to the “Create file” action and select the folder in which you want the captions to be saved. Every video you upload will create a separate VTT caption file. You can set the caption file name to be identical to your video name by using the Name field from the “Get Video Index” action. For File Content, go to the Dynamic Fields of “Get Video Caption” and click on “See more”. Select the Body field.

 

11.png

 

Click “Save flow.”

 

Once the flow is saved, an HTTP POST URL is created in the trigger. Copy the URL from the trigger.

 

12.png

 

Now, go back to the first flow and paste the URL in the “Upload video and index” action for the Callback URL parameter.

Make sure both flows are saved, and you’re good to go!


Try out your newly created Logic App or Power Automate solution by adding a video to your OneDrive folder. Go back a few minutes later and you will see that the captions appear in the destination folder.

 

Clean up resources

After you are done with this tutorial, feel free to keep this Logic App or Power Automate solution up and running. However, if you do not want to keep this solution running, turn off both of your flows if you are using Power Automate or disable both flows if you’re using Logic Apps.

 

Next steps and further reading

For further exploration, read our tutorial on how to use Video Indexer with Logic Apps and Power Automate to automatically index videos on your bl....

 

This tutorial showed an example of Video Indexer connectors. You can use the Video Indexer connectors for any API call provided by Video Indexer. For example, you can upload and retrieve insights, translate the results, get embed-able widgets and even customize your models. In addition, you can choose to trigger those actions based on different sources like updates to file repositories or emails sent. Next, choose to have the results updated to our relevant infrastructure/application or generate other action items.