azure-devops-dotnet-samples icon indicating copy to clipboard operation
azure-devops-dotnet-samples copied to clipboard

VSTS organization URL helper samples

Open willsmythe opened this issue 7 years ago • 1 comments

Samples showing how to properly construct a URL to a VSTS organization (formerly called "account") using either its name (e.g. "Fabrikam") or its GUID identifier.

Example of how to use the new helper:

public async Task DoSomething()
{
    Uri orgUrl = OrganizationUrlHelpers
        .GetConnectionUrl("myOrgName");  // typically resolves to https://myorgname.visualstudio.com

    VssConnection orgConnection = new VssConnection(orgUrl, credentials);

    BuildHttpClient buildClient = orgConnection.GetClient<BuildHttpClient>();
}

willsmythe avatar Aug 27 '18 21:08 willsmythe

If you have a moment to retarget this at main, I'd still merge it.

vtbassmatt avatar Jun 22 '20 17:06 vtbassmatt