How to share build failure reason of azure devops pipeline through a mail? - azure

I am working on build pipelines and i felt that i should be able to get a notification on why exactly my build failed when there is build failure(i.e, which task failed and reason for it ). Right now we will only get a mail which just gives build status whether its is succeded, failure or partial succeded.
I was expecting some of you guys might have came across this thought and succeded in implementing it.Any references to that would be much appriciated.
Thank you in advance.

Azure Devops does not support that feature. You may add your request here: Azure DevOps (formerly Visual Studio Team Services).
In addition, you could use Rest API: Builds - Get Build Logs and Builds - Get Build Log to get detailed logs, and install this 3rd-extension: Send Email in organization and then use it to send email which attaching the logs from failed build to get detailed notification.

Related

The following team project collection is stopped ... Start the collection and then try again

Background: We have an azure DevOps pipeline that we use to automatically deploy a webapp we maintain to an azure test instance.
This suddenly stopped running today with the following error.
TF24668: The following team project collection is stopped: ***********. Start the collection and then try again. Administrator Reason: abuse
where *********** is our project name.
It fails instantly when this happens. It doesn't appear to do anything else other than throw this error.
The developer who initially got the pipeline set up is no longer with the company.
I've looked through the DevOps interface, and I can't find what it means by this "project collection", and I can't find out how to start it.
Any ideas where I should look?
If you are using Azure DevOps Service. This is a known issue on Azure DevOps, Microsoft Product Team has fixed it and all hosts have reboot, you could try it again and then kindly share the result here.
If you are using Azure DevOps Server, you should open Azure DevOps Server Administration Console->click the tab Team Project Collections->check the collection and ensure the state is Online, then try it again.
Note: If you do not have enough permission to do this, please contact the collection administrator to check it.
I faced the same and reported an issue on Microsoft Developer Community and got the following response
We had some bad actors using our MS-HOSTED pipelines pools in ways they should not have been, and we blocked them in order to maintain the stability of Azure Pipelines.
Full response can be found here
This ended up being a bug with azure that they fixed within a few days
See https://developercommunity.visualstudio.com/t/Azure-Pipelines:-errorTF24668:-The-f/1239940
As stupid as it might sound there is an Azure DevOps Dashboard that states health of Azure DevOps services. I got his error on Wednesday where status of pipeline service in my region was marked as degraded. On Thursday status changed to healthy and my pipeline works!

Azure Pipeline with Review Apps - Cleanup after merge

I've been setting up a pipeline for our project with Azure Pipeline using yaml. Currently adding review apps with Azure Kubernetes Service and was wondering how we should clean up after the PR is merged.
We are building docker images, pushing them to our registry, deploying them to a new dev space. Then it's all just left there.
After merge we're never going to bed those images again, not like we're going to deploy from a unapproved PR and there's dozens of them every day. We also would like to delete the review app and take down those extra deployments after we're done with them
I can't find anything in the documentation for this. Am I missing something?
I’ve been wondering the same thing, how does one clean-up all the “ephemeral” resources? Seeing the documentation says “ephemeral” I had hoped this functionality was built in.
Even though we trigger on master, I don’t believe there is enough information available in the pipeline to know which PR caused the commit to master, thus we cannot be guaranteed to tear down the correct review app.
I've been working on this today and think I've got it working.
I made a new pipeline that uses the kubectl task to delete the review app namespace, it also uses the azure cli task to run az acr purge to delete the images created for the PR, the tags of which are prefixed with the pr number so it can identify them.
I set this pipeline to not run with CI and not download the source.
Then I made an Azure Function that uses calls the Run Pipeline API to run it, passing the PR number as a variable to the pipeline.
Finally I used Service Hooks to invoke the Azure Function on PR Updated.
The only thing outstanding is the Environment Resource that is created automatically on the DevOps site does not get deleted. I cannot find an API for this so we might have to live with that.
By using browser dev tools and click the delete button in ADO I managed to find out how to delete environment resources using the Azure DevOps Rest API.
You can send:
DELETE <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments/{environment-id}/providers/kubernetes/{resource-id}?api-version=6.0-preview.1
To find environment-id and resource-id use:
GET: <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments?api-version=6.0-preview.1
GET: <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments/{environment-id}?expands=resourceReferences&api-version=6.0-preview.1

Azure devops - 302 status code when publishing universal package

i am trying to publish artifact from my local host to azure devops as universal package. I downloaded newest azure CLI (2.3.1) installed newest azure devops (0.18.0). After that i logged in using az login and also created my own personal access token and logged in with az devops login command. There were no errors so i assume that i logged in, i also did it with debug enabled and everything went fine.
After that i tried to publish my universal package into artifacts in my project but i got message
Failed to update Universal Packages tooling. Operation returned a 302
status code.
Error screen
In debug mode i've got
failed while trying to get token for tenant {tenant_id}
Later on there was also a retry with PAT but again 302 status from OPTIONS request.
I also tried to do other actions on my account using cli and everything was ok. I removed user from my team and it went smoothly.
Can i ask for help with this issue, if there is other option to publish this package it would be great.
The operation of Package publish from Azure cli need the support of artifacttool, so we combine these 2 operation together. When you run the command of az artifacts universal publish, it will firstly install/update the artifact tool to latest, so that it could make sure the publish action can be smoothly.
Now, the issue you faced is during the artifact tool updating. Not sure what happened on your side since it all work fine for me at present. I did universal package publish very successfully just now.
Work around:
Since you stuck at artifact tool updating, just avoid that. You can do package publish by using Azure devops task.
Just go pipeline, add Universal packages task and then configure it with below arguments:
Then, run this pipeline with self-agent(must). Because your are trying to publish the local files to Azure Universal package, only self-host agent can have ability to access local folder.

Azure Docker Web App - Failed to update data for container settings

I'm trying to configure continuous deployment for my Web App in Azure so it deploys every time I push an updated container image to the Azure registry.
However, when I go to "Container Settings" and set "Continuous Deployment" to true and then hit save I get the following error:
"Failed to update data for container settings."
I'm not sure how to start debugging this error message to find out what the issue is.
Does anyone have any ideas?
I faced the same error message when trying to update the configuration of a multi-container app.
The Azure portal sends the update as a request to their management API and the JSON response to this request contains a more detailed error message. This might help with debugging. For example, in my case the configuration was too long and this was kind of communicated in the response that I was able to find through the network tab of my browsers developer tools.
This just worked after revisiting the portal after a couple of days. Must have needed a bit of bedding in...

How to integrate AzSK in VSTS CI-Build

Am working on Secure DevOps Kit for Azure(AzSK) using VSTS CI&CD. For working AzSK in VSTS there were two tasks named "AzSK ARM Templete Checker" and "Secure DevOps Kit(AzSK) CICD Extensions for Azure" which are available from Market place. But, here am unable to access "Secure DevOps Kit(AzSK) CICD Extensions for Azure" task after adding both to my organisation. Is there any extension/install additional tasks to add them for accessing it?
Please suggest me to "How to add it to my CI-Build Definition"
Based on the screenshot, you have installed the extension.
Secure DevOps Kit(AzSK) CICD Extensions for Azure is just the name of the extension. And the real task is AzSK ARM Template Checker.
So, you just need to add the AzSK ARM Template Checker task under test hub.
UPDATE:
Well, please note that another AzSK_SVT task (AzSK Security Verification Tests) is available in 'Release' pipeline tasks only.
So to use it you need to create a release pipeline,... then add the AzSK_SVT task from Test category. Please see Security Verification Tests (SVTs) for details.
First of all I am sorry to ask you a question not relative to your question.
(as it seems that your question is already anwered :) )
I am using the same task in my relaese pipeline and I am trying to add custom checks because the default checks this task is doing is not good enough for me.
This tutorial is really helpfull for trying to set things up, only I seem to just get to add custom baselinecontrols for a local module and not getting it to add it in the azure devops pipeline (more info about my question .
As you are also working on the same task I was hoping that you maybe could me help me figure it out.

Resources