Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from azureml.core import Workspace
from azureml.core.compute import ComputeTarget
from azureml.core.compute_target import ComputeTargetException
# Load the workspace from config.json
ws = Workspace.from_config()
# Now let's make sure we have a compute resource
instance_name = "My-Compute"
# Fetch or create the compute resource
instance = ComputeTarget(workspace=ws, name=instance_name)
print('Deleted compute resource')
except ComputeTargetException:
print('Already deleted!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment