@Muqaddas Abbas In this case you will have to use Workspace.from_config()
This call will then prompt an interactive login to Azure portal.
Ex:
ws = Workspace.from_config()
ws.get_details()
Before calling this you will have to specify the config file path with details of your subscription and workspace.
ws.write_config(path="./file-path", file_name="ws_config.json")
The JSON file should contain details of your subscription, resource group and workspace.
{
"subscription_id": "<subscription-id>",
"resource_group": "<resource-group>",
"workspace_name": "<workspace-name>"
}
Please refer the documentation for more details.
If an answer is helpful, please click on or upvote which might help other community members reading this thread.