Created
August 20, 2021 05:18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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