@kalyan reddy A configuration file(JSON) is created when you run the configuration.ipynb file or notebook which can then be used to get the configuration using
ws = Workspace.from_config()
You can run this notebook and create a new workspace if not available or use the existing workspace. For example, Set the workspace details as environment varibles.
import os
subscription_id = os.getenv("SUBSCRIPTION_ID", default="<my-subscription-id>")
resource_group = os.getenv("RESOURCE_GROUP", default="<my-resource-group>")
workspace_name = os.getenv("WORKSPACE_NAME", default="<my-workspace-name>")
workspace_region = os.getenv("WORKSPACE_REGION", default="eastus2")
Write then to config.json file
from azureml.core import Workspace
try:
ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)
# write the details of the workspace to a configuration file to the notebook library
ws.write_config()
print("Workspace configuration succeeded. Skip the workspace creation steps below")
except:
print("Workspace not accessible. Change your parameters or create a new workspace below")
You can now access this config from other notebooks and need not specify the subscription or workspace details in every notebook file.