Quantcast
Channel: Scrum Bug
Viewing all 216 articles
Browse latest View live

Solve basic auth proxy issues with Nuget, Visual Studio and Xamarin (hack)

$
0
0
When you're using Visual Studio behind a Basic Authenticaton proxy, you may run into issues restoring Nuget packages. While I've never found a real solution for the issue, and trust me I've tried quite a few workarounds like the ones listed here.

You'll get the following error:

[5:06] Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and put it to the C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.3.0.0 directory.
[5:06] Reason: The remote server returned an error: (407) Proxy Authentication Required.

I've come to rely on my trusted hacking friend Fiddler and turn on "Automatically Authenticate".


Optionally configure your upstream proxy in Fiddler:



Restart Visual Studio so it picks up Fiddler as the proxy and you're good to go. Just leave Fiddler running in the background and all will be well.


Force uninstall Visual Studio 2017 Release candidates

$
0
0
If you, like me, are stuck trying to upgrade Visual Studio 2017, then you may only get unblocked by removing everything ans starting afresh. Since Visual Studio 2017 is still in Release Candidate and not final, this is something we may have to deal with from time to time.

But when the "uninstall" button in the ui fails, then you may end up stuck. In that case, you'll be happy to find:

C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\installcleanup.exe

Which will perform the same actions as the good old "vssetup /uninstall /force". If that doesn't get you unstuck, there is an even more forceful way:

Delete everything under:
  • C:\ProgramData\Microsoft\VisualStudio\15.0
  • C:\ProgramData\Microsoft\VisualStudio\Packages
  • %appdata%\Microsoft\VisualStudio\15.0*
  • %appdata%\Microsoft\VisualStudio\Packages
  • C:\Program Files (x86)\Microsoft Visual Studio\2017
  • HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0*
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\15.0*

Add :8080 to your TFS 2017 bindings after upgrading to SSL

$
0
0
Because TFS 2017 allows authentication with Personal Access Tokens (PAT) it's recommended to upgrade to SSL if you were still on port 80. The installer will even help with the configuration and can add a redirect  from port :80 to :443.

It doesn't add a a redirect from post :8080 though, so your users may have to update all their bookmarks. Or you can add that second binding in IIS yourself:


And that will help your users find the new location more easily.

Global DevOps BootCamp 2017

$
0
0
Yesterday we had a blast. It's the only way to describe it. What started with a small idea over beer in Seattle by a few genius minds, ended up catering to 1500 participants workwide learning about Continuous Integration, Delivery and the promise of Containers and Serverless to make it easier to run your applications anywhere. The Global DevOps Bootcamp 2017!

With Donovan Brown keynoting, Marcel de Vries expanding and a great team consisting of Rene van Osnabrugge, Jasper Gilhuis, Alex de Groot and myself in Hilversum as well as many, many more MVP's and community leaders world-wide we started off with just enough information to make everyone excited and then we handed off the event to the  people who showed up in large numbers. They spent their whole free afternoon, in a weekend, playing with the latest Microsoft technology has to offer.

Some things people noted in our session:

  • It's amazing how fast you can get this stuff done with the right people and the right guidance. 
  • What we did in a couple of hours here would take months at work.
  • Visual Studio Team Services is actually a really nice product, we should use it more often!
  • You get better collaboration and gather better insights by closing the laptops and actually talking to people.
  • We use all of the open-source tools to do Continuous Delivery, Visual Studio Team Services nicely combines them all into a single product. 
Thanks everyone for organizing, attending and sharing.


Make a Group Team Administrator in VSTS/TFS

$
0
0
In case your organisation is depending on an Identity and Access Management tool to assign rights to the tools in the toolchain, then it's likely that all of your permissions are handled through Group assignments and not to individuals.

Visual Studio Team Services and Team Foundation Server allow rights assignments to groups in almost every possible location and assigning those rights is doable through the TFSSecurity utility. Almost every location... It turns out that assigning a group to be a Team Administrator was not (is not in TFS) possible through the UI.

In the past, I've contributed to the TFS Team Tools from the ALM Rangers. That project had since been deprecated, though it still has a few unique features. I've decided to resurrect it and you can now find it on my GitHub account. While I was at it, I incorporated the functionality to list, add and remove Team Administrators. It supports adding individuals as well as groups.



You can now download a version of the TFS Team Tools from the GitHub.

C:\Tools\TfsTeamTools>tfsteams addteamadministrator /team:"Demo Team"
/collection:https://jessehouwing.visualstudio.com /teamproject:demo /user:"[Demo]\Portfolio Team"

C:\Tools\TfsTeamTools>tfsteams listteamadministrators /team:"Demo Team"
/collection:https://jessehouwing.visualstudio.com /teamproject:demo
[demo]\Portfolio team
Jesse Houwing

TFS 2018 update 1 is available. So is the TFS Aggregator

$
0
0
Biran Harry just announced the Release to Web of Team Foundation Server 2018 update 1. With mostly bug fixes and a few very small functional features. Luckily it shipped with no breaking changes in the server object model, so we were able to quickly ship a compatible version of the TFS Aggregator.

We had updated our solution structure and build process to make it easier to support multiple TFS versions. The TFS Aggregator solution now supports the following TFS versions:

  • Team Foundation Server 2013 update 5
  • Team Foundation Server 2015 
  • Team Foundation Server 2015 update 1
  • Team Foundation Server 2015 update 2
  • Team Foundation Server 2015 update 3
  • Team Foundation Server 2017 and update 1
  • Team Foundation Server 2017 update 2 and update 3
  • Team Foundation Server 2018 and update 1

All from a single solution. To support this we've upgraded to Visual Studio 2017 15.5. Its support for packageReferences in the project files allows us to dynamically switch between Nuget packages and to switch between different versions of the same NuGet packages. This greatly simplifies building a single codebase against a large number of dependent package versions.

You can find Beta 4 of the TFS Aggregator on the GitHub releases page.

Clean up your Team Project Collection prior to migrating to VSTS

$
0
0
To prepare your TFS Project Collection for migration, you may want to remove (stale) old data to reduce the database size first/
Most actions are already documented here. Queries that can aid in detecting where your space is allocated are also found in this recent support ticket.

Delete old workspaces

Deleting workspaces and shelvesets can reduce your migration and upgrade times considerably. either use the tf commandline or leverage a tool like the TFS SideKicks to identify and delete these.

Build results

Not just build results, but often overlooked the actual build records can take up a considerable amount of data. Use tfsbuild destroy (XAML) to permanently delete the build records. In the past, I've encountered clients who had 1.8 million "hidden" builds in their database and removing them shaved off quite a considerable amount of data. These records were kept around for the warehouse.

Old team projects

Of course, destroying old team projects can give back a lot of data. Anything you don't need to send to azure helps. You could also consider splitting the collection and to leave behind the old projects. That will give you the option to detach that collection and store it somewhere, should you ever need that data again.

Redundant files

Deleted branches are a very common hidden size hog. When deleting things in TFVC, they are not actually deleted, they're just hidden. Finding deleted files and especially old development or feature branches can give you back a lot of data. Use tf destroy to get rid of them.
You may also want to look for checked in nuget package folders, those can quickly rack up a lot of space as well.

Test Attachments

Ohh yes, especially when you use test attachments, these can grow like crazy, depending on your TFS version either use the built-in test attachment cleanup features or use the Test Attachment Cleaner from the TFS power tools.

XAML Builds

The build definitions themselves won't take a lot of database space, but the build results may. But those have been covered in a previous section.
In the past, I've had to patch tfbuid.exe to handle (very) large amounts of build records, as it tends to try and fetch all build data locally before proceeding with the delete action. You may need to rely on the TFS Client Object Model to achieve a similar result.

Git Repositories

You may have data in your git repositories that are no longer accessible due to force pushes or deleted branches. It's also possible that certain data in Git could be packed more efficiently. To clean your repositories you have to clone them locally, clean them up, delete the remote repo from TFS and push the cleaned copy to a new repository (you can use the same name as the old one). Doing this will break references with existing build definitions and you will have to fix these up. While you're at it, you could also run the BFG repo Cleaner and convert the repositories to enable Git-LFS support to handle large binary files in your repositories more elegantly.
git clone --mirror <>
# optionally run BFG repo cleaner at thi s point
git reflog expire --expire=now --all
git gc --prune=now --aggressive
git repack -adf
# Delete and recreate the remote repository with the same name
git push origin --all
git push origin --tags

Work item (attachments)

Work items can gather up a considerable amount of data, especially when people start attaching large attachments to them. You can use witadmin destroywi to delete work items with unreasonably large attachments. To retain the work item, but delete its attachments you can delete the attachments from the current work item and then clone it. After cloning, destroy the old work item to allow the attachments to be cleaned up.
Old work items that you no longer need (say the sprint items from 6 years ago) can also be deleted. My colleague René has a nice tool that allows you to bulk-destroy by first creating the appropriate work item query.

Be sure to run the cleanup jobs

TFS often doesn't directly prune data from the database, in many cases, it just marks stuff as deleted for latest processing. To force the cleanup to happen immediately, run the following stored procedures on your Project Collection database:
EXEC prc_CleanupDeletedFileContent 1
# You may have to run the following command multiple times, the last
# parameter is the batch size, if there are more items to prune than the
# passed in number, you will have to run it multiple times
EXEC prc_DeleteUnusedFiles 1, 0, 100000

Other useful queries

