Can you please provide a sample for CreateAnnotatedTagAsync method?
I keep getting "VS30063: You are not authorized to access https://dev.azure.com" even though my credentials are valid.
Please take a look at this:
var vssConnection = new VssConnection(new Uri("ORG_URI"), new VssBasicCredential(string.Empty, "PAT"));
var gitClient = vssConnection.GetClient<GitHttpClient>();
var tag = new GitAnnotatedTag
{
Name = "tagname",
Message = "A new tag",
TaggedBy = new GitUserDate
{
Name = "Name",
Email = "Email",
Date = DateTime.Now,
ImageUrl = null
},
ObjectId = "SHA",
TaggedObject = new GitObject
{
ObjectId = "SHA",
ObjectType = GitObjectType.Commit
},
Url = string.Empty
};
var sourceRepo = await gitClient.GetRepositoryAsync("PROJECT", repoName);
var tags = await gitClient.GetTagRefsAsync(sourceRepo.Id);
// This works fine and a tag is displayed
Console.WriteLine(tags.First().Name);
// This throws "VS30063: You are not authorized to access https://dev.azure.com"
await gitClient.CreateAnnotatedTagAsync(tag, "PROJECT", sourceRepo.Id);
Can you please provide a sample for CreateAnnotatedTagAsync method?
I keep getting "VS30063: You are not authorized to access https://dev.azure.com" even though my credentials are valid.
Please take a look at this: