question

KhaledKelany-1801 avatar image
0 Votes"
KhaledKelany-1801 asked KhaledKelany-1801 answered

Can't login to the workspace

I'm using Python to submit a job to azure-quantum. However, in my recent attempt t login to my workspace using:

 workspace = Workspace( 
 subscription_id="my_subscription_id", 
 resource_group="my_resource_group", 
 name="the_name", 
 location="eastus", ) 
 workspace.login() 

I receive the error:
json.decoder.JSONDecodeError: Extra data: line 1 column 7 (char 6)


azure-quantum
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KhaledKelany-1801 avatar image
0 Votes"
KhaledKelany-1801 answered

I managed to solve the problem by removing the cached credential file in /home/user/.azure-quantum/aad.bin and re-login using:
workspace.login()

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

bhargaviannadevara-msft avatar image
0 Votes"
bhargaviannadevara-msft answered

@KhaledKelany-1801 Thanks for your interest in Azure Quantum!

Before initiating a connection to your Quantum workspace, I hope you have installed the Azure Quantum Python SDK and imported the Workspace module from azure.quantum in your py code.

I could not reproduce the mentioned error, but here is the Python code I could get to work to connect to my Azure Quantum workspace:

# File: workspace.py
from azure.quantum import Workspace

# Copy the settings for your workspace below
workspace = Workspace(
    subscription_id="***",  # Add your subscription_id
    resource_group="Quantum-Resource-Group",   # Add your resource_group
    name="myquantumworkspace",  # Add your workspace name
    location="westus",  # Add your workspace location (for example, "westus")
)

workspace.login()

And then I was able to run this with python workspace.py from my conda environment.

If you still run into issues, please help us with the package version for azure-quantum you're seeing this with.
(I also notice that there is a trailing , after the location parameter in your Workspace object definition that could possibly cause errors)

Here are some resources for your reference:

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KhaledKelany-1801 avatar image
0 Votes"
KhaledKelany-1801 answered

Thank you for your reply.


I did have installed the Azure Quantum Python SDK and imported the Workspace module. My code is identical to the code you posted.

The package version for azure-quantum is 0.15.2101.126941 and I'm using Python3.8.


(I also notice that there is a trailing , after the location parameter in your Workspace object definition that could possibly cause errors)

I don't think this might cause an error!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.