- Introduction
- Getting Started
- How To Guides
-
Command Reference
- Overview
- Asset Commands
- Attribute Definitions
- Category Commands
- User Group Commands
-
PowerDAM Operations
- Export-MvDamAssetAttribute
- Export-MvDamAssetInfo
- Import-MvDamAssetAttributeFromCsv
- Import-MvDamAssetCategoryFromCsv
- Import-MvDamAssetKeywordFromCsv
- Import-MvDamAssetStatusFromCsv
- Import-MvDamFilenameListFromCsv
- Test-MvDamAssetAttributeCsv
- Import-MvDamAssetsFromContainer
- Export-MvDamContainerManifest
- Import-MvDamCategoryTreeFromManifest
- Initialize-MvDamUploadJob
- Start-MvDamUploadJob
- Import-MvDamAssetsFromHotFolder
- Creative Spaces Operations
- SkyHOOK Commands
- Solution Recipes
Overview
- What is Hotfolder Uploader?
MediaValet is providing IT pros, DAM consultants, admins and power users with a set of PowerShell Cmdlets that will ease their day to day tasks of uploading assets from a hot folder server path to Azure blob storage through the powerful command line scripting tool. This task can be scheduled with the help of a task scheduler and forgotten to execute automatically for copying of assets through scheduled trigger.
System Requirements
Prerequisites
- Currently, this hot folder solution is only available for Windows machine and works with windows powershell version 5.1.
- Verify that you have windows powershell ver. 5.1 on allocated machine. Follow the Getting Started section of PowerShell for MediaValet guide here.
- Install Azcopy powershell modules on allocated machine. This is necessary since it is the fastest and efficient way of moving your assets from local hot folder path to Azure blob storage container.
- An Azure account with an active subscription. Create an account for free.
- An Azure storage container account with a blob container for uploading of assets from hot folder.https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal. It’s necessary to have your blob storage Azure account in the same data center region where your hot folder upload machine is for faster upload of assets over the network.
Storage account
- If you already have a blob container for uploading of your assets, skip this section and continue to setup your hot folder uploader.
- If you don’t yet have an azure blob container account, create one now:
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal
Azcopy command setup
Once you have downloaded azcopy.exe on your system add the path of azcopy.exe file to path variable under system variables section of environment variables; so that you can execute the command from windows power shell. Steps to set-up environment variable path are shown in below screenshots:
After adding path variable execute Test-MvAzCopyVersion
command and see whether media valet powershell command to validate azcopy.exe returns true as shown below:
Windows PowerShell setup
Run the command $PSVersionTable.PSVersion
on windows powershell and validate whether powershell version 5.1 is currently installed:
Hotfolder Config and Upload Tasks
Hotfolder Setup
Next step would be to setup hotfolder upload folder on your machine for ingesting assets to your DAM library. This can easily be accomplished using powershell cmdlet Initialize-MvHotfolder
.
A sys admin need to connect to MV DAM account before executing Initialize-MvHotfolder
cmdlet. Importing of your target DAM category path from your DAM library to your local folder path is automated and is part of this cmdlet.
However, in case you quickly want to refresh your local hot folder with the target DAM category you can accomplish this by executing the cmdlet Import-MvHotFolderFromDamCategoryTree
in your powershell window by reconnecting to your DAM account. Import-MvHotFolderFromDamCategoryTree
cmdlet takes two parameters -Hotfolder
(Required) and -TargetDamCategoryPath
(Required).
Initialize-MvHotfolder cmdlet takes parameters Hotfolder
, UploadArchivePath
, StagingSasUri
and TargetDamCategoryPath
and sets up a configuration file at your specified Hotfolder path for future uploads.
-Hotfolder
(Required) The file path on your machine that will be used to keep assets that need to be uploaded to your DAM library account.
-UploadArchivePath
(Required) The file path on your machine that will be used to archive all your assets from hotfolder path after successful completion of job. All the assets that got successfully uploaded in your DAM account will be archived here in a folder having the same jobid as found in path $HotFolder\.mvhotfolder\import-jobs
. All the failed assets that were not ingested in DAM can be found in the same hotfolder path.
-StagingSasUri
(Required) A destination Sas Uri providing read, write, create, delete and list access to the blobs in the storage account. The Sas Uri should not expire until the completion of the job and should be generated to have read, write, create, list and delete permissions.
-TargetDamCategoryPath
(Required) The folders/assets from the hot folder path are going to be ingested into the target category path specified.
You can setup the hot folder at any location of your choice on your machine and keep the assets for uploading at the hot folder category path.
Importing Assets from Hotfolder
Import-MvDamAssetsFromHotfolder
is the Power DAM cmdlet that enables the automatic uploading of assets from your local hot folder path to azure blob storage account and thereafter to your MediaValet DAM library. Uploading of assets from blob storage to DAM library is faster since both are Azure cloud regions.
You can manually start the uploading of assets to azure blob storage container and finally to your DAM library using Import-MvDamAssetsFromHotfolder
cmdlet from your windows powershell.
Import-MvDamAssetsFromHotFolder cmdlet takes parameters Hotfolder (Required)
and NotificationScriptPath (optional)
. Hotfolder
path specified should be the one setup during the initialization process of Initialize-MvHotfolder cmdlet.
On successful execution of uploads your assets will be archived and moved to UploadArchivePath
folder set up during hotfolder setup on the machine along with the logs of job. The archive folder specified will always show you the assets that were successfully uploaded to DAM library.
Also, the blob storage container will be cleaned up for the assets that were successfully uploaded to DAM library.
Scheduling Import Tasks
NOTE:- This scheduled upload command is for a Windows machine only.
You can automate the process by scheduling the task to be executed at a later time of day and ease the activity of monitoring a hot job folder for any new assets to be uploaded by executing New-MvHotfolderTaskSchedTrigger
cmdlet.
New-MvHotfolderTaskSchedTrigger
cmdlet takes parameters Hotfolder (Required)
, TriggerAt (Required)
, RepetitionInterval (Required)
and TaskName (Required)
.
This cmdlet will schedule and execute Import-MvDamAssetsFromHotfolder
command script and execute it at the specified trigger duration.
NOTE:- A sysadmin should be an administrator to execute the said cmdlet New-MvHotfolderTaskSchedTrigger
.
Also, assets should be present in your hotfolder path before the script Import-MvDamAssetsFromHotfolder
gets triggered by the task scheduler at the defined triggered time.
Reference screenshots to be followed as shown below:
Implementing Notifications
A sysadmin can also create an email notification through PowerAutomate via an HTTP trigger. This could effectively be any type of notification mechanism but an HTTP trigger is the easiest one to setup and test. A sysadmin can pass the notification script as a parameter by path in case he wants to be notified about the status of the tasks.
The task will pass the below information as a powershell object to the notification script file path and a sysadmin can use this information to send a notification alert using any mechanism of his choice.
- Result: Success/Fail
- Hotfolder: Directory path of hot folder
- ImportJobId: for the session
- ImportJobPath: for the session
- AzCopyLogPath: for the session; and
- UploadArchivePath: for the session
All these details would also be stored in a central CSV file at $Hotfolder./mvhotfolder/import-jobs.csv as well.
For example, powerautomatenotify.ps1 can be written by the admin to use PowerAutomate. The cmdlet will Invoke-Command the script and pass the powershell object as a default parameter. Another reference link on how to setup an email alert can be found here