Wednesday, 4 October 2023

How can I set authentication options for an azure container app via Python SDK?

We're using the Python ContainerAppsAPIClient library to deploy a container app to our azure estate, and it works great however I can't find any documentation on how to set the authentication on the container app either during or after it's been created. In the portal it's super easy to do, and there are some models I've found that appear to support it, but I'm not sure what other model I need to inject them into (if any?).

We're creating the ContainerApp in this kind of fashion:

container_app = ContainerApp(
    location=container_location,
    tags=tags,
    environment_id=f"/subscriptions/{subscription_id}/resourceGroups/{shared_infra_resource_group_name}/providers/Microsoft.App/managedEnvironments/{container_app_environment}",
    configuration=Configuration(
        active_revisions_mode="Single",
        secrets=secrets_config,
        registries=[registry_credentials],
        ingress=ingress,
    ),
    template=template,
    identity=identity,
)

Posible models I've found to use were: AzureActiveDirectoryLogin, AuthConfig etc. but no idea where to put them.. the documentation is pretty much non-existent around this.

More specifically we want to put the container app being our azure active directory login (on the same subscription), using the SDK. Below shows what I did manually in the portal that I'd like to recreate using the SDK:

A screenshot of the azure portal



from How can I set authentication options for an azure container app via Python SDK?

No comments:

Post a Comment