To identify how much data is stored in each section, there are a few useful queries you can run. The actual query depends on your TFS version, but since you're preparing for migration I suspect you're on TFS 2017 or 2018 at the moment.

Find the largest tables:
SELECT TOP 10 o.name, 
SUM(reserved_page_count) * 8.0 / 1024 SizeInMB,
SUM(CASE
WHEN p.index_id <= 1 THEN p.row_count
ELSE 0
END) Row_Count
FROM sys.dm_db_partition_stats p
JOIN sys.objects o
ON p.object_id = o.object_id
GROUP BY o.name
ORDER BY SUM(reserved_page_count) DESC
Find the largest content contributors:
SELECT Owner = 
CASE
WHEN OwnerId = 0 THEN 'Generic'
WHEN OwnerId = 1 THEN 'VersionControl'
WHEN OwnerId = 2 THEN 'WorkItemTracking'
WHEN OwnerId = 3 THEN 'TeamBuild'
WHEN OwnerId = 4 THEN 'TeamTest'
WHEN OwnerId = 5 THEN 'Servicing'
WHEN OwnerId = 6 THEN 'UnitTest'
WHEN OwnerId = 7 THEN 'WebAccess'
WHEN OwnerId = 8 THEN 'ProcessTemplate'
WHEN OwnerId = 9 THEN 'StrongBox'
WHEN OwnerId = 10 THEN 'FileContainer'
WHEN OwnerId = 11 THEN 'CodeSense'
WHEN OwnerId = 12 THEN 'Profile'
WHEN OwnerId = 13 THEN 'Aad'
WHEN OwnerId = 14 THEN 'Gallery'
WHEN OwnerId = 15 THEN 'BlobStore'
WHEN OwnerId = 255 THEN 'PendingDeletion'
END,
SUM(CompressedLength) / 1024.0 / 1024.0 AS BlobSizeInMB
FROM tbl_FileReference AS r
JOIN tbl_FileMetadata AS m
ON r.ResourceId = m.ResourceId
AND r.PartitionId = m.PartitionId
WHERE r.PartitionId = 1
GROUP BY OwnerId
ORDER BY 2 DESC
If file containers are the issue:
SELECT CASE WHEN Container = 'vstfs:///Buil' THEN 'Build'
WHEN Container = 'vstfs:///Git/' THEN 'Git'
WHEN Container = 'vstfs:///Dist' THEN 'DistributedTask'
ELSE Container
END AS FileContainerOwner,
SUM(fm.CompressedLength) / 1024.0 / 1024.0 AS TotalSizeInMB
FROM (SELECT DISTINCT LEFT(c.ArtifactUri, 13) AS Container,
fr.ResourceId,
ci.PartitionId
FROM tbl_Container c
INNER JOIN tbl_ContainerItem ci
ON c.ContainerId = ci.ContainerId
AND c.PartitionId = ci.PartitionId
INNER JOIN tbl_FileReference fr
ON ci.fileId = fr.fileId
AND ci.DataspaceId = fr.DataspaceId
AND ci.PartitionId = fr.PartitionId) c
INNER JOIN tbl_FileMetadata fm
ON fm.ResourceId = c.ResourceId
AND fm.PartitionId = c.PartitionId
GROUP BY c.Container
ORDER BY TotalSizeInMB DESC

Original

New versions of TFS/VSTS build tasks

$
0
0
I just pushed out new versions of the following tasks:


  • MsBuild Helper Task
    • Fixed a number of bugs when the Agent's work folder has a space in it somewhere.
  • Snyk
    • Fixed auto-update of built-in Snyk version
    • Added support for Path parameter to scan NuGet packages among other package types.
    • Added support for Severity Threshold parameter.
    • Updated built-in Snyk version to 1.70.2
  • Variable toolbox
    • Fixed PadLeft and PadRight
    • Fixed Regex search & replace
    • Upgraded to PowerShell3 handler to improve task performance
In the meantime I've been working on a number of other build-task related things, more to come soon:
  • TFVC Tasks
    • Upgrading to PowerShell3 hander
    • Using tf.exe instead of custom Client Object Model code
    • Consolidate separate tasks into a single task (like nuget task)
  • CI/CD tasks for Extensions
    • ServerGate support continue after validation has succeeded
    • Automatic versioning of extensions containing multiple build tasks
    • Moving tfx installation to a separate Tool Installer task
If you like my extensions, please leave a review or a donation. If you'd like to see a feature I haven't built, file an issue or, better yet, send me a pull request.

Fixing Edge, Start Menu and Cortana slowness

$
0
0
I've had issues with my machine for months now and it was very hard to pinpoint the culprit. It resulted in:

  • Start menu freezing
  • Cortana/explorer bar search staying black for up to 30 seconds
  • Edge not wanting to open or regularly freezing
