-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting environment variables with computes@2024-10-01-preview does not work #798
Comments
Hi @martinmaehlmann , Thank you for taking time to report this issue. I did some tests on the Portal and found it's necessary to call another API to set the custom services. resource "azapi_resource" "compute" {
type = "Microsoft.MachineLearningServices/workspaces/computes@2024-10-01"
parent_id = azapi_resource.workspace.id
name = var.resource_name
location = var.location
body = {
properties = {
computeLocation = "westeurope"
computeType = "ComputeInstance"
description = ""
disableLocalAuth = true
properties = {
vmSize = "STANDARD_D2_V2"
}
}
}
}
resource "azapi_resource_action" "customServices" {
type = "Microsoft.MachineLearningServices/workspaces/computes@2024-10-01"
resource_id = azapi_resource.compute.id
action = "customServices"
body = [
{
type = "docker",
name = "custom-application",
image = {
type = "docker",
reference = "docker.io/nginx:1.27.4"
}
environmentVariables = {
key1 = {
type = "local",
value = "value1"
}
key2 = {
type = "local",
value = "value2"
}
}
docker = {
privileged = true
}
endpoints = [
{
protocol = "http"
name = "connect"
target = 2200
published = 2200
hostIp = null
}
]
}
]
}
If you have any questions about the API, please open an Azure Support Ticket for better assistance. |
Hi, I tried your example and ran in another issue:
The user I use to create the compute instance is a service principal, the user owning the compute instance is somebody else (me, a colleague). Is there any way to enable the service principal to edit compute instances that it does not own? I will also query the microsoft customer support for further assistance. |
I'm not sure. And yes, please check with Microsoft Customer Support, and see if there's any role assignment that allows another user to edit it. |
I am trying to set environment variables for a compute instance in an azure ai ml workspace using the following terraform code. I did not find any examples online nor did my research of microsoft help pages get me any further. Granting that the documentation for CustomServiceEnviromentVariables in azapi is empty it may be a missing implementation?
Documentation I checked:
• https://learn.microsoft.com/en-us/azure/templates/microsoft.machinelearningservices/workspaces/computes?pivots=deployment-language-terraform
• https://learn.microsoft.com/en-us/azure/templates/microsoft.machinelearningservices/workspaces/computes?pivots=deployment-language-terraform#computeinstance-2
• https://learn.microsoft.com/en-us/azure/templates/microsoft.machinelearningservices/workspaces/computes?pivots=deployment-language-terraform#customserviceenvironmentvariables-2
• https://learn.microsoft.com/en-us/rest/api/azureml/compute/create-or-update?view=rest-azureml-2024-10-01&tabs=HTTP#environmentvariable
• https://learn.microsoft.com/en-us/rest/api/azureml/compute/create-or-update?view=rest-azureml-2024-10-01&tabs=HTTP#environmentvariabletype
My terraform code:
The output of terraform plan (cut off after the environment variables):
Output from terraform apply:
The text was updated successfully, but these errors were encountered: