Azure DevOps invoked from an API to lauch a Terraform file - azure

Based on the following design I want to launch a Terraform file and an application code on Azure DevOps when an Azure Functions trigger the Pipeline.
Do you know any example to do a normal API REST Call to A. Dev Ops?
(using Python or JS)
Do you think it is a good strategy to generate an orchestration pipeline to make the workflow of the infrastructure and later on the application code?
In order to deploy the application
code, how can I modify it using the arguments coming from the API?
architecture design

Related

Can Azure Logic App pull repository from bitbucket?

Is it possible to pull / clone bitbucket repository within Azure Logic Apps?
I am curious if it is possible to set up some backend tests within Azure Logic Apps. So to pull repo with tests first and then execute them within CLI. I see that there is bitbucket connector in Logic Apps but there is no option to pull the repo. Or should I check some custom connector to run commands from hand like "git clone" etc. - if yes which one?
Azure Logic Apps is a cloud platform where you can create and run automated workflows with little to no code. By using the visual designer and selecting from prebuilt operations, you can quickly build a workflow that integrates and manages your apps, data, services, and systems.
From: What is Azure Logic Apps?
The key concepts here are "little to no code" and "prebuilt operations". Building your code with a CLI and running its tests is not something Logic Apps is targeting. It would also make executing Logic Apps a LOT more complex on the Azure end, since it would mean installing any and all frameworks, tools, etc. that are needed for building the code/running the tests.
If you look at Bitbucket actions that are supported, you can kind of make out that they're all API calls.
What you're looking for is available for free with GitHub workflows
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
or Azure Pipelines.
Azure Pipelines automatically builds and tests code projects. It supports all major languages and project types and combines continuous integration, continuous delivery, and continuous testing to build, test, and deliver your code to any destination.
Potentially interesting read: Build Bitbucket Cloud repositories.

How to create Standard Logic App using Rest api?

Using the official documentation Azure Logic Apps, i'm able to create and work with Consumption Logic Apps. Is it possible to create Standard Logic App using Rest API in similar way?
The simple answer, as it currently stands and looks to be, is no.
As per the documentation ... https://learn.microsoft.com/en-us/azure/logic-apps/single-tenant-overview-compare#create-build-and-deploy-options
There are currently limited options for a standard logic app.
Standard
Consumption
Update
Standard logic apps now have additional ways to deploy, still not the full suite but it's grown.
This is tecnically possible but you need to rethink the definition.
Logic App Standard (aka. Single-Tenant Logic App) is built on top of the function runtime and the infrastructure is seperated from the actual workflow definition. Deployment to the resource basically works the same way as for Function Apps.
Deploy the infrastructure
Deploy the workflow (function for function apps).
More on that here: DevOps deployment for single-tenant Azure Logic Apps
For your case you would:
Deploy the infrastructure via the REST API
Storage account
Server Farm (App Service Plan)
Site (App Service)
Build the Logic App Standard project and create a zip archive.
Deploy the archive using zip deployment via REST API.
This sounds easy but requires more work, see links below.
Links:
Set up DevOps deployment for Standard logic app workflows in single-tenant Azure Logic Apps
Deploy ZIP file with REST APIs

Can I automatically deploy same Azure function code multiple times to different functions?

My scenario is that I have an Azure function that executes some logic.
We are scaling the system and making it self-serve where each partner can clone the function, change the configs, and deploy to a new Azure function.
Since the function's logic will be exactly the same and the only difference is in the config files, I'm wondering if there is a way to let partners only add a new config file and then the function logic gets deployed to separate functions, 1 function for each config file. I need to do that because cloning the same code over and over sounds messy.
You can use Azure Functions to deploy your code continuously by using source control integration.
It enables a workflow in which a code update triggers deployment to Azure.
For continuous deployments of azure functions check Deployment requirements.

Machine learning in Azure: How do I publish a pipeline to the workspace once I've already built it in Python using the SDK?

I don't know where else to ask this question so would appreciate any help or feedback. I've been reading the SDK documentation for azure machine learning service (in particular azureml.core). There's a class called Pipeline that has methdods validate() and publish(). Here are the docs for this:
https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline.pipeline?view=azure-ml-py
When I call validate(), everything validates and I call publish but it seems to only create an API endpoint in the workspace, it doesn't register my pipeline under Pipelines and there's obviously nothing in the designer.
My question: I want to publish my pipeline so I just have to launch from the workspace with one click. I've built it already using the SDK (Python code). I don't want to work with an API. Is there any way to do this or would I have to rebuild the entire pipeline using the designer (drag and drop)?
Totally empathize with your confusion. Our team has been working with Azure ML pipelines for quite some time but PublishedPipelines still confused me initially because:
what the SDK calls a PublishedPipeline is called as a Pipeline Endpoint in the Studio UI, and
it is semi-related to Dataset and Model's .register() method, but fundamentally different.
TL;DR: all Pipeline.publish() does is create an endpoint that you can use to:
schedule and version Pipelines, and
re-run the pipeline from other services via a REST API call (e.g. via Azure Data Factory).
You can see PublishedPipelines in the Studio UI in two places:
Pipelines page :: Pipeline Endpoints tab
Endpoints page :: Pipeline Endpoints tab

How to deploy Logic App code via Azure DevOps?

I'm currently trying to understand how I can deploy a Logic App from Azure DevOps. I'm trying to give my team the ability to back out changes. Is this possible without using a series of scripts?
I'd like to create a release that does the following
Deploy Logic App ARM template
Upload code to Logic App from VSTS/DevOps
There is a good article on how to prepare the logic apps for CI/CD into multiple environments using ARM template.
You just need to download the ARM template for the Logic app and make changes in the template file, declaring parameters. You will also need to create parameter files for each environment. You can then create a Azure Pipelines and upload the files to the build and release definition.
https://platform.deloitte.com.au/articles/preparing-azure-logic-apps-for-cicd
You should extract the ARM template for your logic app and upload it to DevOps, then make a build and release definition
there are several helpful links available, here is one:
https://platform.deloitte.com.au/articles/preparing-azure-logic-apps-for-cicd
Edit: Link to Logic App Extractor:
If you just want to know how to deploy Logic App with VSTS, maybe this doc could help you.

Resources