I had tried all the tricks out there, none worked:
  • DISM /Online /Cleanup-Image /CheckHealth
  • DISM /Online /Cleanup-Image /ScanHealth
  • DISM /Online /Cleanup-Image /RestoreHealth
  • sfc /scannow
  • Windows 10 app troubleshooter
  • Windows 10 search & indexing troubleshooter
  • Windows 10 windows update troubleshooter
  • Reset Edge from the Apps & Features in Settings 
  • Delete edge data in the user profile folder (%userprofile%\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe)
  • Reinstall Intel and Nvidia graphics drivers
  • Install Nvidia driver without the nView extensions
  • Uninstall 3rd party virus scanner.
  • Reinstall all store apps: Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
Technically the issue appeared in a few ways:
  • After starting edge the following processes would cause high-CPU and edge would crash:
    • browser_broker
    • runtime_broker
  • After opening the start menu or Cortana the following process would cause high-CPU and would freeze the start menu or Cortana for up to 30 seconds:
    • dllhost.exe
    • com surrogate
  • The event viewer would list a number of DCOM errors:
    • The server {0002DF02-0000-0000-C000-000000000046} did not register with DCOM within the required timeout.
    • The server {2593F8B9-4EAF-457C-B68A-50F6B8EA6B54} did not register with DCOM within the required timeout.
    • The server {973D20D7-562D-44B9-B70B-5A0F49CCDF3F} did not register with DCOM within the required timeout.
One of the tips to remove this problem was to uninstall the Intel and Nvidia graphics drivers and have Windows reinstall them. This didn't help either but did expose me to the culprit. After reinstalling the video drivers my machine was unable to start causing a blue screen on the following driver: vdd2hookkmode.sys. To solve the blue screen issue I had to delete the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VDD2HookKmode

This driver ships with the Barco ClickShare Extension Pack, a set of drivers I use to share my screen to Barco's otherwise wonderful screen sharing devices we use in our training rooms. These drivers aren't updated through Windows Update or come with an update notification of any sort and removing them solves all my issues.

Their latest driver supposedly fixes some of these issues as well. But for me Edge becomes unusable the moment I install the latest version. For now I'll have to do without presenter view when using ClickShare together with PowerPoint.

Disambiguate MSA and AAD accounts

$
0
0
Microsoft is finally closing the loophole that allowed you to create an MSA account (LiveId) with the same unique name as your AAD (Azure Active Directory) account. While it has been very useful in many cases to use the same ID for both the MSA and the AAD account, most services that relied on only MSA are finally shipping updates to also support AAD.

I've always had my MSA and AAD account share the same identity ever since I created my Microsoft Account almost 15 years ago. And every since Microsoft introduced Azure Active Directory I've had to choose between a "work and school account" or a "personal account". It helps that I have a pretty good understanding of the difference, so for me it never really posed more than a minor inconvenience, but I see a lot of clients confused and frustrated by the, in their eyes, useless question:


Because of it's age a lot of profiles were associated to it, and changing the sign-in address of my MSA felt a bit scary. Just to give you an idea of the services linked to my MSA (jhouwing@xpirit.com):

  • Microsoft Certification Portal
  • Microsoft Most Valuable Professional Portal
  • Microsoft Partner Portal and Partner link to Xpirit
  • Microsoft Visual Studio Marketplace Publisher account
  • XBox Live account
  • Windows Phone Marketplace
  • Windows Developer Account
  • MSDN subscription (from MVP)
  • Azure Subscription (multiple)
  • Visual Studio Team Services (multiple)
  • Visual Studio Enterprise license in Visual Studio 2017 (through MSDN)
  • Azure AD Guest user in a number of partner directories
  • Windows Store
  • Groove Music
  • Family Office 365 subscription
  • OneDrive
  • Windows Insider
  • Skype
  • My personal laptop
  • My work laptop
  • My personal Xbox
At the same time a number of things were associated to my AAD account sharing the same identity (jhouwing@xpirit.com):
  • Microsoft Visual Studio Marketplace Publisher account
  • MSDN Subscription (from work)
  • Azure Subscription
  • Visual Studio Team Services (access to Microsoft owned accounts)
  • Azure AD Guest in the Microsoft directory
  • Work Office 365 subscription
  • Ondrive for Business
  • Skype for Business
  • Windows Insider
  • My work laptop
I'd switched identities on my Microsoft account before, when I left my previous employer and joined Xpirit, so I was accustomed to the process of re-associating in the Microsoft Partner Portal and switching the primary identity in my MSA account, but I'd always hit a few problems and over the years the number of additional devices and services has steadily grown.

