New-​Azure​Rm​Stream​Analytics​Function

Creates or replaces a function in a Stream Analytics job.

Syntax

New-AzureRmStreamAnalyticsFunction
   [-ResourceGroupName] <String>
   [-JobName] <String>
   [[-Name] <String>]
   [-File] <String>
   [-Force]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-AzureRmStreamAnalyticsFunction cmdlet creates a function in an Azure Stream Analytics job or replaces an existing function. Define the function in a JavaScript Object Notation (JSON) file.

You can specify the name of the function by using the Name parameter or in the .json file. If you specify the name in both ways, the names must match.

To replace an existing function, specify the name of the existing function.

Examples

Example 1: Create a Stream Analytics function

PS C:\>New-AzureRmStreamAnalyticsFunction -ResourceGroupName "StreamAnalytics-Default-West-US" -JobName "StreamJob07" -File "C:\Function07.json"

This command creates a function from the file Function07.json. The name of the function is stored in the .json file.

Example 2: Create a Stream Analytics function named ScoreTweet

PS C:\>New-AzureRmStreamAnalyticsFunction -ResourceGroupName "StreamAnalytics-Default-West-US" -JobName "StreamJob22" -File "C:\Function22.json" -Name "ScoreTweet"

This command creates a function on the job named ScoreTweet.

Example 3: Replace a Stream Analytics function

PS C:\>New-AzureRmStreamAnalyticsFunction -ResourceGroupName "StreamAnalytics-Default-West-US" -JobName "StreamJob22" -File "C:\Function22.json" -Name "ScoreTweet" -Force

This command replaces the definition of the existing function named ScoreTweet with the definition in Function22.json.

Required Parameters

-File

Specifies the path of a .json file that contains the JSON representation of the Stream Analytics function.

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobName

Specifies the name of the Stream Analytics job under which this cmdlet creates a Stream Analytics function.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group under which this cmdlet creates a Stream Analytics function.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Indicates that this cmdlet replaces an existing Stream Analytics function without prompting you for confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the Stream Analytics function that this cmdlet creates.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.StreamAnalytics.Models.PSFunction