I am attempting to run a PowerShell command that creates a BACPAC backup of a database in an Azure VM, does anyone know how to pass the command to the VM through a web activity?
The connection is fine but how do I pass the script itself?
CodePudding user response:
Web activity
doesn't run PowerShell Script.
Web Activity can be used to call a custom REST endpoint from an Azure Data Factory or Synapse pipeline. You can pass datasets and linked services to be consumed and accessed by the activity.
Custom activity
is the only activity which can execute Powershell
scripting. But as you mentioned that you are not interested in Azure Batch solutions.
So, you can go with Azure Function
and run that function using Azure Function activity
in the Azure Data Factory.
You can refer this third-party tutorial - Running Powershell in Azure Functions - to deploy a Azure Function and use Azure Function activity in ADF to run the Function in ADF.