Skip to content

Instantly share code, notes, and snippets.

@csiebler
Created July 19, 2021 10:41
Show Gist options
  • Save csiebler/208b6bef05516404bd5b44f07e156bf8 to your computer and use it in GitHub Desktop.
Save csiebler/208b6bef05516404bd5b44f07e156bf8 to your computer and use it in GitHub Desktop.
Enforce an init script for Azure Machine Learning Compute Instance via Azure Policy
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.MachineLearningServices/workspaces/computes"
},
{
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType",
"in": [
"ComputeInstance"
]
}
]
},
"then": {
"effect": "append",
"details": [{
"field": "Microsoft.MachineLearningServices/workspaces/computes/setupScripts.scripts.creationScript.scriptSource",
"value": "inline"
},
{
"field": "Microsoft.MachineLearningServices/workspaces/computes/setupScripts.scripts.creationScript.scriptData",
"value": "IyEvYmluL2Jhc2gKCmVjaG8gIkhlbGxvIFdvcmxkIg=="
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment