Fix Container App py example
MODIFY
azure-py-containerapps/__main__.py
azure-py-containerapps/__main__.py
@@ -4,7 +4,7 @@ import pulumi
from pulumi_azure_native import containerregistry
from pulumi_azure_native import operationalinsights
from pulumi_azure_native import resources
-from pulumi_azure_native import web
+import pulumi_azure_native.web.v20210301 as web
import pulumi_docker as docker
resource_group = resources.ResourceGroup("rg")
@@ -35,18 +35,17 @@ registry = containerregistry.Registry("registry",
sku=containerregistry.SkuArgs(name="Basic"),
admin_user_enabled=True)
-credentials = pulumi.Output.all(resource_group.name, registry.name) \
- .apply(lambda args: containerregistry.list_registry_credentials(
- resource_group_name=args[0],
- registry_name=args[1]
- ))
-admin_username = credentials.Apply(lambda c: c.username)
-admin_password = credentials.Apply(lambda c: c.passwords[0])
+credentials = pulumi.Output.all(resource_group.name, registry.name).apply(
+ lambda args: containerregistry.list_registry_credentials(resource_group_name=args[0],
+ registry_name=args[1]))
+admin_username = credentials.username
+admin_password = credentials.passwords[0]["value"]
custom_image = "node-app"
my_image = docker.Image(custom_image,
- image_name=Output.concat(registry.login_server, "/", custom_image, ":v1.0.0"),
- build=docker.DockerBuild(context = Output.concat("./", custom_image)),
+ image_name=registry.login_server.apply(
+ lambda login_server: f"{login_server}/{custom_image}:v1.0.0"),
+ build=docker.DockerBuild(context=f"./{custom_image}"),
registry=docker.ImageRegistry(
server=registry.login_server,
username=admin_username,

Fix Container App py example (#1108)