We recommend using Azure Native.
azure.streamanalytics.FunctionJavaScriptUDF
Explore with Pulumi AI
Manages a JavaScript UDF Function within Stream Analytics Streaming Job.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.core.getResourceGroup({
name: "example-resources",
});
const exampleGetJob = example.then(example => azure.streamanalytics.getJob({
name: "example-job",
resourceGroupName: example.name,
}));
const exampleFunctionJavaScriptUDF = new azure.streamanalytics.FunctionJavaScriptUDF("example", {
name: "example-javascript-function",
streamAnalyticsJobName: exampleGetJob.then(exampleGetJob => exampleGetJob.name),
resourceGroupName: exampleGetJob.then(exampleGetJob => exampleGetJob.resourceGroupName),
script: `function getRandomNumber(in) {
return in;
}
`,
inputs: [{
type: "bigint",
}],
output: {
type: "bigint",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.get_resource_group(name="example-resources")
example_get_job = azure.streamanalytics.get_job(name="example-job",
resource_group_name=example.name)
example_function_java_script_udf = azure.streamanalytics.FunctionJavaScriptUDF("example",
name="example-javascript-function",
stream_analytics_job_name=example_get_job.name,
resource_group_name=example_get_job.resource_group_name,
script="""function getRandomNumber(in) {
return in;
}
""",
inputs=[{
"type": "bigint",
}],
output={
"type": "bigint",
})
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/streamanalytics"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
Name: "example-resources",
}, nil)
if err != nil {
return err
}
exampleGetJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{
Name: "example-job",
ResourceGroupName: example.Name,
}, nil)
if err != nil {
return err
}
_, err = streamanalytics.NewFunctionJavaScriptUDF(ctx, "example", &streamanalytics.FunctionJavaScriptUDFArgs{
Name: pulumi.String("example-javascript-function"),
StreamAnalyticsJobName: pulumi.String(exampleGetJob.Name),
ResourceGroupName: pulumi.String(exampleGetJob.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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Core.GetResourceGroup.Invoke(new()
{
Name = "example-resources",
});
var exampleGetJob = Azure.StreamAnalytics.GetJob.Invoke(new()
{
Name = "example-job",
ResourceGroupName = example.Apply(getResourceGroupResult => getResourceGroupResult.Name),
});
var exampleFunctionJavaScriptUDF = new Azure.StreamAnalytics.FunctionJavaScriptUDF("example", new()
{
Name = "example-javascript-function",
StreamAnalyticsJobName = exampleGetJob.Apply(getJobResult => getJobResult.Name),
ResourceGroupName = exampleGetJob.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 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 example = CoreFunctions.getResourceGroup(GetResourceGroupArgs.builder()
.name("example-resources")
.build());
final var exampleGetJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
.name("example-job")
.resourceGroupName(example.applyValue(getResourceGroupResult -> getResourceGroupResult.name()))
.build());
var exampleFunctionJavaScriptUDF = new FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", FunctionJavaScriptUDFArgs.builder()
.name("example-javascript-function")
.streamAnalyticsJobName(exampleGetJob.applyValue(getJobResult -> getJobResult.name()))
.resourceGroupName(exampleGetJob.applyValue(getJobResult -> getJobResult.resourceGroupName()))
.script("""
function getRandomNumber(in) {
return in;
}
""")
.inputs(FunctionJavaScriptUDFInputArgs.builder()
.type("bigint")
.build())
.output(FunctionJavaScriptUDFOutputArgs.builder()
.type("bigint")
.build())
.build());
}
}
resources:
exampleFunctionJavaScriptUDF:
type: azure:streamanalytics:FunctionJavaScriptUDF
name: example
properties:
name: example-javascript-function
streamAnalyticsJobName: ${exampleGetJob.name}
resourceGroupName: ${exampleGetJob.resourceGroupName}
script: |
function getRandomNumber(in) {
return in;
}
inputs:
- type: bigint
output:
type: bigint
variables:
example:
fn::invoke:
Function: azure:core:getResourceGroup
Arguments:
name: example-resources
exampleGetJob:
fn::invoke:
Function: azure:streamanalytics:getJob
Arguments:
name: example-job
resourceGroupName: ${example.name}
Create FunctionJavaScriptUDF Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FunctionJavaScriptUDF(name: string, args: FunctionJavaScriptUDFArgs, opts?: CustomResourceOptions);
@overload
def FunctionJavaScriptUDF(resource_name: str,
args: FunctionJavaScriptUDFArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FunctionJavaScriptUDF(resource_name: str,
opts: Optional[ResourceOptions] = None,
inputs: Optional[Sequence[FunctionJavaScriptUDFInputArgs]] = None,
output: Optional[FunctionJavaScriptUDFOutputArgs] = None,
resource_group_name: Optional[str] = None,
script: Optional[str] = None,
stream_analytics_job_name: Optional[str] = None,
name: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var functionJavaScriptUDFResource = new Azure.StreamAnalytics.FunctionJavaScriptUDF("functionJavaScriptUDFResource", new()
{
Inputs = new[]
{
new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFInputArgs
{
Type = "string",
ConfigurationParameter = false,
},
},
Output = new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFOutputArgs
{
Type = "string",
},
ResourceGroupName = "string",
Script = "string",
StreamAnalyticsJobName = "string",
Name = "string",
});
example, err := streamanalytics.NewFunctionJavaScriptUDF(ctx, "functionJavaScriptUDFResource", &streamanalytics.FunctionJavaScriptUDFArgs{
Inputs: streamanalytics.FunctionJavaScriptUDFInputTypeArray{
&streamanalytics.FunctionJavaScriptUDFInputTypeArgs{
Type: pulumi.String("string"),
ConfigurationParameter: pulumi.Bool(false),
},
},
Output: &streamanalytics.FunctionJavaScriptUDFOutputTypeArgs{
Type: pulumi.String("string"),
},
ResourceGroupName: pulumi.String("string"),
Script: pulumi.String("string"),
StreamAnalyticsJobName: pulumi.String("string"),
Name: pulumi.String("string"),
})
var functionJavaScriptUDFResource = new FunctionJavaScriptUDF("functionJavaScriptUDFResource", FunctionJavaScriptUDFArgs.builder()
.inputs(FunctionJavaScriptUDFInputArgs.builder()
.type("string")
.configurationParameter(false)
.build())
.output(FunctionJavaScriptUDFOutputArgs.builder()
.type("string")
.build())
.resourceGroupName("string")
.script("string")
.streamAnalyticsJobName("string")
.name("string")
.build());
function_java_script_udf_resource = azure.streamanalytics.FunctionJavaScriptUDF("functionJavaScriptUDFResource",
inputs=[{
"type": "string",
"configuration_parameter": False,
}],
output={
"type": "string",
},
resource_group_name="string",
script="string",
stream_analytics_job_name="string",
name="string")
const functionJavaScriptUDFResource = new azure.streamanalytics.FunctionJavaScriptUDF("functionJavaScriptUDFResource", {
inputs: [{
type: "string",
configurationParameter: false,
}],
output: {
type: "string",
},
resourceGroupName: "string",
script: "string",
streamAnalyticsJobName: "string",
name: "string",
});
type: azure:streamanalytics:FunctionJavaScriptUDF
properties:
inputs:
- configurationParameter: false
type: string
name: string
output:
type: string
resourceGroupName: string
script: string
streamAnalyticsJobName: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FunctionJavaScriptUDF resource accepts the following input properties:
- Inputs
List<Function
Java Script UDFInput> - One or more
input
blocks as defined below. - Output
Function
Java Script UDFOutput - An
output
blocks as defined below. - Resource
Group stringName - 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.
- Stream
Analytics stringJob Name - 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
[]Function
Java Script UDFInput Type Args - One or more
input
blocks as defined below. - Output
Function
Java Script UDFOutput Type Args - An
output
blocks as defined below. - Resource
Group stringName - 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.
- Stream
Analytics stringJob Name - 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<Function
Java Script UDFInput> - One or more
input
blocks as defined below. - output
Function
Java Script UDFOutput - An
output
blocks as defined below. - resource
Group StringName - 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.
- stream
Analytics StringJob Name - 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
Function
Java Script UDFInput[] - One or more
input
blocks as defined below. - output
Function
Java Script UDFOutput - An
output
blocks as defined below. - resource
Group stringName - 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.
- stream
Analytics stringJob Name - 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[Function
Java Script UDFInput Args] - One or more
input
blocks as defined below. - output
Function
Java Script UDFOutput Args - An
output
blocks as defined below. - resource_
group_ strname - 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_ strjob_ name - 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. - resource
Group StringName - 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.
- stream
Analytics StringJob Name - 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.
- Inputs
List<Function
Java Script UDFInput> - 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
Function
Java Script UDFOutput - An
output
blocks as defined below. - Resource
Group stringName - 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.
- Stream
Analytics stringJob Name - The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.
- Inputs
[]Function
Java Script UDFInput Type Args - 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
Function
Java Script UDFOutput Type Args - An
output
blocks as defined below. - Resource
Group stringName - 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.
- Stream
Analytics stringJob Name - The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.
- inputs
List<Function
Java Script UDFInput> - 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
Function
Java Script UDFOutput - An
output
blocks as defined below. - resource
Group StringName - 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.
- stream
Analytics StringJob Name - The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.
- inputs
Function
Java Script UDFInput[] - 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
Function
Java Script UDFOutput - An
output
blocks as defined below. - resource
Group stringName - 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.
- stream
Analytics stringJob Name - The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.
- inputs
Sequence[Function
Java Script UDFInput Args] - 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
Function
Java Script UDFOutput Args - An
output
blocks as defined below. - resource_
group_ strname - 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_ strjob_ name - 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. - resource
Group StringName - 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.
- stream
Analytics StringJob Name - 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, FunctionJavaScriptUDFInputArgs
- Type string
- The Data Type for the Input Argument of this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
. - 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)
andrecord
. - 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)
andrecord
. - configuration
Parameter 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)
andrecord
. - configuration
Parameter 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)
andrecord
. - 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)
andrecord
. - configuration
Parameter Boolean - Is this input parameter a configuration parameter? Defaults to
false
.
FunctionJavaScriptUDFOutput, FunctionJavaScriptUDFOutputArgs
- Type string
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
- Type string
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
- type String
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
- type string
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
- type str
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
- type String
- The Data Type output from this JavaScript Function. Possible values include
array
,any
,bigint
,datetime
,float
,nvarchar(max)
andrecord
.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.