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

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