To start the disambigiation process I first added a new secondary identity to my MSA account (jesse.houwing@gmail.com). This option is pretty hard to find if you don't' know what you're looking for. You can find it in the Microsoft Account portal:
Click the "Manage your sign-in email or phone number" link and there you can add additional sign-in addresses to your account. In my case I added a secondary sign-in address for my gmail account:
After confirming you own this address through your chosen method of security, you can now sign in to most services using either address. A few won't work through, as I found out:
  • Visual Studio Team Services won't allow to sign in with a secondary identity. It will however automatically swap you to your new identity once you make it primary. Account ownership will also be updated automatically nowadays. That was a great relief.

Form there I clicked the "Make Primary" link on my new primary identity and after that I checked whether I could still access all my accounts. Switching my primary identity had a few unexpected side-effects:
  • I had to update my MSA account information on my windows devices.
  • I had to sign into my Xbox again
  • I had to restore my Windows Insider details
  • I had to uninstall the Windows Feedback app and install it again (should be fixed in a later version)
  • I had to sign out fo Visual Studio completely and sign in again so refresh my license and to connect to Visual Studio Team Services.

After confirming I could still access all my services I crossed my fingers and went on to remove my old primary identity.

After clearing all cookies in my browsers I am now no longer greeted by disambigution prompts, which makes me very happy. I'd still love it if Microsoft would make this process simpler and if they'd be able to remove the issues I encountered, but the process was a lot easier than I had been dreading.

Ohh and while you're at it, you may as well update your security preferences, enable 2-factor authentication and set a stronger password ;).

If you're wondering whether a company could solve this problem for their users, the answer is no. There is no way for an organisation to query which users have the same ID for their AAD and their MSA account and there is no way for a company to change the primary identity on behalf of their employees. The MSA account is owned by the individual and privacy and legal reasons prevent Microsoft from solvign this on behalf of a company.

Crafting complex Release Gate conditions in VSTS

$
0
0
A recent addition to VSTS is the ability to run a quick check prior to triggering a release to an environment. These checks can be used to check that there are no new customer complaints, no mad users on twitter, no important jobs running in the environment etc.

I wanted to make use of this feature as part of the CI/CD Tasks for Extensions. With the recent introduction of validation of the extension, it's possible that your newly uploaded extension isn't immediately available. So before kicking off tests for your extension, you may want to wait for the validation to succeed.


To check the status of an extension, one can call the Marketplace REST API. It will return a list of versions of the extension and their validation status:

GET https://marketplace.visualstudio.com/_apis/gallery/publishers/jessehouwing/extensions/vsts-snyk?flags=1
Response Code: OK
Response:
{
"publisher":{
"publisherId":"c68591c6-8fbd-413b-b7fb-b921737f4f9f",
"publisherName":"jessehouwing",
"displayName":"Jesse Houwing",
"flags":"verified"
},
"extensionId":"252ad2b4-a2c5-43fc-bba5-17e631896091",
"extensionName":"vsts-snyk",
"displayName":"Snyk Task",
"flags":"validated, public",
"versions":[
{"version":"1.1.12","flags":"validated","lastUpdated":"2018-03-16T18:58:53.133Z"},
{"version":"1.1.11","flags":"validated","lastUpdated":"2018-02-18T13:53:47.83Z"},
{"version":"1.1.9","flags":"validated","lastUpdated":"2017-03-14T09:40:40.75Z"}
],
"deploymentType":0
}

To ensure the latest version is valid, you can use jsonpath to retrieve this information from the reply:

eq(count(jsonpath('$.versions[?(@.version==''1.1.12''&& @.flags==''validated'')]')), 1)

To configure the call and the expression, you need to go into your release pipeline and enable Gates on the environment. Then add an Invoke REST API  gate and configure it:



If the API call requires authentication, you can supply these through a basic credential.

Once you've configured your gate you can test it by triggering a release. It took me a while to get the expression right and after triggering 8 releases I'd reached a critical frustration level. Before using the Invoke REST API release gate I had been testing my expressions through publishing an extension and that ook even longer. I decided to build a small tool to quickly test the release conditions locally, without having to queue a build.


As you can see, the expression tester allows you to test an expression and provides direct feedback. I've added support for simple Build and Release variables as well, they're automatically detected when you type the expression.

With this little tool, your time to create and validate complex expressions will drop from multiple minutes per iteration to multiple iterations per minute. The expression parser used by the server tries to do a couple of clever things and short-circuits the validation of expressions. This caused me to detect issues in the second jsonpath only after triggering the second condition ($(extensionVersion) = 'latest').

Once you have a working Release Gate, it's easy to take the configuration and turn it into a reusable Task that can be published as part of an extension:

