Skip to content

Commit

Permalink
Handle DevOps PAT creation error (#7702)
Browse files Browse the repository at this point in the history
  • Loading branch information
weshaggard authored Feb 23, 2024
1 parent 0362a62 commit 9dfa46a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public override async Task<SecretValue> OriginateValueAsync(SecretState currentS

PatTokenResult result = await client.CreatePatAsync(new PatTokenCreateRequest { AllOrgs = false, DisplayName = this.patDisplayName, Scope = this.scopes, ValidTo = expirationDate.UtcDateTime });

if (result.PatTokenError != SessionTokenError.None) {
throw new RotationException($"Unable to create PAT: {result.PatTokenError}");
}

string authorizationId = result.PatToken.AuthorizationId.ToString();

this.logger.LogInformation("Azure DevOps responded with authorization id '{AuthorizationId}'", authorizationId);
Expand Down

0 comments on commit 9dfa46a

Please sign in to comment.