0

I am trying to interact with Azure Batch with python API, in the following way:

from azure.batch import BatchServiceClient
batch = BatchServiceClient('<mycredential>','https://<mybatchaccount>.<region>.batch.azure.com')
next(batch.job.list())

This is run in a ML Studio notebook.

However the following error appears: AttributeError: 'str' object has no attribute 'signed_session'.
I am taking the url and credentials from my batch console UI:

enter image description here

As a credential I tried both Primary and Secondary access keys amd "URL" as batch url.
Am I doing anything wrong?
Thanks

1 Answer 1

1

<mycredential> should not be your bare auth key string. You need to create a shared auth key object.

credentials = batchauth.SharedKeyCredentials(BATCH_ACCOUNT_NAME, BATCH_ACCOUNT_KEY)
batch_client = batch.BatchServiceClient(credentials, base_url=BATCH_ACCOUNT_URL)

Please see the Azure Batch Python tutorial.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.