Function
A function object, containing all information associated with the named function. All functions are contained under a streaming job. Azure REST API version: 2020-03-01. Prior API version in Azure Native 1.x: 2016-03-01. Other available API versions: 2016-03-01, 2021-10-01-preview.
Example Usage
Create a JavaScript function
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
    var function = new AzureNative.StreamAnalytics.Function("function", new()
    {
        FunctionName = "function8197",
        JobName = "sj8653",
        Properties = new AzureNative.StreamAnalytics.Inputs.ScalarFunctionPropertiesArgs
        {
            Binding = new AzureNative.StreamAnalytics.Inputs.JavaScriptFunctionBindingArgs
            {
                Script = "function (x, y) { return x + y; }",
                Type = "Microsoft.StreamAnalytics/JavascriptUdf",
            },
            Inputs = new[]
            {
                new AzureNative.StreamAnalytics.Inputs.FunctionInputArgs
                {
                    DataType = "Any",
                },
            },
            Output = new AzureNative.StreamAnalytics.Inputs.FunctionOutputArgs
            {
                DataType = "Any",
            },
            Type = "Scalar",
        },
        ResourceGroupName = "sjrg1637",
    });
});Content copied to clipboard
package main
import (
	"github.com/pulumi/pulumi-azure-native-sdk/streamanalytics/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := streamanalytics.NewFunction(ctx, "function", &streamanalytics.FunctionArgs{
			FunctionName: pulumi.String("function8197"),
			JobName:      pulumi.String("sj8653"),
			Properties: streamanalytics.ScalarFunctionProperties{
				Binding: streamanalytics.JavaScriptFunctionBinding{
					Script: "function (x, y) { return x + y; }",
					Type:   "Microsoft.StreamAnalytics/JavascriptUdf",
				},
				Inputs: []streamanalytics.FunctionInputType{
					{
						DataType: "Any",
					},
				},
				Output: streamanalytics.FunctionOutputType{
					DataType: "Any",
				},
				Type: "Scalar",
			},
			ResourceGroupName: pulumi.String("sjrg1637"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.streamanalytics.Function;
import com.pulumi.azurenative.streamanalytics.FunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var function = new Function("function", FunctionArgs.builder()
            .functionName("function8197")
            .jobName("sj8653")
            .properties(Map.ofEntries(
                Map.entry("binding", Map.ofEntries(
                    Map.entry("script", "function (x, y) { return x + y; }"),
                    Map.entry("type", "Microsoft.StreamAnalytics/JavascriptUdf")
                )),
                Map.entry("inputs", Map.of("dataType", "Any")),
                Map.entry("output", Map.of("dataType", "Any")),
                Map.entry("type", "Scalar")
            ))
            .resourceGroupName("sjrg1637")
            .build());
    }
}Content copied to clipboard
Create an Azure ML function
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
    var function = new AzureNative.StreamAnalytics.Function("function", new()
    {
        FunctionName = "function588",
        JobName = "sj9093",
        Properties = new AzureNative.StreamAnalytics.Inputs.ScalarFunctionPropertiesArgs
        {
            Binding = new AzureNative.StreamAnalytics.Inputs.AzureMachineLearningWebServiceFunctionBindingArgs
            {
                ApiKey = "someApiKey==",
                BatchSize = 1000,
                Endpoint = "someAzureMLEndpointURL",
                Inputs = new AzureNative.StreamAnalytics.Inputs.AzureMachineLearningWebServiceInputsArgs
                {
                    ColumnNames = new[]
                    {
                        new AzureNative.StreamAnalytics.Inputs.AzureMachineLearningWebServiceInputColumnArgs
                        {
                            DataType = "string",
                            MapTo = 0,
                            Name = "tweet",
                        },
                    },
                    Name = "input1",
                },
                Outputs = new[]
                {
                    new AzureNative.StreamAnalytics.Inputs.AzureMachineLearningWebServiceOutputColumnArgs
                    {
                        DataType = "string",
                        Name = "Sentiment",
                    },
                },
                Type = "Microsoft.MachineLearning/WebService",
            },
            Inputs = new[]
            {
                new AzureNative.StreamAnalytics.Inputs.FunctionInputArgs
                {
                    DataType = "nvarchar(max)",
                },
            },
            Output = new AzureNative.StreamAnalytics.Inputs.FunctionOutputArgs
            {
                DataType = "nvarchar(max)",
            },
            Type = "Scalar",
        },
        ResourceGroupName = "sjrg7",
    });
});Content copied to clipboard
package main
import (
	"github.com/pulumi/pulumi-azure-native-sdk/streamanalytics/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := streamanalytics.NewFunction(ctx, "function", &streamanalytics.FunctionArgs{
			FunctionName: pulumi.String("function588"),
			JobName:      pulumi.String("sj9093"),
			Properties: streamanalytics.ScalarFunctionProperties{
				Binding: streamanalytics.AzureMachineLearningWebServiceFunctionBinding{
					ApiKey:    "someApiKey==",
					BatchSize: 1000,
					Endpoint:  "someAzureMLEndpointURL",
					Inputs: streamanalytics.AzureMachineLearningWebServiceInputs{
						ColumnNames: []streamanalytics.AzureMachineLearningWebServiceInputColumn{
							{
								DataType: "string",
								MapTo:    0,
								Name:     "tweet",
							},
						},
						Name: "input1",
					},
					Outputs: []streamanalytics.AzureMachineLearningWebServiceOutputColumn{
						{
							DataType: "string",
							Name:     "Sentiment",
						},
					},
					Type: "Microsoft.MachineLearning/WebService",
				},
				Inputs: []streamanalytics.FunctionInputType{
					{
						DataType: "nvarchar(max)",
					},
				},
				Output: streamanalytics.FunctionOutputType{
					DataType: "nvarchar(max)",
				},
				Type: "Scalar",
			},
			ResourceGroupName: pulumi.String("sjrg7"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.streamanalytics.Function;
import com.pulumi.azurenative.streamanalytics.FunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var function = new Function("function", FunctionArgs.builder()
            .functionName("function588")
            .jobName("sj9093")
            .properties(Map.ofEntries(
                Map.entry("binding", Map.ofEntries(
                    Map.entry("apiKey", "someApiKey=="),
                    Map.entry("batchSize", 1000),
                    Map.entry("endpoint", "someAzureMLEndpointURL"),
                    Map.entry("inputs", Map.ofEntries(
                        Map.entry("columnNames", Map.ofEntries(
                            Map.entry("dataType", "string"),
                            Map.entry("mapTo", 0),
                            Map.entry("name", "tweet")
                        )),
                        Map.entry("name", "input1")
                    )),
                    Map.entry("outputs", Map.ofEntries(
                        Map.entry("dataType", "string"),
                        Map.entry("name", "Sentiment")
                    )),
                    Map.entry("type", "Microsoft.MachineLearning/WebService")
                )),
                Map.entry("inputs", Map.of("dataType", "nvarchar(max)")),
                Map.entry("output", Map.of("dataType", "nvarchar(max)")),
                Map.entry("type", "Scalar")
            ))
            .resourceGroupName("sjrg7")
            .build());
    }
}Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:streamanalytics:Function function588 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}Content copied to clipboard
Properties
Link copied to clipboard
                val properties: Output<Either<AggregateFunctionPropertiesResponse, ScalarFunctionPropertiesResponse>>