Documentation says:
Build.BuildId - The ID of the record for the completed build.
Build.BuildNumber - The name of the completed build, also known as the run number and that it can be customized.
If you create a fresh build pipeline and do not customize BuildNumber format:
it will be given a unique integer as its name
In this case, is BuildNumber and BuildId exactly the same?
No, it's not necessarily the same. I just checked my classic and yml pipelines.
For classic
, both BuildId and BuildNumber are integers and are the same if not customized.
For yml
, BuildId is an integer and BuildNumber consists of the current date and number of tries per day. As per documentation, the format is $(Date:yyyyMMdd).$(Rev:r)
.