Is it possible to update a file in azure devops repository using power automate? - azure-devops

I can't find any connector in power automate to update a file in azure devops repository.
I am trying to automate the process of checkin our deployment sheet in azure devops repository. My flow is triggered when the custom work item type is closed. An adaptive card is sent to teams where the user can update the logs. Then I want to automatically update the log sheet present in azure devops. Prior to this we used to update the sheet in excel and again commit it from visual studio.

For operations which are not supported by the default connector you could always look into using the Azure DevOps REST API service in combination with an Send an HTTP request to Azure DevOps action.
I would look into using for example the Pushes - Create method:
https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pushes/create?view=azure-devops-rest-6.0&tabs=HTTP
Have a look at this StackOverflow thread, that might be useful as well:
How to use Azure DevOps REST API to Update File?

Related

is there any possibility to link AzureAlerts and Azuredevops workitems?

is there any automated way to directly create bugs in Azuredevops projects dashboard and assigned to team whenever Aure loganalytic query based alerts triggered?
Basically, if the Azure Log Analytics query based alerts can call other services or APIs, then it's possible to create work items by calling the REST API Work Items - Create. But, there doesn't seem to be a built-in way to do this.
However, there's an Azure Log Analytics connector in Power Automate. You can try to setup a flow using the Azure Log Analytics and Azure DevOps connectors in Power Automate. The flow will be triggered when the Azure Log Analytics query based alert is trigged.
You need to call the Work Items - Create REST API in flow to create the bug. More information please reference Add an Attachment in Azure Dev Ops using MS Flow and Azure DevOps Integration (via Microsoft Power Automate)

Create repositories in Azure DevOps from Power Automate

I have a Power Automate flow that receives data from a Microsoft Forms. From this form, I want to create a work item in Azure DevOps but also a repository.
I have bought the Premium version of Azure DevOps Connector that allows me to create the work item that costs £11/month.
There is no options for creating a repo but only to obtain the list of repo.
How can I create the repository? Is there an API for it?

Integrating Service Now with Azure Devops

i am trying to have an integration between service now and azure devops .
If any one can answer below question it be much appreciated.
How to trigger Azure DevOps pipeline automatically on Approving the Change Request in ServiceNow ?
I am approaching with rest API method to call AzureDevops from servicenow plateform.
Does anyone has done something similar and can help me here by listing steps to do so?
You need to create a Service Connection to you ServiceNow instance and then add a Gate in your Release pipeline which creates the Change Request in ServiceNow and then waits for it's status to change.
This provides a good guide - https://learn.microsoft.com/en-us/azure/devops/pipelines/release/approvals/servicenow?view=azure-devops and your gate will end up looking something like this:
You can also use an existing CR but then you'll need a way to supply that to the pipeline on creation of the release.
In the azure devops, we can Install and configure ServiceNow DevOps extension for Azure DevOps to send build and release notifications from your Azure pipeline to ServiceNow DevOps application.
For more details, you can refer this doc: Azure DevOps integration with DevOps

How to trigger Azure DevOps pipeline when pushing commits to bitbucket custom server?

My company's repository hosted on bitbucket custom server which can be only accessed from intranet.
Therefore, I setup a self-host agent for Azure DevOps and this agent could do a git pull and build and release too.
It works and the problem is I have to manually click RUN pipeline to start, and somehow when I pushing commits to my bitbucket custom server it doesn't trigger the Azure DevOps to kick off a build or release.
Is there some other options I could let it automatically triggers the Azure pipeline to run? Webhooks or Hooks?
I afraid Azure devops pipeline cannot be automatically triggered from a bitbucket custom server. For azure devops server cannot communicate to the bitbucket server hosted in your intranet.
Webhooks or Hooks cannot trigger a build in azure devops pipeline either. Azure devops doesnot have this feature yet. There is an open issue about this.
Currently you might have to trigger your pipeline manually, or create an azure function as mentioned in above link to trigger your pipeline automatically.
Below are some documents about azure function you may find helpful:
Develop Azure Functions using Visual Studio
Continuous deployment for Azure Functions
Azure Functions HTTP trigger:The HTTP trigger lets you invoke a function with an HTTP request.
Best approach to call web api from azure function
Trigger Azure Pipelines build via API

How would I go about setting up a web hook listener on Azure DevOps?

Goal:
We have a Translation Management System project with a set of string translations, which can be exported as iOS, Android, and web formats. This can be done via its API, CLI, or manually with the UI. We need to integrate with our git-based repository, which lives in DevOps, so that when changes are made to the TMS translations, the code base is updated automatically (preferably a PR would be created with the changes).
What I Have Tried:
I am a mobile developer with little web hook experience, but it seems that they are the key to the solution. I can configure the web hook on the TMS side, but need to provide a URL with a listener. Going through the Azure DevOps service hooks settings and reading documentation extensively, I can't find any leads on a way to set up a custom listener to subscribe to another service's web hook, consume its payload, and trigger an action in DevOps.
I'm aware this may be limited by the capabilities of the TMS and DevOps, but how would this be tackled viewing it from a high level perspective? It doesn't seem like there's any built-in solution, so what would a custom solution entail? If something along the lines of what I'm looking for isn't possible, I would like to know that as well.
Thanks in advance!
So that when changes are made to the TMS translations, the code base
is updated automatically (preferably a PR would be created with the
changes).
Sorry but as I know it's not supported scenario in Azure Devops Service.
1.The service hooks option in azure devops service is that when something(event) happens in Azure Devops Service, it runs task(action) on target service. But what you want is when something happens in external service, it runs task(action) in azure devops service. For now this behavior is not supported.
2.And different service in Service Hooks has different supported actions. Let's take Jenkins service(one service hooks) as example, see step5 in trigger Jenkins: Azure Devops can trigger Jenkins build.
As for Web Hooks(another service hooks), it can't trigger actions like the code base is updated automatically. It just sends the Json representation.
So the scenario you want is not supported for now by Azure Devops Service.
In addition: Not sure about how your TMS works, but you can consider using Azure Devops Rest API to trigger actions in Azure Devops Service. (These rest apis can be used to queue build, release or do git-related actions )
When changes are made to your TMS translations, you may call corresponding Azure Devops rest api to manage git repos in Azure Devops if your TMS supports this kind of behavior.
Hope all above resolves your puzzle why your scenario is not supported by Web Hooks in Azure Devops:)
When you Authorize your GitHub repo through the devops settings, webhook will be automatically created on your repo with configurable hook events.