https://pulumi.com logo
g

gorgeous-vegetable-27176

09/14/2023, 11:21 AM
Does
pulumi up
run the actual Go code to perform what is required?
b

billowy-army-68599

09/14/2023, 1:44 PM
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

gorgeous-vegetable-27176

09/14/2023, 1:49 PM
I'm having an issue with azure container registry credentials, are you able to help please?
b

billowy-army-68599

09/14/2023, 1:55 PM
what issue are you having?
g

gorgeous-vegetable-27176

09/14/2023, 1:59 PM
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

billowy-army-68599

09/14/2023, 2:05 PM
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

gorgeous-vegetable-27176

09/14/2023, 2:07 PM
b

billowy-army-68599

09/14/2023, 2:07 PM
ah that doesn’t look correct, let me file an issue
g

gorgeous-vegetable-27176

09/14/2023, 2:07 PM
I'm using Goland 🙂
I'm trying to set-up Azure container apps which I think is what I need to use 🙂
g

gorgeous-vegetable-27176

09/15/2023, 8:04 AM
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?