Files
azure-sdk-for-js/sdk/machinelearning/arm-machinelearning/samples/v4-beta/javascript/registryModelVersionsCreateOrGetStartPendingUploadSample.js
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

32 lines
1.2 KiB
JavaScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureMachineLearningServicesManagementClient } = require("@azure/arm-machinelearning");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to generate a storage location and credential for the client to upload a model asset to.
*
* @summary generate a storage location and credential for the client to upload a model asset to.
* x-ms-original-file: 2026-03-15-preview/Registry/ModelVersion/createOrGetStartPendingUpload.json
*/
async function createOrGetStartPendingUploadRegistryModelVersion() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new AzureMachineLearningServicesManagementClient(credential, subscriptionId);
const result = await client.registryModelVersions.createOrGetStartPendingUpload(
"test-rg",
"registryName",
"string",
"string",
{ pendingUploadId: "string", pendingUploadType: "TemporaryBlobReference" },
);
console.log(result);
}
async function main() {
await createOrGetStartPendingUploadRegistryModelVersion();
}
main().catch(console.error);