Azure ML Compute Instance creation fails to find setup script from blob storage URL
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
I’m trying to create Azure ML Compute Instances via an ARM template, specifying a setup script to run at creation time. I upload my setup.sh to the workspace’s blob storage and pass its SAS URL in the creationScript section of the ARM template as:
```
"creationScript": {
"scriptSource": "",
"scriptData": "setup.sh"
}
```
The deployment succeeds, but the VM fails to find the setup script at startup, showing:
_The specified Azure ML Compute Instance xyz user script setup failed with error: "User specified setup script file not found. Details - SetupScriptsError: User specified setup script file not found. : /mnt/batch/tasks/shared/LS_root/mounts/clusters/xyz/code/setup.sh"_
The blob storage allows anonymous access (or SAS), and I confirmed the URL works when accessed manually.
Any idea why scriptSource with a blob SAS URL does not work as expected? Am I missing a specific setting or required path structure?
EDIT: I also tried the alternative method (scriptSource: "workspaceStorage") and manually uploaded the file to the Notebooks file share through the portal — this worked fine. However, I’d prefer not to rely on manual upload because it seems there’s no supported way (as far as I can tell) to programmatically upload to the Notebooks file share. Is there a way to achieve this fully automatically, while keeping the setup script in blob storage?
### Related command
`az deployment group create --resource-group my-rg --template-file test_blob.json `
### Errors
The specified Azure ML Compute Instance xyz user script setup failed with error: "User specified setup script file not found. Details - SetupScriptsError: User specified setup script file not found. : /mnt/batch/tasks/shared/LS_root/mounts/clusters/xyz/code/setup.sh"
### Issue script & Debug output
cli.azure.cli.core.azclierror: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/3ed0250e-950e-4606-9efa-0c9c13b44586/resourceGroups/.../providers/Microsoft.Resources/deployments/test_blob","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/3ed0250e-950e-4606-9efa-0c9c13b44586/resourceGroups/.../providers/Microsoft.MachineLearningServices/workspaces/.../computes/...","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"BadRequest","message":"{\"id\":\"https://resourceprovider.batchai-canadacentral.svc/subscriptions/.../providers/Microsoft.BatchAI/locations/canadacentral/operationresults/...\",\"name\":\"...\",\"status\":\"Failed\",\"startTime\":\"2025-07-17T19:34:54.855Z\",\"endTime\":\"2025-07-17T19:41:23.758Z\",\"error\":{\"code\":\"SetupScriptsError\",\"message\":\"The specified Azure ML Compute Instance ... user script setup failed with error \\\"User specified setup script file not found. Details - SetupScriptsError:User specified setup script file not found. : /mnt/batch/tasks/shared/LS_root/mounts/clusters/.../code/setup.sh \\\". Please delete and try to recreate. If the problem persists, please follow up with Azure Support.\"}}"}]}]}}
az_command_data_logger: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/.../resourceGroups/.../providers/Microsoft.Resources/deployments/test_blob","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/.../resourceGroups/.../providers/Microsoft.MachineLearningServices/workspaces/.../computes/...","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"BadRequest","message":"{\"id\":\"https://resourceprovider.batchai-canadacentral.svc/subscriptions/.../providers/Microsoft.BatchAI/locations/canadacentral/operationresults/...\",\"name\":\"...\",\"status\":\"Failed\",\"startTime\":\"2025-07-17T19:34:54.855Z\",\"endTime\":\"2025-07-17T19:41:23.758Z\",\"error\":{\"code\":\"SetupScriptsError\",\"message\":\"The specified Azure ML Compute Instance ... user script setup failed with error \\\"User specified setup script file not found. Details - SetupScriptsError:User specified setup script file not found. : /mnt/batch/tasks/shared/LS_root/mounts/clusters/.../code/setup.sh \\\". Please delete and try to recreate. If the problem persists, please follow up with Azure Support.\"}}"}]}]}}
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 426.554 seconds (init: 0.218, invoke: 426.337)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 5726 in cache file under /Users/.../.azure/telemetry/20250717154156787
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.75.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.75.0/libexec/lib/python3.12/site-packages/azure/cli/telemetry/__init__.py /Users/.../.azure /Users/.../.azure/telemetry/20250717154156787"
telemetry.process: Return from creating process 97641
telemetry.main: Finish creating telemetry upload process.
### Expected behavior
I'm expecting the setup script will be found and executed at creation of the instance
### Environment Summary
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
ml 2.38.0
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/opt/homebrew/Cellar/azure-cli/2.75.0/libexec/bin/python'
Config directory '/Users/.../.azure'
Extensions directory '/Users/.../.azure/cliextensions'
Python (Darwin) 3.12.11 (main, Jun 3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.