azure.streamanalytics.FunctionJavaScriptUDF

Manages a JavaScript UDF Function within Stream Analytics Streaming Job.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = Azure.Core.GetResourceGroup.Invoke(new()
    {
        Name = "example-resources",
    });

    var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new()
    {
        Name = "example-job",
        ResourceGroupName = exampleResourceGroup.Apply(getResourceGroupResult => getResourceGroupResult.Name),
    });

    var exampleFunctionJavaScriptUDF = new Azure.StreamAnalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", new()
    {
        StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name),
        ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName),
        Script = @"function getRandomNumber(in) {
  return in;
}
",
        Inputs = new[]
        {
            new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFInputArgs
            {
                Type = "bigint",
            },
        },
        Output = new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFOutputArgs
        {
            Type = "bigint",
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
			Name: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		exampleJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{
			Name:              "example-job",
			ResourceGroupName: exampleResourceGroup.Name,
		}, nil)
		if err != nil {
			return err
		}
		_, err = streamanalytics.NewFunctionJavaScriptUDF(ctx, "exampleFunctionJavaScriptUDF", &streamanalytics.FunctionJavaScriptUDFArgs{
			StreamAnalyticsJobName: *pulumi.String(exampleJob.Name),
			ResourceGroupName:      *pulumi.String(exampleJob.ResourceGroupName),
			Script:                 pulumi.String("function getRandomNumber(in) {\n  return in;\n}\n"),
			Inputs: streamanalytics.FunctionJavaScriptUDFInputTypeArray{
				&streamanalytics.FunctionJavaScriptUDFInputTypeArgs{
					Type: pulumi.String("bigint"),
				},
			},
			Output: &streamanalytics.FunctionJavaScriptUDFOutputTypeArgs{
				Type: pulumi.String("bigint"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.inputs.GetResourceGroupArgs;
import com.pulumi.azure.streamanalytics.StreamanalyticsFunctions;
import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
import com.pulumi.azure.streamanalytics.FunctionJavaScriptUDF;
import com.pulumi.azure.streamanalytics.FunctionJavaScriptUDFArgs;
import com.pulumi.azure.streamanalytics.inputs.FunctionJavaScriptUDFInputArgs;
import com.pulumi.azure.streamanalytics.inputs.FunctionJavaScriptUDFOutputArgs;
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) {
        final var exampleResourceGroup = CoreFunctions.getResourceGroup(GetResourceGroupArgs.builder()
            .name("example-resources")
            .build());

        final var exampleJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
            .name("example-job")
            .resourceGroupName(exampleResourceGroup.applyValue(getResourceGroupResult -> getResourceGroupResult.name()))
            .build());

        var exampleFunctionJavaScriptUDF = new FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", FunctionJavaScriptUDFArgs.builder()        
            .streamAnalyticsJobName(exampleJob.applyValue(getJobResult -> getJobResult.name()))
            .resourceGroupName(exampleJob.applyValue(getJobResult -> getJobResult.resourceGroupName()))
            .script("""
function getRandomNumber(in) {
  return in;
}
            """)
            .inputs(FunctionJavaScriptUDFInputArgs.builder()
                .type("bigint")
                .build())
            .output(FunctionJavaScriptUDFOutputArgs.builder()
                .type("bigint")
                .build())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.get_resource_group(name="example-resources")
example_job = azure.streamanalytics.get_job(name="example-job",
    resource_group_name=example_resource_group.name)
example_function_java_script_udf = azure.streamanalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF",
    stream_analytics_job_name=example_job.name,
    resource_group_name=example_job.resource_group_name,
    script="""function getRandomNumber(in) {
  return in;
}
""",
    inputs=[azure.streamanalytics.FunctionJavaScriptUDFInputArgs(
        type="bigint",
    )],
    output=azure.streamanalytics.FunctionJavaScriptUDFOutputArgs(
        type="bigint",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = azure.core.getResourceGroup({
    name: "example-resources",
});
const exampleJob = exampleResourceGroup.then(exampleResourceGroup => azure.streamanalytics.getJob({
    name: "example-job",
    resourceGroupName: exampleResourceGroup.name,
}));
const exampleFunctionJavaScriptUDF = new azure.streamanalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", {
    streamAnalyticsJobName: exampleJob.then(exampleJob => exampleJob.name),
    resourceGroupName: exampleJob.then(exampleJob => exampleJob.resourceGroupName),
    script: `function getRandomNumber(in) {
  return in;
}
`,
    inputs: [{
        type: "bigint",
    }],
    output: {
        type: "bigint",
    },
});
resources:
  exampleFunctionJavaScriptUDF:
    type: azure:streamanalytics:FunctionJavaScriptUDF
    properties:
      streamAnalyticsJobName: ${exampleJob.name}
      resourceGroupName: ${exampleJob.resourceGroupName}
      script: |
        function getRandomNumber(in) {
          return in;
        }        
      inputs:
        - type: bigint
      output:
        type: bigint
variables:
  exampleResourceGroup:
    fn::invoke:
      Function: azure:core:getResourceGroup
      Arguments:
        name: example-resources
  exampleJob:
    fn::invoke:
      Function: azure:streamanalytics:getJob
      Arguments:
        name: example-job
        resourceGroupName: ${exampleResourceGroup.name}

Create FunctionJavaScriptUDF Resource

new FunctionJavaScriptUDF(name: string, args: FunctionJavaScriptUDFArgs, opts?: CustomResourceOptions);
@overload
def FunctionJavaScriptUDF(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          inputs: Optional[Sequence[FunctionJavaScriptUDFInputArgs]] = None,
                          name: Optional[str] = None,
                          output: Optional[FunctionJavaScriptUDFOutputArgs] = None,
                          resource_group_name: Optional[str] = None,
                          script: Optional[str] = None,
                          stream_analytics_job_name: Optional[str] = None)
@overload
def FunctionJavaScriptUDF(resource_name: str,
                          args: FunctionJavaScriptUDFArgs,
                          opts: Optional[ResourceOptions] = None)
func NewFunctionJavaScriptUDF(ctx *Context, name string, args FunctionJavaScriptUDFArgs, opts ...ResourceOption) (*FunctionJavaScriptUDF, error)
public FunctionJavaScriptUDF(string name, FunctionJavaScriptUDFArgs args, CustomResourceOptions? opts = null)
public FunctionJavaScriptUDF(String name, FunctionJavaScriptUDFArgs args)
public FunctionJavaScriptUDF(String name, FunctionJavaScriptUDFArgs args, CustomResourceOptions options)
type: azure:streamanalytics:FunctionJavaScriptUDF
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FunctionJavaScriptUDFArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args FunctionJavaScriptUDFArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FunctionJavaScriptUDFArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FunctionJavaScriptUDFArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FunctionJavaScriptUDFArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

FunctionJavaScriptUDF Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The FunctionJavaScriptUDF resource accepts the following input properties:

Inputs List<FunctionJavaScriptUDFInputArgs>

One or more input blocks as defined below.

Output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Script string

The JavaScript of this UDF Function.

StreamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

Name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

Inputs []FunctionJavaScriptUDFInputTypeArgs

One or more input blocks as defined below.

Output FunctionJavaScriptUDFOutputTypeArgs

An output blocks as defined below.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Script string

The JavaScript of this UDF Function.

StreamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

Name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

inputs List<FunctionJavaScriptUDFInputArgs>

One or more input blocks as defined below.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resourceGroupName String

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script String

The JavaScript of this UDF Function.

streamAnalyticsJobName String

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

name String

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

inputs FunctionJavaScriptUDFInputArgs[]

One or more input blocks as defined below.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script string

The JavaScript of this UDF Function.

streamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

inputs Sequence[FunctionJavaScriptUDFInputArgs]

One or more input blocks as defined below.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resource_group_name str

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script str

The JavaScript of this UDF Function.

stream_analytics_job_name str

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

name str

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

inputs List<Property Map>

One or more input blocks as defined below.

output Property Map

An output blocks as defined below.

resourceGroupName String

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script String

The JavaScript of this UDF Function.

streamAnalyticsJobName String

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

name String

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the FunctionJavaScriptUDF resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing FunctionJavaScriptUDF Resource

Get an existing FunctionJavaScriptUDF resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: FunctionJavaScriptUDFState, opts?: CustomResourceOptions): FunctionJavaScriptUDF
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        inputs: Optional[Sequence[FunctionJavaScriptUDFInputArgs]] = None,
        name: Optional[str] = None,
        output: Optional[FunctionJavaScriptUDFOutputArgs] = None,
        resource_group_name: Optional[str] = None,
        script: Optional[str] = None,
        stream_analytics_job_name: Optional[str] = None) -> FunctionJavaScriptUDF
