When deploying Azure Marketplace subscriptions, you might encounter an error indicating that "another operation with ID [id] is already running" despite having no active operations visible in the Azure ML workspace or CLI outputs.
This occurs because Azure uses an asynchronous two-phase commit system for deployments, where operation IDs persist independently of actual resource existence.
Even though the Model Catalog in Azure ML shows successful creation, backend state tracking continues until all deployment phases complete, causing Terraform to detect these pending states.
The solution involves waiting for 15 minutes to allow cleanup, force-deleting existing subscriptions, verifying complete resource removal, and retrying deployment with Terraforms refresh-only mode.
This behavior is particularly common with Marketplace subscriptions due to their complex deployment lifecycle, where portal UI updates faster than backend state resolution, creating temporary mismatches between visible and actual states.
# Wait for 15 minutes to allow cleanup
sleep 900
#Force Deletion the Existing Subscription
az ml marketplace-subscription delete \
--name YOUR_SUBSCRIPTION_NAME \
--workspace-name YOUR_WORKSPACE \
--resource-group YOUR_RG \
--yes
#Verify Complete Cleanup
# Check subscription status
az ml marketplace-subscription list \
--workspace-name YOUR_WORKSPACE \
--resource-group YOUR_RG
# Verify resource group operations
az resource-group operation list \
--resource-group YOUR_RG \
--query "[?targetResource.resourceName=='YOUR_WORKSPACE']"
# Retry Deployment
terraform apply -refresh-only
If the issue still persists, Please follow below Troubleshooting steps
# Check Resource provider Status
az provider show -n Microsoft.MachineLearningServices
# Verify Role Assignments
az role assignment list \
--assignee YOUR_PRINCIPAL_ID \
--resource-group YOUR_RG
# Monitor Active log
az monitor activity-log list \
--filter "resourceGroupName eq 'YOUR_RG'" \
--query "[?operationName.value contains 'MarketplaceSubscription']"
Hope this helps!
Thank you!