» azurerm_stream_analytics_function_javascript_udf

Manages a JavaScript UDF Function within Stream Analytics Streaming Job.

» Example Usage

data "azurerm_resource_group" "example" {
  name = "example-resources"
}

data "azurerm_stream_analytics_job" "example" {
  name                = "example-job"
  resource_group_name = "${azurerm_resource_group.example.name}"
}

resource "azurerm_stream_analytics_function_javascript_udf" "test" {
  name                      = "example-javascript-function"
  stream_analytics_job_name = "${data.azurerm_stream_analytics_job.example.name}"
  resource_group_name       = "${data.azurerm_stream_analytics_job.example.resource_group_name}"
  script = <<SCRIPT
function getRandomNumber(in) {
  return in;
}
SCRIPT

  input {
    type = "bigint"
  }

  output {
    type = "bigint"
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) The name of the JavaScript UDF Function. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

  • stream_analytics_job_name - (Required) The name of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.

  • input - (Required) One or more input blocks as defined below.

  • output - (Required) An output blocks as defined below.

  • script - (Required) The JavaScript of this UDF Function.


A input block supports the following:

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

A output block supports the following:

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

» Attributes Reference

The following attributes are exported in addition to the arguments listed above:

  • id - The ID of the Stream Analytics JavaScript UDF Function.

» Import

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

terraform import azurerm_stream_analytics_output_blob.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/group1/providers/Microsoft.StreamAnalytics/streamingjobs/job1/outputs/output1