CryptographicException while adding TFS connection to ReleaseManagement Update-4 client

One of our customer reported below error :- Issue:- While adding a TFS connection, user were getting CryptographicException Message: Bad Data.: \r\n\r\n   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)   at System.Security.Cryptography.RSACryptoServiceProvider.DecryptKey(SafeKeyHandle pKeyContext, Byte[] pbEncryptedKey, Int32 cbEncryptedKey, Boolean fOAEP, ObjectHandleOnStack ohRetDecryptedKey)   at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP)   at Microsoft.TeamFoundation.Release.Data.Helpers.CryptoHelper.GetDecryptedValue(String str, String containerName)   at Microsoft.TeamFoundation.Release.Data.Helpers.CryptoHelper.DecryptString(String str, String cryptoContainerName, String key, Encryption encryption)  …

0

Writing a ReleaseManagement extension for cloning an existing release definition

Code shared :- https://github.com/openalm/vsts-rm-extensions/tree/master/rd-export-import-clone-TFS2015U2 How to make Changes:- Step1: Clone the repository using the link https://github.com/openalm/vsts-rm-extensions.git Step2: Open a command prompt and go till folder ‘rd-export-import-clone-TFS2015U2’ Step3: Run ‘bower install’ [ pre-requsite for running ‘bower’ can be referred https://github.com/Microsoft/vsts-extension-samples] which will download 1.95.2 version of VSS.SDK.js Step4: Make your changes Step5:  Run ‘tfx extension create’…

0

Using ReleaseHttpClient for interacting with ReleaseManagement service

ReleaseHttpClient is public as nuget package : https://www.nuget.org/packages/Microsoft.VisualStudio.Services.Release.Client GitHub samples: https://github.com/chandan-anjani/VSTSRMAPISample Fetching release definitions using given credential :- Step1: Create one ‘Windows Console Application’ using Visual studio 2015 Step2: Goto Tools –>NuGet Package Manager –> Manage NuGet Packages for Solutions –> Browse (make sure Package source: nuget.org) Step3: Search and Install following package to your solution  Microsoft.VisualStudio.Services.Release.Client…

0

Using PAT token in ReleaseManagement REST API’s

Generating PAT Token:- Step1: Generate PAT token by visiting your profile and selecting the right ReleaseManagement scope as per API need ( see ‘Available scopes’ section https://www.visualstudio.com/en-us/integrate/extensions/develop/manifest ) Step2: Copy the token generated after clicking ‘Create Token’ as shown in image above   Code which uses the generated PAT token above :- public static async…

0

Using ReleaseManagement REST API’s

 Refer the documentation https://www.visualstudio.com/integrate/api/rm/overview (below samples uses alternate credential for authentication [https://www.visualstudio.com/en-us/integrate/get-started/auth/overview]) 1. How to get ReleaseDefinition using ReleaseManagement REST API’s public static async void GetReleaseDefinitions() { try { var username = “<alternate credential username>”; var password = “<password>”; using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Add( new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue(“application/json”)); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(“Basic”, Convert.ToBase64String( System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format(“{0}:{1}”, username, password)))); using…

0