microsoftdocs / azure-devops-yaml-schema Goto Github PK
View Code? Open in Web Editor NEWPublic mirror for the azure-devops-yaml-schema-pr repo.
License: Creative Commons Attribution 4.0 International
Public mirror for the azure-devops-yaml-schema-pr repo.
License: Creative Commons Attribution 4.0 International
#deployToSlotOrASE: false # boolean. Optional. Use when appType != "". Deploy to Slot or App Service Environment. Default: false.
Can appType
ever be ""
? It seems to be required to have 1 of 2 allowed values:
appType: # 'functionApp' | 'functionAppLinux'. Required. App type.
If/when appType != ""
(?always), is deployToSlotOrASE
then required or optional (with default false
)?
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
I was composing a new PowerShell@2 pipeline task and looked up if I should specify the filePath
with forward slashes /
or with backslashes \
as directory separators. The docs contain no instructions on this. There is one example that uses backslashes.
filePath: $(System.DefaultWorkingDirectory)\test2.ps1
So I assumed I should use backslashes. But, doing this gave me a pipeline error:
##[error]ENOENT: no such file or directory, stat '/azp/agent/_work/55/s/vm-customscripts-demo\pipeline-scripts\upload.ps1'
Changing the backslashes to forward slashes fixed the error for my environment.
I believe that the path separator for the filePath
is platform-dependent: /
for linux/macos pipeline agents, \
for windows agents.
Could you clarify this in the docs?
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
When looking at the References menu of the top-level devops/pipelines documentation, there are many items to select:
https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops
Clicking on Expressions, I see what I expect -- the navigation menu is updated with my position and I see the content for Expressions:
The bug appears when I click on the YAML schema. I lose my context on the left with no option to look at the other resources except via back button or editing the URL.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
There was a recent change to update the default of the fetchDepth to 0. This broke some pipelines for customers that depended on fetching the entire repository for evaluation bu tools like gitversion. The default should be documented here.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Keep up the good work!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi team.
Why does this detail differ from: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops ?
In particular the "pipelineId" input string is added on this page, but it referenced as "pipeline" on the above link.
The examples also reference the "pipeline" input, not "pipelineId".
Thanks
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Hi!
The AzureFunctionApp@1
has an azureSubscription
property and the comment in the docs says "Required. Azure subscription.".
To me, it looked like I was supposed to add the Azure subscription GUID here and I even tried the name.
What was needed though, was a service connection, which neither the name or comment indicates. 🤔
Can you add something to the comment that indicates this? 🙏🏻
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The list under Remarks is missing the property: retryCountOnTaskFailure
I prepared a PR for this. Feel free to edit as needed.
Thanks,
--Neno
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Perhaps nitpicking: explicitly showing default property values would reduce ambiguity IMO.
autoCancel: boolean
# Whether to cancel running PR builds
when a new commit lands in the branch.
Arguments: (false,n,no,off,on,true,y,yes). Default argument: false.
⚠ Ikke rediger denne delen. Den kreves for koblingen docs.microsoft.com ➟ GitHub-problem.
Upon creating new pipelines since 1/9/2022 the checkout behaviour in Azure DevOps is only doing a git fetch on the ref spec of the current branch. We do not specify any additional parameters just checkout: Self
as evidenced here:
Checkout task in pipeline:
- checkout: self
Output from line 33 in checkout task:
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin --depth=1 +<HashValue>:refs/remotes/origin/<HashValue>
Exploration of this issue has led to finding that adding fetchDepth: 0
returns the checkout task to normal behaviour as shown below:
Checkout task in pipeline:
steps:
- checkout: self
fetchDepth: 0
Output from line 33 in checkout task:
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin
The current expected behaviour of a script that runs as part of the pipeline, looks to do a Git Diff with origin/main. following the recent changes this behaviour has stopped working resulting in a breaking change. This behaviour is only for newly created pipelines and not for existing pipelines already configured in ADO. The default value of 'git fetch' is not published in this documentation to cross reference.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Re: the clean
property:
"Scorch the repo before fetching?" isn't very informative :)
Does it issue a "git clean"? With what params?
Also, the description for this property doesn't indicate what the default value is. Several other properties don't have their defaults indicated either.
Thank you.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The YAML schema reference does not list the name:
keyword, from which you are able to name the pipeline-runs like the following:
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(rev:.rr)
It is only mentioned in the Build Number Section
Is this the only missing keyword, or are maybe others also missing?
Thanks!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Documentation shows you can reference a branch, but does not show using tags which is possible. Include usage examples. Also indicate if wildcards can be used and provide an example if so. I'm trying to reference tags with the format Major.Minor.Patch by using ref: refs/tags/1.* and it is failing.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
[Enter feedback here]
Under types definition, the document refers to Project
without defining what a project is. For someone trying to understand the syntax, this leaves out the context on what the project is referring to here.
If you specify type: git, the name value refers to another repository in the same project. An example is name: otherRepo. To refer to a repo in another project within the same organization, prefix the name with that project's name. An example is name: OtherProject/otherRepo.
Also there is no context provided on why the other project name needs to be specified for name? The definition is very confusing
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The 'path' field is defined incorrectly on this page as:
Path of the repository to check out
Other documentation describes it more accurately as:
where to put the repo; always rooted at $(Pipeline.Workspace)
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
[Enter feedback here]
Please update the required agent version! Our pipelines are failed because of the changed bash task and our 2.204 agent version.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
AdditionalArguments - This is list of variables that can be inputted, there is no way to know what these variables are since there is no supporting documentation linked and there is no way to search in your documentation or on google to get an answer.
A link to supporting documenation that explains what can be input here would allow developers to easily find what they need.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
I'm running a self-host ubuntu 20.04 Azure DevOps agent on my AKS cluster with Azure Workload Identity.
In a job I have specified the following:
- task: AzureKeyVault@2
displayName: Get password
inputs:
azureSubscription: 'Azure Subscription'
KeyVaultName: 'kv-pipeline'
SecretsFilter: 'dev-postgress-admin-password'
RunAsPreJob: false
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
restoreCache
shortcut for cache task marked as invalid by pipeline validator. Says it's not installed.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
deploymentName: This does not mention that there is a limit to the length of the name. It fails when it is > 64 characters. Would be super useful if that was documented, as well as some explainers on how to manage this (i.e. how to truncate a value > 64, or even change this so that it automatically truncates (or gives you the option to do so)
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Prior to the change in the layout of Azure Pipelines YAML "schema" trying to look like the C#-styled docs, there was an actual schema or specification as to what the Task looked like. Where did that go?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi,
matrix: { string1: { string2: string3 } } # Job matrix, see the following examples. # Matrix defining the job strategy; see the following examples.
This line is commented twice.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The pipeline resource metadata as predefined variables lists resources.pipeline.<Alias>.projectName
as an available predefined variable, however this variable does not resolve when trying to use it in a pipeline:
Attempting to output this variable using an example script task as follows;
resources:
pipelines:
- pipeline: myresourcevars # identifier for the pipeline resource
source: mypipeline # source pipeline definition name
trigger: true
steps:
- script: |
echo $(resources.pipeline.myresourcevars.projectName)
results in the following output when running the pipeline:
Starting: CmdLine
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.178.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
"C:\WINDOWS\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\environments\someagent\_work\_temp\c3aee017-483c-43f6-b9f4-193b850e6601.cmd""
$(resources.pipeline.myresourcevars.projectName)
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Newly created pipelines now have shallow fetch enabled and set to 1 by default:
Not sure since when this happens, but... perhaps it would be useful to mention it in this documentation?
I also opened this issue here: https://github.com/MicrosoftDocs/azure-devops-docs/issues/12732
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Rather than making us go to https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops
Say it here
download
string
Required. must be current
Using a different value like specific
does not make sense unless the other parameters like pipeline
and project
are documented and allowed. If allowed then the text should be
Download artifacts produced by the current pipeline run, or from a specific pipeline run. Use current
to download artifacts from the current pipeline or use specific
to reference another pipeline via project
and pipeline
arguments.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Please add this case into documentation:
When we use option addSpnToEnvironment: true in Linux with bash for Azure CLI command parameters we have to use this syntax (environment variable with runtime expression syntax):
paramName=${servicePrincipalId}
instead of
paramName=$servicePrincipalId
For example:
- task: AzureCLI@2
displayName: 'Deploy the whole infrastructure to Azure'
inputs:
azureSubscription: 'DefaultAzureServiceConnection'
addSpnToEnvironment: true
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az group create --name $(resourceGroupName)-$(nameSuffix) --location $(location)
az deployment group create --resource-group $(resourceGroupName)-$(nameSuffix) \
--template-file $(templateFile) --parameters nameSuffix='$(nameSuffix)' \
appNamePrefix='$(appNamePrefix)' semVer='$(GitVersion.SemVer)' sqlAdministratorPassword='Pass' \
acrUrl='$(acrUrl)' acrLogin='$(acrLogin)' acrPassword='$(acrPassword)' \
executorSecurityPrincipal=${servicePrincipalId}
Otherwise, it won't work.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Here's an example from the page:
environment: # create environment and/or record deployments
name: string # name of the environment to run this job on.
resourceName: string # name of the resource in the environment to record the deployments against
resourceId: number # resource identifier
resourceType: string # type of the resource you want to target.
tags: string | [ string ] # tag names to filter the resources in the environment
This is a bug logged in February 2021 and a promise from Microsoft that the docs will be fixed.
Yet, the pipeline still wouldn't run, reporting A sequence was not expected
if an array of tags is used in tags
.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
It's not defined when resource variables are available. For example, none of $[ variables.resources.pipeline.ResourceAlias.runName ]
, $[ variables['resources.pipeline.ResourceAlias.runName']]
, or ${{ variables.resources.pipeline.ResourceAlias.runName }}
work when trying to map it to a YAML variable block.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Are there more advanced examples on this?
Like setting dependsOn, condition and variables in the stage template?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
[Enter feedback here]
Why branch includes with $(Build.SourceBranch) is not working?
To pick up the branch by the pipeline given branch in ADO, I tried this config
trigger:
batch: true
branches:
include:
- $(Build.SourceBranch)
But it didn't work.
Any idea?
Thank you
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hello,
I have a pipeline that have several (3) resources pipelines, in order to trigger my pipeline when one of these pipeline are finished.
I would like to retrieve the name of the pipeline which triggered my pipeline.
I tried to use the Build.TriggeredBy.DefinitionName
variable, but it's not populated in yaml mode.
I understand I could use : resources.pipeline.<Alias>.pipelineName
but I have several resources triggers, and values are populated even for pipelines that didn't triggered the pipeline, which makes me unable to find the actual pipeline which triggered my pipeline.
Here my resource block:
pipelines:
- pipeline: prc-y3-CICD
source: prc-y3-CICD
project: INT-MS
trigger: true
- pipeline: prc-y3-RELEASE
source: prc-y3-RELEASE
project: INT-MS
trigger: true
- pipeline: Trigger2
source: test
project: SDT - DevOps_Legacy
trigger: true
Let me know if my issue is at the wrong place.
Thanks
Hi,
the documentation specifies that a job ID may consist of these characters [-_A-Za-z0-9]*
.
When using TF-Plan-DEV
as the ID the Azure DevOps Services Portal complains with the following error message:
Stage DEV job TF-Plan-DEV has an invalid name. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
So I suggest these improvements:
-
aren't allowed.I suggest to update the documentation to use this regex ^[_a-zA-Z][_a-zA-Z0-9]*$
or in shorter form ^[_a-zA-Z][\w]*$
.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
It's not very clear what values lfs
, submodules
and persistCredentials
can take. They are listed as having string values, but the description implies they really want to be boolean. Or, for instance, can submodules
be recursive
?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Existing:
By default, the task creates a directory similar to JAVA_HOME_8_X64_OpenJDK_zip for extracting JDK. This option disables the creation of that folder and, if set to true, JDK is located in the root of jdkDestinationDirectory instead.
Should be:
By default, the task creates a directory similar to JAVA_HOME_8_X64_OpenJDK_zip for extracting JDK. This option disables the creation of that folder and, if set to false, JDK is located in the root of jdkDestinationDirectory instead.
[Enter feedback here]
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The description for the 'batch' parameter in the "trigger: batch, branches, paths, tags" section is like most code comments. 😊 It just states the obvious... re-reads the variable/parameter name for me. The user's intent when looking up this parameter is to understand what behavior true will produce. Does the build pipeline wait 20 minutes before starting the build in case other PR's complete in that 20-minute window, so that they can all be integrated ("batched") into a single CI build? Is it not time-based?
Does "batch" or some other behavior of the pipeline config determine whether multiple runs of the CI build will run concurrently? For example, if a previous run of the CI build is pending an approval (or something), will new commits be "batched" until the previous "batched" run of the CI build completes?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hey!
I was just working with this plugin and using dotnet sdk 6.0.x which downloads .NET 6.0.9 instead of the latest patch version which is 6.0.10.
How can I see if the latest patch version is available and when will 6.0.10 be available?
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The example shows a property named name
, but that is not part of the description above.
▶ Let's either correct the example or add the missing property to this page.
Thanks!
--Neno
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
When the resource name for a deployment job is set (as documented here), you get this error:
Job XXXX: Resource YYYY does not exist in environment ZZZZ.
I verified that the YYYY is member of the environment ZZZZ.
When the resource id is used, it works.
When trying to set pipeline resource identifier using a parameter or $(Resources.TriggeringAlias) the pipeline just hangs. Only seems to work if we hard code the Resource Pipeline name.
This restriction means we can't have a template for deploying app service which can be used by multiple triggering pipelines.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
In https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops&tabs=yaml there is a note that:
The download keyword is a shortcut for the Download Pipeline Artifact task.
The download-pipeline-artifact task supports path
parameter while the download task dumps artifacts into a predefined location, is there a reason for such inconsistency?
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Probably just a relic of pre YAML docs but it would be awesome to clear up any confusion!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
There are a large list of hosts one must allow for all functionality of a TFS build agent to work.
As noted here for publishing test results you only seem to need two of them.
For the sake of easing troubleshooting please note that TestResultsPublisher.exe is called by this task and that the agent it runs on needs access to https://vstmrblob.vsassets.io and https://.vstmr.visualstudio.com specifically.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I'm looking for the default behaviour if a single test fails in this Test task.
Does it fail the task? (e.g. in an ARM template, in a task after this one, would succeeded() in a condition return false?)
condition: and(succeeded(), ne(variables.test, false))
Would the Build fail? It appears to but I can't see this documented anywhere.
It also looks like test results are always published, and there's no need for the PublishTestResults@2 task. But I can't find confirmation yes/no of this either. Even if this is implicitly included under the VSTest@2 task, it has a property of failTaskOnFailedTests
but this defaults to false so I'm still stumped.
My ARM template task:
- task: VSTest@2
displayName: Test
inputs:
testSelector: 'testAssemblies'
searchFolder: src\$(srcPath)\Tests
testAssemblyVer2: |
**\bin\Debug\*\$(namespace).Tests.*.dll
!**\$(namespace).Tests.Framework.dll
!**\obj\**
vstestLocationMethod: location
vstestLocation: $(TestPlatform)
testRunTitle: '$(namespace) (all tests)'
runSettingsFile: '$(Build.SourcesDirectory)\$(testFmwkPath)\$(testSettings)'
codeCoverageEnabled: false
publishRunAttachments: true
failOnMinTestsNotRun: true
minimumExpectedTests: '1'
runInParallel: false
platform: '$(buildPlatform)'
configuration: Debug
condition: and(succeeded(), ne(variables.test, false))
Thanks!
Ger
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
This page mentions being able to pass parameters into the variable template, but the examples don't include that usage. I think it would be very helpful to include examples which might demonstrate syntax, and perhaps suggest proper use-cases and caveats to watch out for.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I am trying to run ForEachObject-Parallel, but that is a feature new to POwershell 7 and the pipeline is unable to run it as of now.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Add more detailed example on the usage of extraProperties syntax
extraProperties: |
sonar.projectKey=project-key
sonar.projectName=project-name
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Under Pipeline resource metadata as predefined variables, the following statement is made: 'In each run, the metadata for a pipeline resource is available to all jobs as these predefined variables'.
Are the pipeline resource metadata available as predefined variable names, or are their values predefined?
I ask because in the documentation for Template expressions, it says that 'only predefined variables can be used in template expressions.'
However, when trying to acess one of the pipeline resource variables within a template expression, e.g. ${{ if eq(variables[resources.pipeline.<Alias>.sourceBranch], 'refs/heads/master') }}
, no value is returned.
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The section called "The pipeline resource metadata as predefined variables" is kind of misleading as it refers to a "Alias" property which is unknown. There are just properties "pipeline" and "source" that seems to be valid for the context.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.