SecretClient.get_secret not working in a docker container

Zhu, Han 0 Reputation points
2024-07-29T02:57:49.25+00:00
self.credential = ManagedIdentityCredential(client_id=self.config["managed_identity_client_id"])
self.client = SecretClient(vault_url=self.kv_uri, credential=self.credential)
self.api_key = self.client.get_secret(self.config["secret_key"]).value


azure.identity._exceptions.CredentialUnavailableError: ManagedIdentityCredential authentication unavailable. The requested identity has not been assigned to this resource. Error: Unexpected response "{'error': 'invalid_request', 'error_description': 'Identity not found'}"

this could not fetch an api_key after I packaged it into a docker image and run in a container.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,833 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.