We have one windows application installed in Azure VM. We want to execute that application using Azure so that we will be able to monitor execution of this application using Azure portal.
Is there any way to invoke an executable present in one Azure VM using Azure Data Factory pipeline or some other service present in Azure?
What does the exe do? Is it a console app?
Generally, I think it's possible.
This can be achieved by using ADF Custom Activity. You may rewrite your app as a custom activity, which will be run in Azure Batch VMs.
If your app can't be run in Azure Batch, you will have to enable something like PowerShell remoting, so that exe can be launched remotely. Caveat is, even in this case, you will still need a Custom Activity / Azure Batch as invoker, since ADF Pipeline itself can't do remote call or run custom code.
Hope this will help.
Related
I need to run various batch scripts on an on-premises Windows server. These scripts need to be called from an Azure service. We were thinking of using Datafactory to orchestrate the whole process but we are looking for a way to call these scripts.
Would it be possible using Azure Functions? Is it possible to connect somehow with the on-premises Windows machine and call the scripts in a secure way?
I have a console application connecting to database and executing DML transactions. This console application is currently scheduled using windows task scheduler. I am planning to migrate this to Azure.
Which is the recommended strategy ?
Should this be moved as Azure webjobs or function apps ?
Since you already have a console project, then it's more easier to use Azure Webjobs to achieve that.
To create a webjob, just create a .zip file which includes the .exe / .dll and other necessary files, then upload to azure. For schedule, please refer to Create a scheduled WebJob. For more details, you can refer to this doc.
Note: there're some limitation of azure webjobs / azure function, see Azure-Web-App-sandbox. But if you only need to connecting to database and executing DML transactions, you can ignore the limits.
And yes, you can also do this via azure function, but since you already have a console project, it's easier to use webjobs.
I have a python script resides in an Azure VM. This script uses a few local files from this VM. I need to create an ADF pipeline which will execute this python script residing in this on-premises VM. As the script is placed on-premises, I can't use any cluster activity of ADF. So Basically the pipeline should connect to the VM and trigger the script execution. I could think of an option of using Custom Activity of ADF and trigger Powershell command from there to this on-premises python script. But not sure how to connect to on-premises scripts.
After my researching, you do could run Python script in ADF custom activity. However, based on the official document,you need to rely on Azure Batch Service to put your scripts and dependencies to the folder path in the Azure Batch Service. So, I think it's properly for you to execute on-premises Python scripts situation.
I provide you with a workaround.
step1: expose an endpoint to executing your on-premises Python scripts, of course, the local files could be touched.
step2: then use VPN gateway to get access to network channels between on-premises and Azure side.
step3: use Web activity in ADF to invoke the exposed endpoint and get executing results.
I have several .NET applications that are hosted In Azure on virtual machines IIS. I want to automate deployment process directly from my machine or visual studio without using Azure portal because we are doing several deliveries each day. The biggest challenge for me now is to do backup before deployment. So I need to backup specific folder on VM remotely. Could anyone tell me how I can do it?
Are there any best practices for automation delivery from visual studio to Azure VM? Backup of app is required.
First, I'm assuming that you would like to back up some specific folders in your VM to an Azure Blobs or Azure Files storage. There are two parts you'd need to complete your continuous deployment:
Automate backing up some folders in your virtual machine.
Integrate task #1 into a CICD (Continuous Integration Continuous Deployment) tool, which I'd suggest VSTS (Visual Studio Team Services) for your beginning.
Approach #1
You can expose Windows Remote Management (WinRM) endpoint publicly and use PowerShell to perform a folder backup task. You will also need to invoke some scripts to write/copy your backup to Azure Blobs Storage. Your script must be authenticated silently so you don't need to key in Azure subscription admin or VM admin.
Once you have a PowerShell script, you can invoke this PowerShell by creating a new PowerShell task in your Build or Release definition. I'd suggest to define in Release definition.
Approach #2
It's more Cloud native and you don't have to expose WMI of your virtual machine which would lead to security threat. Instead, you utilize Azure Automation Worker to automate the entirely backup & copy to another Azure services (Blobs, Files, another backup/file server virtual machine..). In your run book, you need to use PowerShell DSC (Desired State Configuration) to interact with resources inside your virtual machine.
In VSTS, you have two ways to start your runbook
Invoke runbook's webhook: you can create a webhook for your runbook and call this webhook by creating a Http Task
Start runbook by PowerShell: similar to the approach #1, just create PowerShell task then use Start-AzureAutomationRunbook cmdlet with sample here.
Build an ARM template for your Runbook then define in Build definition. Here is the sample reference to deploy an ARM template in VSTS,
The reason I have to give several references because you might not have familiarity with CICD and DevOps concept, as well as some useful tools in Azure and VSTS which supports your continuous deployment. There are some awesome CICD solutions in the market you should also explore, such as Chef, Ansible, Puppet. They support CICD very well. Below are some references to get started with DevOps on Azure:
https://learn.microsoft.com/en-us/vsts/deploy-azure/
https://learn.microsoft.com/en-us/azure/automation/automation-dsc-overview
https://learn.microsoft.com/en-us/vsts/build-release/apps/cd/azure/azure-devops-project-aspnetcore
I want to be able to run an exe file in an on premises server from Azure, using a Logic app or maybe azure scheduler.
Is this possible, if so how?
Even doing this via Azure function could be an option. Do i need something like on premises data gateway or maybe even hybrid connections?
As I known, Azure Scheduler and Logic App don't support .exe file.
For Cloud service, I think you can use worker role to meet your requirement. Worker role could handle background processor. Also, you can use the startup task to run your exe.
You can see a example in this document.