Does `pulumi up` run the actual Go code to perform...
# getting-started
g
Does
pulumi up
run the actual Go code to perform what is required?
b
it builds a binary locally or uses
go run
to compile into a go binary
if you use automation API, you can wrap that into your own binary if you wish
g
I'm having an issue with azure container registry credentials, are you able to help please?
b
what issue are you having?
g
Copy code
_, err := containerregistry.NewCredentialSet(ctx, "credentialSet", &containerregistry.CredentialSetArgs{
			AuthCredentials: []containerregistry.AuthCredentialArgs{
				{
					Name:                     pulumi.String("Credential1"),
					PasswordSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/password>"),
					UsernameSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/username>"),
				},
			},
			CredentialSetName: pulumi.String("myCredentialSet"),
			Identity: &containerregistry.IdentityPropertiesArgs{
				Type: containerregistry.ResourceIdentityTypeSystemAssigned,
			},
			LoginServer:       pulumi.String("<http://docker.io|docker.io>"),
			RegistryName:      pulumi.String("myRegistry"),
			ResourceGroupName: pulumi.String("myResourceGroup"),
		})
		if err != nil {
			return err
		}
And I'm getting the following error:
Copy code
Cannot use '[]containerregistry.AuthCredentialArgs{ { Name: pulumi.String("Credential1"), PasswordSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/password>"), UsernameSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/username>"), }, }' (type []containerregistry.AuthCredentialArgs) as the type AuthCredentialArrayInput Type does not implement 'AuthCredentialArrayInput' as some methods are missing: ElementType() reflect.Type ToAuthCredentialArrayOutput() AuthCredentialArrayOutput ToAuthCredentialArrayOutputWithContext(context.Context) AuthCredentialArrayOutput
b
That error is telling you that the type you’re passing is wrong, you need an array. Are you using an IDE like vscode? it really will help with these types
quickly throwing that into vscode I get:
Copy code
credentialSet, err := containerregistry.NewCredentialSet(ctx, "credentialSet", &containerregistry.CredentialSetArgs{
			AuthCredentials: containerregistry.AuthCredentialArray{
				&containerregistry.AuthCredentialArgs{
					Name:                     pulumi.String("Credential1"),
					PasswordSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/password>"),
					UsernameSecretIdentifier: pulumi.String("<https://myvault.vault.azure.net/secrets/username>"),
				},
			},
			CredentialSetName: pulumi.String("myCredentialSet"),
			Identity: &containerregistry.IdentityPropertiesArgs{
				Type: containerregistry.ResourceIdentityTypeSystemAssigned,
			},
			LoginServer:       pulumi.String("<http://docker.io|docker.io>"),
			RegistryName:      pulumi.String("myRegistry"),
			ResourceGroupName: pulumi.String("myResourceGroup"),
		})
		if err != nil {
			return err
		}
		return nil
g
b
ah that doesn’t look correct, let me file an issue
g
I'm using Goland 🙂
I'm trying to set-up Azure container apps which I think is what I need to use 🙂
g
I did, I'll digest some more today
Regarding this example code:
Copy code
registry, err := containerregistry.NewRegistry(ctx, "registry", &containerregistry.RegistryArgs{
			ResourceGroupName: resourceGroup.Name,
			Sku: containerregistry.SkuArgs{
				Name: pulumi.String("Basic"),
			},
			AdminUserEnabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
How can I use an existing Azure registry instead of create one?
Effectively, what I'm trying to accomplish is: Deploy multiple containers from an existing Azure registry as containers into a "dev" group for setting up our first dev environment. Then allow each of those containers to talk to each other?