Failed to test real-time endpoint request() got an unexpected keyword argument 'tenant_id'

Mateusz Macias 1 Reputation point
2022-08-15T18:40:08.613+00:00

Hi all,
after deployment of real time endpoint I try to test it by pinging. For now my run is minimal and looks like this:
def run(raw_data):
"""
This function is called for every invocation of the endpoint to perform the actual scoring/prediction.
In the example we extract the data from the json input and call the scikit-learn model's predict()
method and return the result back
"""
logging.info("Request received")

    KVUri = f"<<endpoint url here>>"  
  
    credential = ManagedIdentityCredential()  
    client = SecretClient(vault_url=KVUri, credential=credential)  
    retrieved_secret = client.get_secret("test-secret")  
  
    logging.info("Request processed")  
    return [retrieved_secret]  
  

After pinging I just get an error:

Failed to test real-time endpoint
request() got an unexpected keyword argument 'tenant_id'

Somebody mentioned that this might be something that was fixed in later verisions of azure identity library. My conda currently looks like this:

name: model-env  
channels:  
  - conda-forge  
dependencies:  
  - python=3.7  
  - numpy=1.21.2  
  - pip=21.2.4  
  - scikit-learn=0.24.2  
  - scipy=1.7.1  
  - pip:  
    - azureml-defaults==1.39.0  
    - inference-schema[numpy-support]==1.3.0  
    - joblib==1.0.1  
    - azure-identity  
    - azure-keyvault-secrets  

Unfortunately, getting never azure-identity seems to require newer python. Unfortunately - I did not manage to make an endpoint even deploy with python 3.8/3.9.
Does anybody have a suggestion on how to fix it?

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

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,736 Reputation points
    2022-08-16T10:39:04.163+00:00

    @Mateusz Macias Thanks for the question. Can you please try Installing azure-identity>=1.8.0.


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.