Function Args
data class FunctionArgs(val functionName: Output<String>? = null, val jobName: Output<String>? = null, val name: Output<String>? = null, val properties: Output<ScalarFunctionPropertiesArgs>? = null, val resourceGroupName: Output<String>? = null) : ConvertibleToJava<FunctionArgs>
A function object, containing all information associated with the named function. All functions are contained under a streaming job. API Version: 2016-03-01.
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 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 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/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7/providers/Microsoft.StreamAnalytics/streamingjobs/sj9093/functions/function588
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(functionName: Output<String>? = null, jobName: Output<String>? = null, name: Output<String>? = null, properties: Output<ScalarFunctionPropertiesArgs>? = null, resourceGroupName: Output<String>? = null)