func GetFunctionJavaScriptUDF(ctx *Context, name string, id IDInput, state *FunctionJavaScriptUDFState, opts ...ResourceOption) (*FunctionJavaScriptUDF, error)
public static FunctionJavaScriptUDF Get(string name, Input<string> id, FunctionJavaScriptUDFState? state, CustomResourceOptions? opts = null)
public static FunctionJavaScriptUDF get(String name, Output<String> id, FunctionJavaScriptUDFState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Inputs List<FunctionJavaScriptUDFInputArgs>

One or more input blocks as defined below.

Name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

Output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Script string

The JavaScript of this UDF Function.

StreamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

Inputs []FunctionJavaScriptUDFInputTypeArgs

One or more input blocks as defined below.

Name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

Output FunctionJavaScriptUDFOutputTypeArgs

An output blocks as defined below.

ResourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

Script string

The JavaScript of this UDF Function.

StreamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

inputs List<FunctionJavaScriptUDFInputArgs>

One or more input blocks as defined below.

name String

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resourceGroupName String

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script String

The JavaScript of this UDF Function.

streamAnalyticsJobName String

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

inputs FunctionJavaScriptUDFInputArgs[]

One or more input blocks as defined below.

name string

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resourceGroupName string

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script string

The JavaScript of this UDF Function.

streamAnalyticsJobName string

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

inputs Sequence[FunctionJavaScriptUDFInputArgs]

One or more input blocks as defined below.

name str

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

output FunctionJavaScriptUDFOutputArgs

An output blocks as defined below.

resource_group_name str

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script str

The JavaScript of this UDF Function.

stream_analytics_job_name str

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

inputs List<Property Map>

One or more input blocks as defined below.

name String

The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

output Property Map

An output blocks as defined below.

resourceGroupName String

The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

script String

The JavaScript of this UDF Function.

streamAnalyticsJobName String

The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

Supporting Types

FunctionJavaScriptUDFInput

Type string

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

ConfigurationParameter bool

Is this input parameter a configuration parameter? Defaults to false.

Type string

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

ConfigurationParameter bool

Is this input parameter a configuration parameter? Defaults to false.

type String

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

configurationParameter Boolean

Is this input parameter a configuration parameter? Defaults to false.

type string

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

configurationParameter boolean

Is this input parameter a configuration parameter? Defaults to false.

type str

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

configuration_parameter bool

Is this input parameter a configuration parameter? Defaults to false.

type String

The Data Type for the Input Argument of this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

configurationParameter Boolean

Is this input parameter a configuration parameter? Defaults to false.

FunctionJavaScriptUDFOutput

Type string

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

Type string

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

type String

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

type string

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

type str

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

type String

The Data Type output from this JavaScript Function. Possible values include array, any, bigint, datetime, float, nvarchar(max) and record.

Import

Stream Analytics JavaScript UDF Functions can be imported using the resource id, e.g.

 $ pulumi import azure:streamanalytics/functionJavaScriptUDF:FunctionJavaScriptUDF example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/functions/func1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.