mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
50 lines
2.0 KiB
TypeScript
50 lines
2.0 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* This sample demonstrates how to Retrieves the default definition of a function based on the parameters specified.
|
|
*
|
|
* @summary Retrieves the default definition of a function based on the parameters specified.
|
|
* x-ms-original-file: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_RetrieveDefaultDefinition_AzureML.json
|
|
*/
|
|
|
|
import type {
|
|
AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters,
|
|
FunctionsRetrieveDefaultDefinitionOptionalParams,
|
|
} from "@azure/arm-streamanalytics";
|
|
import { StreamAnalyticsManagementClient } from "@azure/arm-streamanalytics";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import "dotenv/config";
|
|
|
|
async function retrieveTheDefaultDefinitionForAnAzureMlFunction(): Promise<void> {
|
|
const subscriptionId =
|
|
process.env["STREAMANALYTICS_SUBSCRIPTION_ID"] || "56b5e0a9-b645-407d-99b0-c64f86013e3d";
|
|
const resourceGroupName = process.env["STREAMANALYTICS_RESOURCE_GROUP"] || "sjrg7";
|
|
const jobName = "sj9093";
|
|
const functionName = "function588";
|
|
const functionRetrieveDefaultDefinitionParameters: AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters =
|
|
{
|
|
bindingType: "Microsoft.MachineLearning/WebService",
|
|
executeEndpoint: "someAzureMLExecuteEndpointUrl",
|
|
udfType: "Scalar",
|
|
};
|
|
const options: FunctionsRetrieveDefaultDefinitionOptionalParams = {
|
|
functionRetrieveDefaultDefinitionParameters,
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new StreamAnalyticsManagementClient(credential, subscriptionId);
|
|
const result = await client.functions.retrieveDefaultDefinition(
|
|
resourceGroupName,
|
|
jobName,
|
|
functionName,
|
|
options,
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await retrieveTheDefaultDefinitionForAnAzureMlFunction();
|
|
}
|
|
|
|
main().catch(console.error);
|