Trouble creating private azure machine learning workspace and compute instance

Hello, I’ve been building a terraform module to create a private azure ML workspace, to do so I protected all the involved resources (storage account, key vault, container registry, ml workspace itself) with a private endpoint.

According to the documentation, “When you use a private link, your workspace cannot use Azure Container Registry tasks compute for image building. Instead, the workspace defaults to using a serverless compute cluster to build images. This works only when the workspace-deependent resources such as the storage account and container registry are not under any network restrictions (private endpoint). If your workspace dependencies are under network restrictions, use the image_build_compute property to specify a compute cluster to use for image building”.

The problem here is that, because of the constraint linked above, I need to perform these two operations at the same time:

  • create an ML workspace and set its image_build_compute_name property to a compute instance name.
  • create a compute instance for the ml workspace.

When trying to do so, I end up getting a cycle error because the two resources (compute instance and ml workspace) are dependant from each other. The only workaround I’ve found so far is to run terraform apply twice, but this is cannot be done because of how our pipeline works.
The ideal solution would be to keep using serverless compute to build images, but if i understand correctly this is not possible according to the documentation i linked before, correct me if I’m wrong?