Share via

Microsoft.MachineLearningServices/workspaces/data/versions@2023-04-01

Aram Yako 0 Reputation points
2023-09-12T21:09:02.67+00:00

Issue with Creating Data Asset Version using Bicep

Hello,

I am reaching out to highlight an issue I've encountered when trying to create a data asset version using Bicep.

On the initial attempt, the creation process works seamlessly. However, subsequent attempts result in the following error:

A data version with this name and version already exists. If you are aiming to establish a new data version, please utilize a distinct name or version. For updates to an existing data version, it is worth noting that the asset's data URI cannot be altered. Only attributes such as tags, description, and isArchived can be updated. (Code: UserError)

It's important to emphasize that I haven't made any modifications to the version in question. Here's the current code snippet for reference:


resource dataAssetVersion 'Microsoft.MachineLearningServices/workspaces/data/versions@2023-04-01' = {
  parent: data
  name: dataAssetversion
  properties: {
    dataType: 'uri_folder'
    isAnonymous: false
    dataUri: 'azureml://datastores/${datastore.name}/paths/csv'
    description: 'random description'
    isArchived: false
  }
}

Azure Machine Learning
Developer technologies | ASP.NET Core | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 42,941 Reputation points MVP Volunteer Moderator
    2023-09-13T12:06:36.57+00:00

    The error message you've provided is clear: if a data version with the same name and version already exists, you can't create a new one with identical details. Furthermore, the asset's data URI cannot be altered once it's been set; only other properties like tags, description, and isArchived can be updated.

    Your issue may be related to the following :

    1. Name Collision: Even if you think you haven't made modifications to the version in question, there might be another data asset version in the workspace with the same name or version.
    2. Updating Existing Resources: If you're using Bicep for infrastructure-as-code deployments, the behavior might be different when creating new resources vs updating existing ones. With Azure Resource Manager templates, for instance, you'd set the deployment mode to "incremental" to update existing resources, or "complete" to delete and recreate resources.

    I am assuming the following :

    1. Unique Name/Version: Always ensure that each deployment has a unique name or version for the data asset. If you're automating this, consider appending a timestamp or a unique identifier.
    2. Check Existing Resources: Before deploying, inspect your Azure Machine Learning workspace to ensure that there's no existing data asset version with the same name/version. This will prevent conflicts.
    3. Adjust Deployment Strategy: If you're sure that you have a unique name/version and still encounter the issue, try changing your deployment strategy. If you're using Azure Resource Manager templates, look into the deployment mode (i.e., "incremental" vs "complete").
    4. Data URI: Given the error message, if you need to modify the dataUri, it might be simpler to create a completely new data asset version rather than updating the existing one.

    If you've tried the above steps and still encounter issues, consider reaching out to Microsoft support or the Azure Machine Learning community for more specific assistance.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.