I'm trying to generate a new auth token with beginCreateAndWait
, but passwords are not being generated with the token, I'm getting an empty array in token.credentials.passwords
and when looking in the Portal, no passwords were generated for the token. I tried to provoke generation of these credentials by including values in the tokenCreateParameters
parameter as such:
credentials: {
passwords: [{ name: 'password1' }],
},
However this causes an error to be thrown: "New passwords can be added only through 'generateCredentials'. For more information on repository permissions, please visit https://aka.ms/acr/repo-permissions."
Following the link brings you to the CLI documentation.
The docs describe how to generate these passwords with the CLI here, but I'm using the JavaScript SDK, for which the documentation is sorely lacking. I've been searching for over an hour now and can't find any documentation about how to generate passwords for tokens with the SDK.
Can I somehow just generate the passwords at the same time as the token? If not, how do I generate them programmatically with the SDK?