Can't login to the workspace

Khaled Kelany 96 Reputation points
2021-02-23T21:11:13.887+00:00

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
Azure Quantum
An Azure service that provides quantum computing and optimization solutions.
60 questions
0 comments No comments
{count} votes

2 additional answers

Sort by: Most helpful
  1. 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 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:

    0 comments No comments

  2. 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 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!

    0 comments No comments