Azure DevOps - how can we get the integer build definition ID? #12647
Replies: 4 comments
-
Oh, I have Pulumi |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok never mind - I was reading the error wrong and it was actually complaining about something else which I have now resolved |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @JohnLudlow, good that you found the issue! Any further questions, feel free to open a new thread or join the community slack. https://slack.pulumi.com |
Beta Was this translation helpful? Give feedback.
0 replies
-
Will do, thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a number of Azure DevOps git repos with corresponding pipelines (build definitions). I'd like to apply a policy that validates the PR build passes before allowing a PR to complete.
It seems as if
BranchPolicyBuildValidation.Settings.BuildDefintionId
expects an int (which makes sense because there is a numerical definition Id) but every way I've found so far of getting a build definition (e.gGetBuildDefinition
) has a string propertyId
which is the name of the definition (e.g "MySpecialBuildDefinition") not the int id (e.g "1234").The code above fails to compile because the types don't match when setting
BuildDefinitionId = azureBuildDefinition.Apply(b => b.Id)
, and it's not just a string that contains a number either (soint.Parse
doesn't work here).The documentation shows setting up a new repo and using its output:
This seems to fail for the same reason -
exampleBuildDefinition.Id
is a string, and its content is not numeric.Am I missing an obvious way to get the id of the definition?
Beta Was this translation helpful? Give feedback.
All reactions