-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert Go Azure examples to fnOutput form #1154
Changes from 1 commit
34e80a8
7e6bb9b
85d653a
58e0c75
8c22bec
5de4568
a1e605a
ae0cd5f
09c316e
b740088
317d0b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…mage to pull since the old image 404s. refactored to use fnOutput form
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ func main() { | |
// The example uses a HelloWorld application written in Go. | ||
// Image: https://hub.docker.com/r/microsoft/azure-appservices-go-quickstart/ | ||
// | ||
imageInDockerHub := "microsoft/azure-appservices-go-quickstart" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this image was 404'ing I replaced it with an nginx base image since it's about deploying an image from docker hub |
||
imageInDockerHub := "mcr.microsoft.com/azuredocs/aci-helloworld" | ||
helloApp, err := web.NewWebApp(ctx, "helloApp", &web.WebAppArgs{ | ||
ResourceGroupName: resourceGroup.Name, | ||
ServerFarmId: plan.ID(), | ||
|
@@ -57,7 +57,7 @@ func main() { | |
} | ||
|
||
ctx.Export("helloEndpoint", helloApp.DefaultHostName.ApplyT(func(defaultHostName string) (string, error) { | ||
return fmt.Sprintf("%v%v%v", "https://", defaultHostName, "/hello"), nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the nginx image doesn't have a |
||
return fmt.Sprintf("%v%v", "https://", defaultHostName), nil | ||
}).(pulumi.StringOutput)) | ||
|
||
// | ||
|
@@ -75,25 +75,13 @@ func main() { | |
return err | ||
} | ||
|
||
credentials := pulumi.All(resourceGroup.Name, registry.Name).ApplyT( | ||
func(args []interface{}) (*containerregistry.ListRegistryCredentialsResult, error) { | ||
resourceGroupName := args[0].(string) | ||
registryName := args[1].(string) | ||
return containerregistry.ListRegistryCredentials(ctx, &containerregistry.ListRegistryCredentialsArgs{ | ||
ResourceGroupName: resourceGroupName, | ||
RegistryName: registryName, | ||
}) | ||
}, | ||
) | ||
credentials := containerregistry.ListRegistryCredentialsOutput(ctx, containerregistry.ListRegistryCredentialsOutputArgs{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
RegistryName: registry.Name, | ||
ResourceGroupName: resourceGroup.Name, | ||
}) | ||
|
||
adminUsername := credentials.ApplyT(func(result interface{}) (string, error) { | ||
credentials := result.(*containerregistry.ListRegistryCredentialsResult) | ||
return *credentials.Username, nil | ||
}).(pulumi.StringOutput) | ||
adminPassword := credentials.ApplyT(func(result interface{}) (string, error) { | ||
credentials := result.(*containerregistry.ListRegistryCredentialsResult) | ||
return *credentials.Passwords[0].Value, nil | ||
}).(pulumi.StringOutput) | ||
adminUsername := credentials.Username().Elem() | ||
adminPassword := credentials.Passwords().Index(pulumi.Int(0)).Value().Elem() | ||
|
||
myImage, err := docker.NewImage(ctx, customImage, &docker.ImageArgs{ | ||
ImageName: registry.LoginServer.ApplyT(func(result string) (string, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the image to an image that exists so I updated the README with the expected outputs.