{
"id": "231decda-22cb-4e83-b2f4-31fc86a0de1f",
"name": "Check Marketplace validation status.",
"category": "Deploy",
"runsOn": [
"Server",
"ServerGate"
],
"inputs": [
{
"name": "connectedServiceName",
"type": "connectedService:VstsMarketplacePublishing",
"label": "VSTS Marketplace connection",
"required": true,
},
{
"name": "publisherId",
"type": "string",
"label": "Publisher ID",
},
{
"name": "extensionId",
"type": "string",
"label": "Extension ID",
},
{
"name": "extensionVersion",
"type": "string",
"label": "Extension Version",
}
],
"execution": {
"HttpRequest": {
"Execute": {
"EndpointId": "$(connectedServiceName)",
"EndpointUrl": "$(endpoint.url)_apis/gallery/publishers/$(publisherId)/extensions/$(extensionId)?flags=1",
"Method": "GET",
"Body": "",
"Headers": "{\"Content-Type\":\"application/json\"}",
"Expression": "or(eq(count(jsonpath('$.versions[?(@.version==''$(extensionVersion)''&& @.flags==''validated'')]')), 1), and(eq('$(extensionVersion)', 'latest'), jsonpath('$.versions[0][?(@.flags == ''validated'')]')))"
}
}
}
}

