Azure Stream Analytics Job
This page shows how to write Terraform and Azure Resource Manager for Stream Analytics Job and write them securely.
azurerm_stream_analytics_job (Terraform)
The Job in Stream Analytics can be configured in Terraform with the resource name azurerm_stream_analytics_job
. The following sections describe 9 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_stream_analytics_job" "foo" {
name = "asa-job-foo"
provider = azurerm-forked
resource_group_name = var.resource_group_name
location = var.location
compatibility_level = "1.2"
resource "azurerm_stream_analytics_job" "streamanalytics" {
name = var.name
resource_group_name = var.resource_group_name
location = var.location
compatibility_level = var.compatibility_level
streaming_units = var.streaming_units
resource "azurerm_stream_analytics_job" "asa" {
name = "__asa_name__"
resource_group_name = "__rg_name__"
location = "__rg_location__"
compatibility_level = "1.1"
data_locale = "en-GB"
resource "azurerm_stream_analytics_job" "this" {
compatibility_level = var.compatibility_level
data_locale = var.data_locale
events_late_arrival_max_delay_in_seconds = var.events_late_arrival_max_delay_in_seconds
events_out_of_order_max_delay_in_seconds = var.events_out_of_order_max_delay_in_seconds
events_out_of_order_policy = var.events_out_of_order_policy
resource "azurerm_stream_analytics_job" "this" {
compatibility_level = var.compatibility_level
data_locale = var.data_locale
events_late_arrival_max_delay_in_seconds = var.events_late_arrival_max_delay_in_seconds
events_out_of_order_max_delay_in_seconds = var.events_out_of_order_max_delay_in_seconds
events_out_of_order_policy = var.events_out_of_order_policy
resource "azurerm_stream_analytics_job" "asajob" {
name = "_asa_name_"
resource_group_name = "_resource_group_name_"
location = "_resource_group_location_"
compatibility_level = "1.1"
data_locale = "en-GB"
resource "azurerm_stream_analytics_job" "example" {
name = "example-job"
resource_group_name = azurerm_resource_group.this.name
location = "Australia Southeast"
compatibility_level = "1.1"
data_locale = "en-GB"
resource "azurerm_stream_analytics_job" "job" {
name = var.stream_job_name
resource_group_name = var.resource_group_name
location = var.location
compatibility_level = var.stream_compatibility_level
data_locale = var.stream_data_locale
resource "azurerm_stream_analytics_job" "saj" {
name = "tfexamplesajdev01"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
compatibility_level = "1.1"
data_locale = "en-GB"
Parameters
-
compatibility_level
optional computed - string -
data_locale
optional computed - string -
events_late_arrival_max_delay_in_seconds
optional - number -
events_out_of_order_max_delay_in_seconds
optional - number -
events_out_of_order_policy
optional - string -
id
optional computed - string -
job_id
optional computed - string -
location
required - string -
name
required - string -
output_error_policy
optional - string -
resource_group_name
required - string -
streaming_units
required - number -
tags
optional - map from string to string -
transformation_query
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages a Stream Analytics Job.
Microsoft.StreamAnalytics/streamingjobs (Azure Resource Manager)
The streamingjobs in Microsoft.StreamAnalytics can be configured in Azure Resource Manager with the resource name Microsoft.StreamAnalytics/streamingjobs
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringidentity
optionalprincipalId
optional - stringThe identity principal ID
tenantId
optional - stringThe identity tenantId
type
optional - stringThe identity type
location
optional - stringThe geo-location where the resource lives
name
required - stringThe name of the streaming job.
properties
requiredcluster
optionalid
optional - stringThe resource id of cluster.
compatibilityLevel
optional - stringControls certain runtime behaviors of the streaming job.
contentStoragePolicy
optional - stringValid values are JobStorageAccount and SystemAccount. If set to JobStorageAccount, this requires the user to also specify jobStorageAccount property.
dataLocale
optional - stringThe data locale of the stream analytics job. Value should be the name of a supported .NET Culture from the set https://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.110).aspx. Defaults to 'en-US' if none specified.
eventsLateArrivalMaxDelayInSeconds
optional - integerThe maximum tolerable delay in seconds where events arriving late could be included. Supported range is -1 to 1814399 (20.23:59:59 days) and -1 is used to specify wait indefinitely. If the property is absent, it is interpreted to have a value of -1.
eventsOutOfOrderMaxDelayInSeconds
optional - integerThe maximum tolerable delay in seconds where out-of-order events can be adjusted to be back in order.
eventsOutOfOrderPolicy
optional - stringIndicates the policy to apply to events that arrive out of order in the input event stream.
functions
optional arrayname
optional - stringResource name
properties
optional
inputs
optional arrayname
optional - stringResource name
properties
optionalcompression
optionaltype
required - stringIndicates the type of compression that the input uses. Required on PUT (CreateOrReplace) requests.
partitionKey
optional - stringpartitionKey Describes a key in the input data which is used for partitioning the input data
serialization
optional
jobStorageAccount
optionalaccountKey
optional - stringThe account key for the Azure Storage account. Required on PUT (CreateOrReplace) requests.
accountName
optional - stringThe name of the Azure Storage account. Required on PUT (CreateOrReplace) requests.
authenticationMode
optional - stringAuthentication Mode.
jobType
optional - stringDescribes the type of the job. Valid modes are
Cloud
and 'Edge'.outputErrorPolicy
optional - stringIndicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size).
outputs
optional arrayname
optional - stringResource name
properties
optionaldatasource
optionalserialization
optionalsizeWindow
optional - numberThe size window to constrain a Stream Analytics output to.
timeWindow
optional - stringThe time frame for filtering Stream Analytics job outputs.
outputStartMode
optional - stringThis property should only be utilized when it is desired that the job be started immediately upon creation. Value may be JobStartTime, CustomTime, or LastOutputEventTime to indicate whether the starting point of the output event stream should start whenever the job is started, start at a custom user time stamp specified via the outputStartTime property, or start from the last event output time.
outputStartTime
optional - stringValue is either an ISO-8601 formatted time stamp that indicates the starting point of the output event stream, or null to indicate that the output event stream will start whenever the streaming job is started. This property must have a value if outputStartMode is set to CustomTime.
sku
optionalname
optional - stringThe name of the SKU. Required on PUT (CreateOrReplace) requests.
transformation
optionalname
optional - stringResource name
properties
optionalquery
optional - stringSpecifies the query that will be run in the streaming job. You can learn more about the Stream Analytics Query Language (SAQL) here: https://msdn.microsoft.com/library/azure/dn834998 . Required on PUT (CreateOrReplace) requests.
streamingUnits
optional - integerSpecifies the number of streaming units that the streaming job uses.
validStreamingUnits
optional - arraySpecifies the valid streaming units a streaming job can scale to.
tags
optional - stringResource tags.
type
required - string
Frequently asked questions
What is Azure Stream Analytics Job?
Azure Stream Analytics Job is a resource for Stream Analytics of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Stream Analytics Job?
For Terraform, the jakewan/test-azurerm-provider-fork, AnikG-Org/devops-practice and jortegam22/TFM_Juan_Carlos source code examples are useful. See the Terraform Example section for further details.