Search code examples
azureazure-devopsazure-cliazure-machine-learning-serviceazure-ml-pipelines

Azure ML: Unable to find workspace


I would need help with an error message I get. I'm using BICEP to create an ML Workspace.

I have this task:

  - task: AzureCLI@2
    displayName: Create Workspace
    inputs:
      azureSubscription: $(azureServiceConnection)
      scriptType: 'bash'
      scriptLocation: 'inlineScript'
      inlineScript: |
        az extension add -n ml -y
        echo "RUNNING: az ml workspace create"
        az ml workspace create --name $(workspaceName) --location $(location) --resource-group $(resourceGroupName)

I have these logs:

RUNNING: az ml workspace create
The deployment request ***-1346692 was accepted. ARM deployment URI for reference: 
https://portal.azure.com//#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F***%2FresourceGroups%2F***%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2F***
Creating Key Vault: (***951dec81  ) ..  Done (18s)
Creating Storage Account: (***52ffb00  )   Done (20s)
Creating Log Analytics Workspace: (***0e912b31  )  Done (16s)
ERROR: Code: UserError
Message: Unable to find workspace: /subscriptions/***/resourcegroups/***/providers/Microsoft.MachineLearningServices/workspaces/***

I don't understand the error, I ask to create all required resources and the workspace and it says it doesn't find the workspace !!

Thanks


Solution

  • Based on your task definition, you are using the Azure CLI task to run the az ml workspace create to create the Azure ML workspace in Azure Pipeline.

    I can reproduce the same issue.

    enter image description here

    The cause of the issue is that the Azure ML workspace with the same name is in soft-delete state.

    In this case, you are not able to create the Azure ML workspace with the same name.

    To solve this issue, you need to navigate to Azure Portal -> Azure Machine Learning -> Recently deleted resources -> Select region and then you can hard delete the Azure ML resource.

    For example:

    enter image description here

    Then you can re-run the Azure CLI to create the new Azure ML Workspace.

    For more detailed info, you can refer to this doc: Manage soft deleted workspaces