Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Initial version of Save-AzDevOpsBuild #183
feat: Initial version of Save-AzDevOpsBuild #183
Changes from 1 commit
1906040
4639917
9239349
66161c1
447efee
d24dfd3
2133af3
cb3d5a9
b491c51
862bcbf
2932f0f
2bd2bd3
771f1da
1a08fbe
c43aa70
7b901ec
7322ba6
dab2f2d
36717ea
5a21069
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be important to also make sure that legacy Azure DevOps systems can benefit from this (legacy =
{organizationName}.visualstudio.com
).As I see it, you can benefit from the environment variable
$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
to retrieve the root URL where all Azure DevOps API calls can be made.Context: https://docs.microsoft.com/en-us/azure/devops/extend/develop/work-with-urls?view=azure-devops&tabs=http
On the other hand, we may consider using a client package for this. But that may be taking things to far.
https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=azure-devops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the API version also something we should parameterize? Default can be 6.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to parameterize the complete 'base' uri, as I thought it would make this more complex to pass this in as a parameter.
Unless you rely on this environment variable inside the script and do not pass it via a param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't see a point right now in parametrizing the API version ? @mbraekman ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we're typically doing, in case it's applicable, is set it as a parameter but default it to a specific version (as Stijn indicates). (for example in
Enable-AzLogicApp
)The reason for this is that based on this approach the same script can easily be used to use the latest/another specific version of the API, without requiring any changes in the script.
However, while API versions change very often in the case of ARM templates, for instance, this doesn't seem to be the case for DevOps-related APIs. So, not quite sure if in this case, it would be very useful.
--> So not really required in this case.
Regarding the base-URI, I would rely on the built-in variables as much as possible, as this requires less input from the client using the script, increasing user-friendliness. But, even so, we should still offer users the possibility to provide their own custom values, just in case.
--> use built-in variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then I'd suggest that we do not pass in the
organizationname
parameter, but put the DevOps variable which contains the Uri inside the script ? This has the side effect that this script is only usable from within an Azure DevOps pipeline; that's why I opted for passing in the organisationName as a parameter, and not to rely on theSystem.CollectionUri
variable which defines this base-url.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. So, we could opt for using the built-in base URL but that this is the default value for a custom provided URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this would make it more useable. You'll have to pass in an url, consumer needs to know if it requires a trailing slash or not (ok, you can handle that in your script), but imho, it makes the whole thing a bit less user-friendly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a good example how we did it for another DevOps script:
https://github.com/arcus-azure/arcus.scripting/blob/master/src/Arcus.Scripting.DevOps/Scripts/Set-AzDevOpsArmOutputs.ps1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm absolutely no Powershell expert, so if you have any improvements, recommendations, .... please let me know :)