Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,959 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
We do have lot of ML compute instance running and every month we need to delete it and re-create it with same config. we are planning to create a script to perform this activity and then will schedule it once a month.
what's the best way to perform this activity in azure? Azure CLI or PowerShell ? Please let me know.
Thanks
Once you have this script, you can schedule it to run once a month using a task scheduler like Windows Task Scheduler or Azure Automation :))))
# Import the module
Import-Module Az
# Connect to your Azure account
Connect-AzAccount
# Get the ML compute instance
$computeInstance = Get-AzResource -ResourceGroupName "<ResourceGroupName>" -ResourceType "Microsoft.MachineLearningServices/workspaces/computes" -ResourceName "<WorkspaceName>/<ComputeName>"
# Delete the ML compute instance
Remove-AzResource -ResourceId $computeInstance.ResourceId -Force
# Recreate the ML compute instance with the same configuration
New-AzResource -ResourceGroupName "<ResourceGroupName>" -ResourceType "Microsoft.MachineLearningServices/workspaces/computes" -ResourceName "<WorkspaceName>/<ComputeName>" -Properties $computeInstance.Properties -Force