You can create Azure runbook, add PowerShell code to turn on/off the VM and call it in ADFv2 using Webhook.
How to start and stop virtual machines with Azure Automation
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Experts,
I have created a virtual machine for integration run time to connect a SAP Systems. Now I have started the VM so its ingesting data from SAP to ADLS.
Now i need to create an activity to stop VM after my ingestion in ADF pipeline. And also I need to create a activity to start the VM before ingestion starts in pipeline.
I am not getting any help on this to achieve. Your help is really appreciated.
Thanks
Muralidhar.
You can create Azure runbook, add PowerShell code to turn on/off the VM and call it in ADFv2 using Webhook.
How to start and stop virtual machines with Azure Automation
Hi VaibhavChaudhari,
I've followed the tutorial on the link that you have mentioned, but i'm getting this error after try to run the runbook:
RunbookFlow : Run Login-AzureRmAccount to login. At line:9 char:57 + <#-- Enable activity tracing to see error location --#> RunbookFlow ` + ~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Invoke-RunbookFlow], PSInvalidOperationException + FullyQualifiedErrorId : InvalidOperation,Orchestrator.GraphRunbook.Cmdlets.InvokeRunbookFlowCommand
adding more information:
I've created previously the Automation account and tried but with no success, the start or stop of some VM. after authenticate with the "AzureRunAsConnection" account i can't see others resource groups or list objects.
Does anyone had an error like this? can anyone help to find the problem in order to get the objects or start some VM?
I've tried with some code, but getting similar results
$connectionName = "AzureRunAsConnection"
"Logging in to Azure..."
Connect-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
Start-AzureVM -ResourceGroupName $ResourceGroup -Name $VMName -Force
When i do that, i get:
Start-AzureVM : A parameter cannot be found that matches parameter name 'ResourceGroupName'.
At line:65 char:19
+ Start-AzureVM -ResourceGroupName $ResourceGroup -Name $VMName -Fo ...
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-AzureVM], ParameterBindingException
+ FullyQualifiedErrorId :
NamedParameterNotFound,Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.StartAzureVMCommand