azure-pipelines-tasks | Tasks for Azure Pipelines | Azure library
kandi X-RAY | azure-pipelines-tasks Summary
kandi X-RAY | azure-pipelines-tasks Summary
This repo contains the tasks that are provided out-of-the-box with Azure Pipelines and Team Foundation Server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of azure-pipelines-tasks
azure-pipelines-tasks Key Features
azure-pipelines-tasks Examples and Code Snippets
Community Discussions
Trending Discussions on azure-pipelines-tasks
QUESTION
I have a .Net 6 web application that I am building in devops. I am trying to substitute settings in the appsettings.json, but somehow can't get it working.
What I have:
- Azure Key vault set up, with a secret with the name: Configuration--ConnectionStrings--ConnectionString
- Pipelines have access to this Key Vault with a Variable Group
- I have tried the transform task in both build and release pipeline
- I have tried the option in the IIS Web app deploy task for substitution
1 - All is fine
2 - All is fine
3 - I have tried this task in build and release with the following configuration:
...ANSWER
Answered 2022-Mar-22 at 09:54I ended up solving it by creating variables in the pipelines and using the Key Vault secrets as the value. You have to use the dot notation like so:
Name of var:
QUESTION
We have the following PublishSymbols
task in our pipeline, and it's working correctly.
ANSWER
Answered 2022-Mar-03 at 02:41In the Azure Pipelines PublishSymbols task, how to specify multiple search patterns?
You could specify multiple search patterns directly with newlines:
QUESTION
To know if you are on CI of working locally you can use TF_BUILD, but I could not see any environment variable that helps me discern between a self-hosted and a microsoft-hosted agent.
How can you do that, without having to manually define a custom environemnt variable in our self-hosted machines?
Update: why do I need this? There are things that work in one way or another depending if it is ms-hosted or self-hosted. e.g. python virtual environements see microsoft/azure-pipelines-tasks Issue 15417.
...ANSWER
Answered 2022-Jan-10 at 09:44How about using Agent.Name? It is a predefined variable, which has:
The name of the agent that is registered with the pool.
If you are using a self-hosted agent, then this name is specified by you. See agents.
Assuming your naming scheme allows you to tell the difference between your own agents and MS hosted agents, that should do the job?
QUESTION
I am new to Azure DevOps and trying to create my first Azure pipeline. I have a ASP.NET MVC project and there are a few NuGet packages that need to be restored before the MSBuild step.
Unfortunately, the NuGet restore is failing with the following error:
The pipeline is not valid. Job Job_1: Step 'NuGetCommand' references task 'NuGetCommand' at version '2.194.0' contains an execution handler that relies on NodeJS version '6' which is restricted by your administrator.
NodeJS 6 came disabled out of the box so we are not going to enable it.
My Questions:
- Is there an alternative to NuGet restore that does not use NodeJS?
- Is there a way to update the NodeJS6 to a higher version?
update 23-Nov-2021
I have found a work around for the time being. I am using a custom PowerShell script to restore NuGet Packages and build Visual Studio project
...ANSWER
Answered 2021-Nov-18 at 14:25It's AzureDevOps' NuGetCommand
task that uses NodeJS, not NuGet itself. Therefore, you can find a way to restore without using Azure DevOps' NuGetCommand
task.
Idea 1: use DotnetCoreCli
task instead. However, this probably won't work for you since you said your project is ASP.NET MVC, rather than ASP.NET Core. Also, it also appears to need NodeJS to run.
Idea 2: Use MSBuild restore. You can test on your local machine whether or not this works by clearing your global packages folder, or temporarily configuring NuGet to use a different path, and then running msbuild -t:restore My.sln
from a Developer PowerShell For Visual Studio prompt. If your project uses packages.config, rather than PackageReference, you'll need to also pass -p:RestorePackagesConfig=true
(although maybe this is currently broken). I'm not an expert on Azure Pipelines tasks, so I don't know what it means that this task defines both PowerShell and Node execution entry points, but maybe it means it will work even if your CI agent doesn't allow NodeJS.
Idea 3: Don't use any of the built-in tasks, just use - script:
or - task: PowerShell@2
, but even that is a little questionable whether it'll work since even the powershell task defines a Node execution entry point. I'm guessing it will work, but I don't have access to a CI agent where NodeJS is forbidden, so I couldn't test even if I wanted to. Anyway, if this works, then you can run MSBuild yourself (but it might also be your responsibility to find msbuild.exe if it's not on the path). Or you can download nuget.exe yourself and execute it in your script. The point is, if you can get Azure Pipeline's script
task working, you can run any script and do everything you need yourself.
Idea 4: Use Microsoft Hosted agents. They have documented all the software they pre-install on the machines, which includes Node JS. Downside is that once you exceed the free quota it costs money, and I've worked for companies where it's easier to get money to buy hardware once-off, and pretend that maintenance of the server is free, even though it reduces team productivity, rather than pay for a monthly service. So, I'll totally understand if this is not an option for you.
Idea 5: Talk to whoever maintains your CI agents and convince them to allow & install NodeJS. It's clearly a fundamental part of Azure Pipelines. The tasks are open source on github, and you can see that pretty much all of them use NodeJS to orchestrate whatever work it does. Frankly, I thought the agent software itself was a NodeJS application, so I'm surprised that it runs without NodeJS.
QUESTION
I am trying to migrate my pipeline from Appcenter to DevOps since I need to leverage some of the build-runtime tools.
The Appcenter builds are working fine, and I can run the app in the phone. But when I create a new pipeline in DevOps with a gradle task, the build fails with this following error:
...ANSWER
Answered 2021-Nov-15 at 12:55Found out that the error was I did not point to the correct build artifact. Pointed to some old artifact that was not correct. Had to check the location where pipeline was building and point to that directory instead.
QUESTION
I'm attempting to deploy an aks cluster and role assignment for the system assigned managed identity that is created via terraform but I'm getting a 403 response
...ANSWER
Answered 2021-Nov-03 at 19:32The Service Principal in AAD associated with the your ADO Service Connection ('Matt Local Service Connection') will need to be assigned the Owner role at the scope of the resource, or above (depending on where else you will be assigning permissions). You can read details about the various roles here the two most commonly used roles are Owner and Contributor, the key difference being that Owner allows for managing role assignments.
As part of this piece of work, you should also familiarize yourself with the principle of least privilege (if you do not already know about it). How it would apply in this case would be; if the Service Principal only needs Owner at the Resource level, then don't assign it Owner at the Resource Group or Subscription Level just because that is more convenient, you can always update the scope later on but it is much harder to undo any damage (assuming a malicious or inexperienced actor) on overly permissive role assignment after it has been exploited.
QUESTION
I have some azure resources (Function App, Cosmos etc) that I have successfully deployed in a resource group using terraform init-plan-apply in a Azure Devops Pipeline. From my local CLI I can change the resources in the main.tf and redeploy, presumably because I have the tf state locally. However, when I try to redploy using the pipeline I get the usual error
Error: A resource with the ID "/subscriptions/xxxxxx-xxxx-xxxx-xxxx/resourceGroups/my -rg" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_resource_group" for more information. │
When I try to import using the config described here I get the unhelpful error
##[error]Error: There was an error when attempting to execute the process '/usr/local/bin/terraform'. This may indicate the process failed to start. Error: spawn /usr/local/bin/terraform ENOENT
Am I thinking about pipelines with terraform in the correct way? Should I be trying to import the resource group, or is there a better way to redeploy resources using terraform?
...ANSWER
Answered 2021-Nov-01 at 11:45You're right, the tf state is not saved on the Azure DevOps agents.
Common way is to use Azure Storage account to save the tf state.
You can find official Microsoft tutorial about it here.
QUESTION
Working with Azure DevOps, we use a Dockerfile to build and statically serve an Angular application:
Dockerfile ...ANSWER
Answered 2021-Aug-26 at 22:23Came across this question while searching for an answer to the same issue. I have spent the last few hours digging through source code for the Docker task and I think I can answer your questions.
It appears that the Docker task tries to parse the Dockerfile to determine the base image, and there is (was) a bug in the task that it was looking for lines with FROM
in them, but was incorrectly parsing the --from
from the COPY --from
line.
It then passes that base image to docker pull
and docker inspect
prior to calling docker build
. The first two commands fail because they're being passed garbage, but the third (docker build
) reads the dockerfile correctly and does a pull anyway, so it succeeds.
It looks like this was fixed on 2021-08-17 to only parse lines that start with FROM
, so I assume it will make it to DevOps agents soon.
QUESTION
On my InvokeRESTAPI
task I have opted to use the successCriteria
option as follows:
successCriteria: eq(root["status"], "successful")
It does not seem to be correct and for the response shown, it throws an exception.
...ANSWER
Answered 2021-Aug-24 at 03:19You can use single quotes to replace double quotes.
For example:
QUESTION
I am currently stuck at the init point in the Azure DevOps Pipeline. So I successfully install Terraform, but in the next step it already fails.
...ANSWER
Answered 2021-Jun-18 at 13:58Please make sure you have correct working directory. The message is misleading. The issue is in fact becuase terraform cannot find your tf files.
Please add this step to check if you have correct directory
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-pipelines-tasks
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page