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()
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)
-
Khaled Kelany 96 Reputation points
2021-02-25T00:37:50.797+00:00
2 additional answers
Sort by: Most helpful
-
BhargaviAnnadevara-MSFT 5,446 Reputation points
2021-02-24T08:18:05.98+00:00 @Khaled Kelany 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 fromazure.quantum
in yourpy
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 myconda
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 thelocation
parameter in your Workspace object definition that could possibly cause errors)Here are some resources for your reference:
-
Khaled Kelany 96 Reputation points
2021-02-24T14:11:18.48+00:00 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
is0.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!