Files
e1b671e43d [AutoPR @azure-arm-machinelearning]-generated-from-SDK Generation - JS-6492167 (#38998)
Configurations:
'specification/machinelearningservices/MachineLearningServices.Management/tspconfig.yaml',
API Version: 2026-03-15-preview, SDK Release Type: beta, and CommitSHA:
'dfef10d031a60f8e2fcf36e99364c144e9661036' in SpecRepo:
'https://github.com/Azure/azure-rest-api-specs' Pipeline run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6492167
Refer to
https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites
to prepare for SDK release.

---------

Co-authored-by: Jiao Di (MSFT) <[email protected]>
Co-authored-by: Jiao Di (MSFT) <[email protected]>
2026-06-29 12:59:37 +08:00

40 lines
1.5 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureMachineLearningServicesManagementClient } from "@azure/arm-machinelearning";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to updates the custom services list. The list of custom services provided shall be overwritten.
*
* @summary updates the custom services list. The list of custom services provided shall be overwritten.
* x-ms-original-file: 2026-03-15-preview/Compute/updateCustomServices.json
*/
async function updateCustomServices(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
await client.computeOperations.updateCustomServices("testrg123", "workspaces123", "compute123", [
{
name: "rstudio-workbench",
docker: { privileged: true },
endpoints: [
{ name: "connect", hostIp: undefined, published: 4444, target: 8787, protocol: "http" },
],
environmentVariables: {
RSP_LICENSE: { type: "local", value: "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX" },
},
image: { type: "docker", reference: "ghcr.io/azure/rstudio-workbench:latest" },
volumes: [
{ type: "bind", readOnly: true, source: "/mnt/azureuser/", target: "/home/testuser/" },
],
},
]);
}
async function main(): Promise<void> {
await updateCustomServices();
}
main().catch(console.error);