https://pulumi.com logo
#azure
Title
# azure
w

wet-noon-14291

06/13/2020, 7:55 PM
If I want to output the admin user name and password for azure container registry so I can reference it from another stack, how do I turn the admin password to a secret? I've tried:
Copy code
let options = CustomResourceOptions()
        options.AdditionalSecretOutputs <- ["AdminPassword"] |> ResizeArray

        Registry(name, 
            RegistryArgs(
                Sku = input "basic",
                ResourceGroupName = io resourceGroup.Name,
                AdminEnabled = input true
            ), options = options)
but that doesn't seem to do the trick.
I thought that setting the
AdditionalSecretOutputs
would propagate when I later access the value.
t

tall-librarian-49374

06/13/2020, 9:18 PM
You can mark it as secret when exporting
Copy code
let secretOutput = notSecretOutput.Apply(Output.CreateSecret)
w

wet-noon-14291

06/13/2020, 9:23 PM
thanks.
It wasn't that smooth with F# for some reason. I used
Copy code
let makeSecret = Func<string, Output<string>>(Output.CreateSecret)
    let adminPassword = containerRegistry.AdminPassword.Apply<string>(makeSecret)
then I outputted the secret.
t

tall-librarian-49374

06/13/2020, 10:24 PM
I guess we could put this helper function into the standard library
3 Views