Objective: I am trying to build a custom service that will create VMs in Azure, based on inputs taken from a web interface. I want the backend code that interacts with Azure to be PowerShell.

Ask: Hoping to find help with deciding the simplest architecture of tools to achieve this.

What I have so far with my Limited Knowledge: I am new to Azure and Jenkins. I arrived at Jenkins coz it can run PowerShell and has API that can be called to trigger a job. Although integrating with it over the web seems problematic since its on-prem network. I hear it is possible using the VPN. For the Web, I hope to use Azure Web App with Python/Node.js that I can manage to make API calls to Jenkins.

Is there a better way? I just need help getting the right directions; I will walk the way.

READ LESS
6 upvotes·396.8K views
Replies (3)

If you want to use Azure Web Apps and want to keep it all in one ecosystem then easiest would be to use Azure Devops for the pipelines and Azure Functions to run the PowerShell code. Azure DevOps is a CI/CD platform(and more) kind of like Jenkins but integrated into Azure. And Azure Functions is a serverless thing that can run your code(your PowerShell) on demand without the need to have it hosted on your server. Jenkins can be nice but you will have to host it somewhere. If you want you could use Azure to set up a VM that hosts Jenkins and the website Frontend. Technically if you have the website, it's backend language should be able to execute scripts that are on the same machine so you wouldn't even need Jenkins or another pipeline solution. It would be recommended though for easier management.

READ MORE
4 upvotes·2 comments·12.2K views
Florin Labou
Florin Labou
·
January 20th 2021 at 3:30PM

I would have a look at "infrastructure as code" solutions like Hashicorp Terraform or Ansible from Redhat that support declarative and/or imperative approaches in the provisioning of cloud resources.

·
Reply
Maximilian Hütter
Maximilian Hütter
·
November 4th 2021 at 8:27PM

Going from your original requirement, that you want to build a web interface to provision new Azure VMs, your stack seems to be overly complicated. Why would you need to use Jenkins and Powershell at all? First Jenkins is a Continous Integration Server, you don‘t need it. Second Powershell is a Shell-Script, you can interact with Azure through Powershell but you don‘t need to. As others said, don‘t build your backend service in Powershell, if you can make it work, it will not be maintainable.

You mention you want to build the web interface itself on Python or Node.js, both are fine, just use the one that works best for you. Both allow to you to create a backend service that can make the API-calls to the Azure-API to create your VMs.

·
Reply

You must have gone through multiple thoughts on how to handle the requirement, but the biggest problem that I am able to see here is a dependency on a certain platform for executing Powershell scripts. Next is being a developer will never suggest having Powershell or bash as a backend of your system until it is related to some IoT Stuff. In place of it, I would rather suggest you use Infrastructure as a Code that comes with terraform or Ansible or as your application is based on Azure so u can use Azure Resource Manager too.

Adding to it for making config or attaching a trigger to these infrastructure controllers, you can use lightweight stateful APIs with the help of flask or express or go-mux, to keep track on the progress of deployments.

READ MORE
4 upvotes·801 views
View all (3)
Avatar of Rohin Sidharth