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·125.9K 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·11.9K 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
Software Engineer at Autodesk·

I'd recommend against using PowerShell as a backend, unless your logic is very simple (maybe less than 100 lines total). I've worked with a huge framework written in PowerShell, and we hit a lot of bugs. (Some of the issues traced back to bugs in the PowerShell runtime itself! Most of the team who owned the PowerShell framework admitted that if they could reimplement it they would pick a different language.) If you're already using Python, then I'd recommend using Python for other backend code -- or a more structured .NET language, like C#.

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