Python SDK health check to Temporal Cloud fails with "Request unauthorized."

Hi team,

I am using the Python SDK with Temporal Cloud and trying to call await client.service_client.check_health() for a container health check, but it is failing with “Request unauthorized.”. However, besides the health check, the worker seems successfully connected and authenticated as it can run workflows and activities without a problem.

This is my client config:

    client = await Client.connect(
        target_host="us-west-2.aws.api.temporal.io:7233",
        namespace=os.environ["TEMPORAL_NAMESPACE"],
        api_key=os.environ["TEMPORAL_API_KEY"],
        tls=True,
        data_converter=pydantic_data_converter,
    )

I have tried granting “Write” and “Namespace Admin” permissions to the user associated with the API key to no avail.

At this point, I’m not sure if I have a misconfigured client or misconfigured Cloud permissions, or something else. I would appreciate any insight.

Thanks!

Did you ever make any progress troubleshooting this?

I’m facing the same “Request unauthorized” error with the connecting with an API key using the Go SDK. Having trouble knowing what to try next.