This message was deleted.
# azure
s
This message was deleted.
b
can you share your code?
h
Copy code
container_group = azure_native.containerinstance.ContainerGroup(
    f"spl-outputs",
    tags=config.require_object("tags"),
    container_group_name=f"spl-outputs",
    containers=[
        azure_native.containerinstance.ContainerArgs(
            command=[],
            environment_variables=[
                azure_native.containerinstance.EnvironmentVariableArgs(
                    name="AZURE_STORAGE_CONNECTION_STRING",
                    secure_value=config.require_secret("azureStorageConnectionString"),
                ),
                azure_native.containerinstance.EnvironmentVariableArgs(
                    name="API_BASE_URL",
                    secure_value=config.require("apiBaseUrl"),
                ),
            ],
            image=config.require("image"),
            name="spl-output",
            ports=[
                azure_native.containerinstance.ContainerPortArgs(
                    port=80,
                )
            ],
            resources=azure_native.containerinstance.ResourceRequirementsArgs(
                requests=azure_native.containerinstance.ResourceRequestsArgs(
                    cpu=1,
                    memory_in_gb=2,
                ),
            ),
        ),
        azure_native.containerinstance.ContainerArgs(
            command=["python demographics_scheduler.py"],
            image=config.require("image"),
            name="demographics",
            resources=azure_native.containerinstance.ResourceRequirementsArgs(
                requests=azure_native.containerinstance.ResourceRequestsArgs(
                    cpu=0.2,
                    memory_in_gb=0.5,
                ),
            ),
        ),
    ],
    image_registry_credentials=[
        azure_native.containerinstance.ImageRegistryCredentialArgs(
            server=config.require("imageRegistryServer"),
            username=config.require_secret("imageRegistryUsername"),
            password=config.require_secret("imageRegistryPassword"),
        )
    ],
    ip_address=azure_native.containerinstance.IpAddressArgs(
        ports=[
            azure_native.containerinstance.PortArgs(
                port=80,
                protocol="TCP",
            )
        ],
        type="Private",
    ),
    location=config.require("location"),
    network_profile=azure_native.containerinstance.ContainerGroupNetworkProfileArgs(
        id=network_profile.id,
    ),
    os_type="Linux",
    resource_group_name=resource_group.name.apply(lambda x: x),
    opts=pulumi.ResourceOptions(delete_before_replace=True),
)
if I manually delete the container group before running this, it works fine. But if I try to update one which already exists then it throws the aforementioned error
b
I see you're setting the name explicitly:
container_group_name=f"spl-outputs"
which is probably related
is there a reason you're doing that? it seems the upstream API is allowing an update method but the APi doesn't like it
h
is it bad practice to set the container name explicitly? The name needs to be known ahead of time for later steps in CI/CD and other services
b
it's not bad practice per-se, it just creates these kind of issues with some upstream APIs
can you open an issue for this, it may be an edge case
h
t
I commented in the issue. The explicit name isn’t related I think.