baf3ed08c2
remove credential |
||
---|---|---|
.. | ||
azext_mlclassicextension | ||
README.md | ||
automated-assessment-report.ps1 | ||
setup.cfg | ||
setup.py | ||
test.py |
README.md
Azure Machine Learning Adoption Framework Automated Assessment Tool
This tool is an Azure CLI exention to automatically list Machine Learning Studio(classic) assets (worksapce, web services, datasets, experiments etc) of a given subscription. It helps to inventory ML Studio(classic) assets and locate assets owner.
NOTE
This tool only list the paid ML Studio(classic) assets. Free workspaces will not be listed.
Build the automated assessment tool
To build the automated assessment tool, run the following command in the automated_assessment
folder (make sure you have an active Pyhon environment):
python setup.py bdist_wheel
Use the automated assessment tool
NOTE
The examples below demonstrate the use of Azure CLI (including the ML Classic extension) in a PowerShell environment. For more details on AZ execution environments, check the Choose the right command-line tool for Azure section in the documentation.
-
Install the
az mlclassic
extensionaz extension add --source .\dist\mlclassic-1.0.0-py2.py3-none-any.whl
If you are upgrading from a previous version of the tool, you can remove the old version using
az extension remove --name mlclassic
-
Login with an Azure AD account
Make sure your account has proper permissions to access the ML Classic workspaces, and set the subscription you want to analyze.
az login az account list az account set --subscription "Your subscription here"
-
Run the automated-assessment-report PowerShell script
The script will execute the CLI commands in below sesction for all the worksapces under the subscription you set in step 2. Make sure you set the path in the
$reportPath
variable. The script will save the asset inventory report in the path you set.
Features of the automated assessment tool
This section explains the functionality of each command in the tool. If you want to generate a report of ML Studio(classic) assets under a given subscrption, run the automated assessment report script.
-
List all ML Classic workspaces.
$mlClassicWorkspaces = az resource list --resource-type Microsoft.MachineLearning/Workspaces | ConvertFrom-Json
-
Get the details of a selected workspace.
$mlClassicWorkspace = az resource show --ids $mlClassicWorkspaces[0].id | ConvertFrom-Json
-
Get the workspace id, workspace location, workspace access keys, and API url.
$mlClassicWorkspaceId = $mlClassicWorkspace.properties.workspaceId $mlClassicWorkspaceLocation = $mlClassicWorkspace.location.ToLower().Replace(" ", "") $mlClassicWorkspaceKeys = az resource invoke-action --action listworkspacekeys --ids $mlClassicWorkspaces[0].id | ConvertFrom-Json $mlClassicApi = $mlClassicWorkspace.properties.studioEndpoint
-
Get the ML Classic workspace properties
az mlclassic workspace show -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken
-
Get the ML classic project in a workspace
$mlClassicProjects = az mlclassic workspace projects -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken | ConvertFrom-Json
-
Get the ML classic experiment id and details
$mlClassicExperiments = az mlclassic workspace experiments -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken | ConvertFrom-Json $mlClassicExperimentId = $mlClassicExperiments[0].ExperimentId $mlClassicExperiment = az mlclassic workspace experiment -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken -eid $mlClassicExperimentId | ConvertFrom-Json
-
Get the ML classic webservices, webservice id, and webservice details
$mlClassicWebservices = az mlclassic workspace webservices -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken | ConvertFrom-Json $mlClassicWebserviceId = $mlClassicWebservices[0].Id $mlClassicWebservice = az mlclassic workspace webservice -wid $mlClassicWorkspaceId -wl $mlClassicWorkspaceLocation -wapi $mlClassicApi -wat $mlClassicWorkspaceKeys.primaryToken -wsid $mlClassicWebserviceId | ConvertFrom-Json
-
Get the ML classic new webservices, new webservice id, and new webservice details
$mlClassicNewWebservices = az resource list --resource-type Microsoft.MachineLearning/WebServices | ConvertFrom-Json $mlClassicNewWebserviceId = $mlClassicNewWebservices[0].id $mlClassicNewWebservice = az resource show --ids $mlClassicNewWebserviceId | ConvertFrom-Json
-
Get ML classic commitment plans, commitment plan id, commitment plan details, and commitment plan associations
$mlClassicCommitmentPlans = az resource list --resource-type Microsoft.MachineLearning/CommitmentPlans | ConvertFrom-Json $mlClassicCommitmentPlanId = $mlClassicCommitmentPlans[0].id $mlClassicCommitmentPlan = az resource show --ids $mlClassicCommitmentPlanId | ConvertFrom-Json $mlClassicCommitmentPlanAssociations = (az rest -u "https://management.azure.com$($mlClassicCommitmentPlanId)/commitmentAssociations?api-version=2016-05-01-preview" | ConvertFrom-Json).value