Friday, May 31, 2019

Internal extensions in TFS

Some of the TFS Azure DevOps functionality that comes out of the box is internally organized the same way third party extensions are. You can even see their manifests:

use Tfs_Configuration;
select p.DisplayName, p.PublisherName, e.ExtensionName,
    e.DisplayName, e.ShortDescription, cast(Content as varchar(max)) as Content
    from Gallery.tbl_Asset a
        inner join Gallery.tbl_Extension e on a.ReferenceID=e.ExtensionId
        inner join Gallery.tbl_Publisher p on e.PublisherId = p.PublisherId
        inner join tbl_FileReference r on a.FileId = r.FileId
        inner join tbl_Content c on r.ResourceId = c.ResourceId
    where AssetType = 'Microsoft.VisualStudio.Services.Manifest'
    order by e.ExtensionName, a.Version desc

I can see multiple versions of the same extension there, my TFS instance went through several version upgrades; on a freshly installed copy there would probably be only one.

Let me know, TFS

Today's obscure corner of the TFS REST API to explore would be - notifications. Some time ago, I've noticed that SOAP is no longer an option on the collection-level Notifications screen, but it's supported internally. If it's supported internally, then it must be supported by the API. Indeed it is, there's a REST API endpoint for subscription creation, and one of the parameters is called "channel", and it's supposed to be an instance of ISubscriptionChannel. That's where the docs go blank, except mentioning that it has a type property.