Skip to content

Instantly share code, notes, and snippets.

@Vivek0712
Created August 20, 2021 05:18
from azureml.core import Workspace
try:
ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)
ws.write_config()
ws = Workspace.from_config()
print("Workspace configuration succeeded. Skip the workspace creation steps below")
except:
print("Workspace not accessible. Create the workspace")
ws = Workspace.create(name= workspace_name,
subscription_id= subscription_id,
resource_group= resource_group,
create_resource_group=True,
location= workspace_region
)
# Fetch and Display the workspace
ws = Workspace.from_config()
#Display the details
#ws.get_details()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment