Hi everyone :slightly_smiling_face: , I am trying ...
# azure
r
Hi everyone 🙂 , I am trying to set up ContainerApps with Pulumi but I am running into issues enabling the azure container api when executing
pulumi up
. See code snippet below. Any help is greatly appreciated! 🎉
Copy code
from pulumi_azure_native import web

container_app = web.ContainerApp("containerApp",
    configuration=web.ConfigurationArgs(
        ingress=web.IngressArgs(
            external=True,
            target_port=3000,
        ),
    ),
    kind="containerApp",
    kube_environment_id=managed_environment.id,
    location="East US",
    name="supacoda",
    resource_group_name=resource_group.name,
    template=web.TemplateArgs(
        containers=[web.ContainerArgs(
            image=f"{os.getenv('DOCKERHUB_USERNAME')}/image:latest",
            name="supacoda",
        )],
        scale=web.ScaleArgs(
            max_replicas=5,
            min_replicas=1,
            rules=[web.ScaleRuleArgs(
                custom=web.CustomScaleRuleArgs(
                    metadata={
                        "concurrentRequests": "50",
                    },
                    type="http",
                ),
                name="httpscalingrule",
            )],
        ),
    ))
I get the following error even after following azure instructions here to enable the extension and register resources. • I have looked everywhere and cannot find how to enable this api for the pulumi process. • Running via the AZ CLI works • By the way container apps is in preview but this feels more like an issue downstream with pulumi since I can set up container apps just fine via the CLI.
Copy code
Diagnostics:
  azure-native:web:ContainerApp (containerApp):
    error: Code="NotFound" Message="ContainerApps APIs are not enabled." Details=[{"Message":"ContainerApps APIs are not enabled."},{"Code":"NotFound"},{"ErrorEntity":{"Code":"NotFound","ExtendedCode":"67003","Message":"ContainerApps APIs are not enabled.","MessageTemplate":"ContainerApps APIs are not enabled.","Parameters":[]}}]
t
I believe
web.ContainerApp
is deprecated in favor of
app.ContainerApp
https://www.pulumi.com/registry/packages/azure-native/api-docs/app/containerapp/
@happy-parrot-60128 should we mark it as deprecated in the docs (or remove entirely)?
r
@tall-librarian-49374 thanks !! I didn't catch that. The python example is from last year and I have had to modify it a bit. running into an error now where kind (param) is not recognized so I may need to update some more code after reviewing the docs. Might contribute back if I create something robust enough.
h
Yup, I think we’ll remove it once Microsoft confirm the whole migration of all existing resources is complete
r
thank you both 👍