Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Workspace ID

Hello,

I am learning MS Fabric and I would like to call Notebook via HTTP request (POST https://api.fabric.microsoft.com/v1/workspaces/{{WORKSPACE_ID}}/items/{{ARTIFACT_ID}}/jobs/instances?jobType=RunNotebook).

To achieve it I need to now WorkspaceID and notebook ArtifactID. 

For that I need to create Workspace Identity, but this option is disabled. I have trial version of Fabric (F64) and I get folllowing warnning:

Workspace identities are supported in workspaces assigned to Fabric capacities (F64 or higher). If this workspace was migrated and is no longer assigned to an F64 (or higher) capacity, any items using workspace identities may no longer work.

Where could be a problem please?

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 
    Thanks for using Fabric Community.
    To get the Workspace Id you can simply refer to the URL of the Workspace. Just open the workspace in Fabric and get the URL. For example:
    https://msit.powerbi.com/groups/9aa06270-7312-4340-ab81-690afd6cg56/list?experience=power-bi 

    The string in bold letters is your workspace id. 
    Similarly you can open the notebook and fetch the URL:

    https://msit.powerbi.com/groups/9aa06270-7312-4340-ab81-690afd6cg56/synapsenotebooks/bfcb353f-66f1-428a-8416-682c8c23?experience=power-bi 

    The string in bold letters is your notebook id in the same workspace.

    Hope this helps. Please let me know if you have any further questions.

     

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 
    We haven’t heard from you on the last response and was just checking back to see if your query got resolved. Otherwise, will respond back with the more details and we will try to help.
    Thanks

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 
    The orginal ask is different from the above query. Can you please create a new post for the above query and provide all the details?
    Thanks

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,

    thank you for your message(s). I realized later, that it will be accessible from url . . . as you recommended it to me.

    So from this point of view is my code working.

     

    Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 
    Thanks for using Fabric Community.
    To get the Workspace Id you can simply refer to the URL of the Workspace. Just open the workspace in Fabric and get the URL. For example:
    https://msit.powerbi.com/groups/9aa06270-7312-4340-ab81-690afd6cg56/list?experience=power-bi 

    The string in bold letters is your workspace id. 
    Similarly you can open the notebook and fetch the URL:

    https://msit.powerbi.com/groups/9aa06270-7312-4340-ab81-690afd6cg56/synapsenotebooks/bfcb353f-66f1-428a-8416-682c8c23?experience=power-bi 

    The string in bold letters is your notebook id in the same workspace.

    Hope this helps. Please let me know if you have any further questions.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 
      We haven’t heard from you on the last response and was just checking back to see if your query got resolved. Otherwise, will respond back with the more details and we will try to help.
      Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    this one request is resolved. Could I have another one?

    I need to use Fabric API to run notebook. I have created app registration for this purpose. I get the token but when I use it to call Fabric API, a get error 

    {"requestId":"852e1ecc-6970-4d4e-bea7-9baeb5d177df","errorCode":"Unauthorized","message":"The caller is not authenticated to access this resource"}.
     
    from azure.identity import ClientSecretCredential
    tenant_id = 'xxx'
    client_id = 'xxx'
    client_secret = 'xxx'
    client_secret_credential_class = ClientSecretCredential(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)
    access_token_class = client_secret_credential_class.get_token(scope)
    token_string = access_token_class.token

    . . . then I use it to get workspaces

    response: requests.Response = requests.get(url=url, headers=get_headers())

    Where could be problem? What do I wrong?

    Thanks

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 
      The orginal ask is different from the above query. Can you please create a new post for the above query and provide all the details?
      Thanks