Skip to content

Instantly share code, notes, and snippets.

@pierskarsenbarg
Created May 19, 2021 11:58
Show Gist options
  • Select an option

  • Save pierskarsenbarg/726c59d7ce29c3aee6dca806f2576405 to your computer and use it in GitHub Desktop.

Select an option

Save pierskarsenbarg/726c59d7ce29c3aee6dca806f2576405 to your computer and use it in GitHub Desktop.
private (Output<string> registryUsername, Output<string> registryPassword) GetRegistryLogin(Output<string> resourceGroupName, Output<string> registryName)
{
var credentials = Output.Tuple(resourceGroupName, registryName).Apply(values =>
ListRegistryCredentials.InvokeAsync(new ListRegistryCredentialsArgs
{
ResourceGroupName = values.Item1,
RegistryName = values.Item2
}));
var registryUsername = credentials.Apply(c => c.Username ?? "");
var registryPassword = credentials.Apply(c => Output.CreateSecret(c.Passwords.First().Value ?? ""));
return (registryUsername, registryPassword);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment