https://pulumi.com logo
#general
Title
# general
b

bland-minister-14373

08/30/2021, 9:53 AM
Hey guys! I have a problem with provisioning ACR, with azure.native package from pulumi. with the classic package there were two output properties for the username and password of the container registry, in the new version it seems that it is moved to
GetRegistryCredentials
https://www.pulumi.com/docs/reference/pkg/azure-native/containerregistry/getregistrycredentials/, but the problem is that it provides only strings and not outputs, and when I try to make them as an output of the stack I get an error indicating the value was not an output, any workarounds? ``````
g

gentle-restaurant-16139

08/30/2021, 3:59 PM
Hi, I'm doing something like that
Copy code
const registryCreds = pulumi.all([registry.name, resourceGroup.name]).apply(([registryName, rgName]) => {
    return getRegistryCredentials({
        resourceGroupName: rgName,
        registryName: registryName,
    });
});

export const username = registryCreds.username;
export const password = registryCreds.password;
It's a bit ugly, but works
🙌 1
b

bland-minister-14373

09/07/2021, 6:43 AM
Thanks, I'll try it 👍
g

green-intern-53931

12/23/2021, 2:43 PM
This worked for me https://github.com/pulumi/examples/blob/master/azure-ts-appservice-docker/index.ts
Copy code
const credentials = containerregistry.listRegistryCredentialsOutput({
    resourceGroupName: resourceGroup.name,
    registryName: registry.name,
});

const adminUsername = credentials.apply(credentials => credentials.username!);
const adminPassword = credentials.apply(credentials => credentials.passwords![0].value!);
5 Views