Search code examples
powershellazure-machine-learning-service

Powershell AzureML Get-AmlWorkspace


Get-AmlWorkspace : One or more errors occurred.
At line:1 char:1
+ Get-AmlWorkspace
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-AmlWorkspace], 
AggregateException
+ FullyQualifiedErrorId : 
System.AggregateException,AzureML.PowerShell.GetWorkspace

I am trying to use Powershell to connect to Azure ML studio as it looks like an easier way to manage a workspace. I've downloaded the dll file from https://github.com/hning86/azuremlps and changed my config.json file, but get the error above if I try to run any AzureML commands. I've unblocked the DLL file and imported the AzureMLPS module, and I can see the module and commands I am trying to use have been imported by doing Get-Module and Get-Command

For info I've not used Powershell before.

Any suggestions much appreciated!


Solution

  • Have you installed Azure PowerShell Installer on your local machine? Click here for more info.

    Download the latest Azure PowerShell Installer (4.3.1), then install on your local machine. Then retry using Azure PowerShell module and commands.

    I installed mine last May, using Azure PowerShell 4.0.1, and the command Get-AmlWorkspace is working.

    # Set local folder location
    Set-Location -Path "C:\Insert here the location of AzureMLPS.dll"
    
    # Unblock and import Azure Powershell Module (leverages config.json file)
    Unblock-File .\AzureMLPS.dll
    Import-Module .\AzureMLPS.dll
    
    # Get Azure ML Workspace info
    Get-AmlWorkspace
    

    The output on my side looks like this: enter image description here