After publishing this task as an extension it shows up in the Release Gate section (I haven't created a new icon yet):


The tool I created to test the expression is available as a download on GitHub. The tool requires a local installation of Team Foundation Server 2018 Update 2 RC (due to the fact that I can't distribute the server binaries).

To help discover how to build and the release gates, I used the following examples:

Publish your extension to a local TFS Update 2 server

$
0
0

With the availability of extensions for TFS I've been looking for an easy way to publish extensions and their updates to the local marketplace. While I'm sure that Microsoft will at some point integrate the two, for now you need to manually sync the extensions between the VSTS Marketplace and your local TFS Marketplace.

Turns out that the tools used to publish to the VSTS Marketplace work for the TFS one as well. to publish an extension you do need to pass in the service url manually and this took a little bit of fiddling to figure out what to put in there. Turns out that it takes the server root,


C:\t>tfx extension publish --root . --manifest-globs vss-extension.json 
    --service-url http://jessehouwing:8080/tfs --proxy http://localhost:8888
Checking if this extension is already published
It isn't, create a new extension.
Waiting for server to validate extension package...
=== Completed operation: publish extension ===
 - Packaging: C:\t\jessehouwing.jessehouwing-vsts-variable-tasks-0.0.0.vsix
 - Publishing: success
 - Sharing: not shared (use --share-with to share)


If your server isn't configured with Basic Authentication enabled, you can use the Fiddler hack to authenticate over NTLM. As you can see by the --proxy option int he command above, that's what I'm doing at the moment.

It should be relatively easy to build a PowerShell script that uses the --json option to list all extensions on the local TFS Marketplace and then check the online marketplace for a newer version to automatically sync extensions which have already been installed. Stick that in a Build Definition on a Schedule and your local marketplace will always be up to date with the latest versions. That's something for a future blogpost.

Publish your VSTS extension using Team Build and Release Management

$
0
0

While I've released my VSTS Extension Tasks to GitHub and the Visual Studio Marketplace some time ago, I was reminded that I've never really blogged about it yet. You may wonder what it does.

The VSTS Extension Tasks are a set of tasks for Team Build and Release Management to package, publish, share and install extensions to your Visual Studio Team Services account or TFS 2015 update 2 server.

There are quite a few people using the extension to package and publish their Visual Studio Team Services and TFS extensions.

There's a few places with more information on how to use them:

I'm using these tasks to package and publish my other build tasks:

A few other MVPs/Rangers that are using these tasks include Richard Fennel, Rene van Osnabrugge, Peter Groenewegen and Utkarsh Shigihalli and others.

A quick peek into Team Foundation Server 15 Preview

$
0
0

Gian Maria Ricci already covered a nice overview of what's new in the install experience of TFS 15 in the latest Preview Release. Let's walk through the new features in the product... though I suspect that many of you won't see a lot of surprising things, given that many of the features have been released to Visual Studio Team Services in the past months.

A quick scan through all the tabs and pages of Web Access reveals a cool number of new features, though maybe not yet as many as you had expected. Just remember that the time between releases has steadily gone down from 3 to 2 and now only 1 years. The differences are no longer earth shattering, but still very welcome!

Configuration

Build Agent

At the server level you'll see the that TFS15 will ship with a new Build Agent. The new build agent is built using .NET Core which makes it compatible with Windows, Mac and Linux. This will bring it on par with the Visual Studio Team Services agent again.

The new agent supports NTLM authentication for the other platforms as well, removing any need for configuring the TFS server with Basic Auth. (yay!)

I'd expected to see an option to manage or configure search, but this is currently done from the TFS Management Console. At the moment there isn't much to manage after configuring it in the installer:

Enable the new work item experience

After installation you'll have the option to enable the new work item form for your existing Team project.

Clicking the Enable option will prompt you your current Work item Forms will be layed out according to the new layout.

After updating all the work item forms you can go in to optimize the layout. You'll then be prompted to configure the opt-in options. The first step is to enable the opt-in option for project admins, who can then optimize the layout before they cascade the option to all their users.

Once projects have been updated with the new layout, you can switch to the "new form only" mode.

After enabling the new work item form the old (windows forms based) forms in Visual Studio and Excel will drop you into the Web part of Visual Studio to edit work items.

Alerts Admin

Another great new addition is the ability to see and manage alerts for other users. I can't tell you how often I've been asked to "turn off those bloody email messages" by users after they had (sometimes long ago) configured alerts and had no idea where all the email started coming from after another 8 users joined the project.

By entering the username of another user you get an overview of all the alerts configured for them and if you have the proper permissions you can even edit and delete them. Nice!

Build retention

It looks like that with the new Agent and a bit of time the issue that file share drops were never cleaned up have been resolved. You can now configure retention for files dropped to file shares as part of the "Copy and publish build artefacts" tasks in Build:

Agile tools

I'd already mentioned the new work item form, while some people love it, others still are having a difficult time to come to terms with it. I like it very much. Unfortunately the new Process management features where you can add/remove fields from the UI hasn't made it to TFS yet. Let's hope the team manages to port that in the months leading up to the final release.

Test and Tasks on the PBI

For teams doing Kanban and for Product owners who spend most of their time at the Backlog level (instead of the Sprint level) there is now an option to track the tasks and tests for each Product Backlog Item. So even if all the tasks are done, you can see that maybe not all tests are passing.

New Branch & Do Explore

You can now create a new Git branch when you or your team starts working on a new Product Backlog Item, promoting feature branches and making it easier to implement common process flows like GitFlow.

Another option enabled from the same context menu is the option to start exploratory testing right from the task board. which is a great feature for teams that do want to have end-to-end traceability of their tests to their Product backlog Items, but do not use the Test Case Management options of TFS, possibly because they to ATDD using a tool like SpecFlow to handle their test cases for formal tests. For informal tests they can now launch directly from the backlog.

Both options are also available from the backlogs and boards:

Build & Release

I've already mentioned the new Build agent and the new build retention. Another great addition is that of Subversion and External Git. I'm guessing (from the fact that the Service Connection dialog exists) that GitHub will be supported too, but for now it doesn't show up on my instance.

GitHub does already appear as a artifact source for Release management, though I can't get it to work at the moment:

Code Search

Another great new feature, which has been available as an extension for VS Team Services for a few months now is Code Search. While it does bring a few interesting twists to TFS at the admin level (it requires Java to be installed and kept up-to-date by the server administrator), it makes it much easier to find pieces of code anywhere in TFS.

I can't tell you how often I dig through GitHub trying to find examples or similar pieces of code from the pieces I'm working on when venturing into little documented area's of existing products, like the new Build Engine piece of TFS and Visual Studio Code.

This will now also come to on-premise TFS servers, allowing much easier code re-use and discovery throughout the enterprise:

Concluding

I'm really looking forward to the new version of Team Foundation Server. The new installer features to make it easier to do trial upgrades are very welcome, and I believe that with Code Search, new Build Agent and the fresh Work Item look & feel it provides a nice upgrade to existing users as well.

Dig deeper into the news features over on the Release Notes page.

Solve basic auth proxy issues with Nuget, Visual Studio and Xamarin (hack)

$
0
0

When you're using Visual Studio behind a Basic Authenticaton proxy, you may run into issues restoring Nuget packages. While I've never found a real solution for the issue, and trust me I've tried quite a few workarounds like the ones listed here.

You'll get the following error:


[5:06] Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and put it to the C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.3.0.0 directory.
[5:06]  
Reason: The remote server returned an error: (407) Proxy Authentication Required.

I've come to rely on my trusted hacking friend Fiddler and turn on "Automatically Authenticate".

Optionally configure your upstream proxy in Fiddler:

Restart Visual Studio so it picks up Fiddler as the proxy and you're good to go. Just leave Fiddler running in the background and all will be well.


Force uninstall Visual Studio 2017 Release candidates

$
0
0

If you, like me, are stuck trying to upgrade Visual Studio 2017, then you may only get unblocked by removing everything and starting afresh. Since Visual Studio 2017 is still in Release Candidate and not final, this is something we may have to deal with from time to time.

But when the "uninstall" button in the ui fails, you may end up stuck. In that case, you'll be happy to find:


C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\installcleanup.exe

Which will perform the same actions as the good old "vssetup.exe /uninstall /force". If that doesn't get you unstuck, there is an even more forceful way:

Delete everything under:

  • C:\ProgramData\Microsoft\VisualStudio\15.0
  • C:\ProgramData\Microsoft\VisualStudio\Packages
  • %appdata%\Microsoft\VisualStudio\15.0*
  • %appdata%\Microsoft\VisualStudio\Packages
  • C:\Program Files (x86)\Microsoft Visual Studio\2017
  • HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0*
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\15.0*

Add :8080 to your TFS 2017 bindings after upgrading to SSL

$
0
0

Because TFS 2017 allows authentication with Personal Access Tokens (PAT) it's recommended to upgrade to SSL if you were still on port 80. The installer will even help with the configuration and can add a redirect from port :80 to :443.

It doesn't add a a redirect from port :8080 though, so your users may have to update all their bookmarks. Or you can add that second binding in IIS yourself:

And that will help your users find the new location more easily.

Global DevOps BootCamp 2017

$
0
0

Yesterday we had a blast. It's the only way to describe it. What started with a small idea over beer in Seattle by a few genius minds, ended up catering to 1500 participants workwide learning about Continuous Integration, Delivery and the promise of Containers and Serverless to make it easier to run your applications anywhere. The Global DevOps Bootcamp 2017!

With Donovan Brown keynoting, Marcel de Vries expanding and a great team consisting of Rene van Osnabrugge, Jasper Gilhuis, Alex de Groot and myself in Hilversum as well as many, many more MVP's and community leaders world-wide we started off with just enough information to make everyone excited and then we handed off the event to the  people who showed up in large numbers. They spent their whole free afternoon, in a weekend, playing with the latest Microsoft technology has to offer.

Some things people noted in our session:

  • It's amazing how fast you can get this stuff done with the right people and the right guidance.
  • What we did in a couple of hours here would take months at work.
  • Visual Studio Team Services is actually a really nice product, we should use it more often!
  • You get better collaboration and gather better insights by closing the laptops and actually talking to people.
  • We use all of the open-source tools to do Continuous Delivery, Visual Studio Team Services nicely combines them all into a single product.

Thanks everyone for organizing, attending and sharing.

You can read all the tweets on the social wall.

Make a Group Team Administrator in VSTS/TFS

$
0
0

In case your organisation is depending on an Identity and Access Management tool to assign rights to the tools in the toolchain, then it's likely that all of your permissions are handled through Group assignments and not to individuals.

Visual Studio Team Services and Team Foundation Server allow rights assignments to groups in almost every possible location and assigning those rights is doable through the TFSSecurity utility. Almost every location... It turns out that assigning a group to be a Team Administrator was not (is not in TFS) possible through the UI.

In the past, I've contributed to the TFS Team Tools from the ALM Rangers. That project had since been deprecated, though it still has a few unique features. I've decided to resurrect it and you can now find it on my GitHub account. While I was at it, I incorporated the functionality to list, add and remove Team Administrators. It supports adding individuals as well as groups.

You can now download a version of the TFS Team Tools from the GitHub.


C:\Tools\TfsTeamTools>tfsteams addteamadministrator /team:"Demo Team" 
    /collection:https://jessehouwing.visualstudio.com /teamproject:demo /user:"[Demo]\Portfolio Team"
C:\Tools\TfsTeamTools>tfsteams listteamadministrators /team:"Demo Team" 
    /collection:https://jessehouwing.visualstudio.com /teamproject:demo
[demo]\Portfolio team
Jesse Houwing

What other features are you looking for when setting up new Team Projects in TFS or VSTS? Any repetitive tasks you'd like to automate? Please leave your comments below or file an issue on github.

TFS 2018 update 1 is available. So is the TFS Aggregator

$
0
0

Biran Harry just announced the Release to Web of Team Foundation Server 2018 update 1. With mostly bug fixes and a few very small functional features. Luckily it shipped with no breaking changes in the server object model, so we were able to quickly ship a compatible version of the TFS Aggregator.

We had updated our solution structure and build process to make it easier to support multiple TFS versions. The TFS Aggregator solution now supports the following TFS versions:

  • Team Foundation Server 2013 update 5
  • Team Foundation Server 2015
  • Team Foundation Server 2015 update 1
  • Team Foundation Server 2015 update 2
  • Team Foundation Server 2015 update 3
  • Team Foundation Server 2017 and update 1
  • Team Foundation Server 2017 update 2 and update 3
  • Team Foundation Server 2018 and update 1

All from a single solution. To support this we've upgraded to Visual Studio 2017 15.5. Its support for packageReferences in the project files allows us to dynamically switch between Nuget packages and to switch between different versions of the same NuGet packages. This greatly simplifies building a single codebase against a large number of dependent package versions.

You can find Beta 4 of the TFS Aggregator on the GitHub releases page.

Viewing all 216 articles
Browse latest View live