New-AzureRmStreamAnalyticsFunction

Creates or replaces a function in a Stream Analytics job.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmStreamAnalyticsFunction
   [-JobName] <String>
   [[-Name] <String>]
   [-File] <String>
   [-Force]
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<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.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-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
Required:True
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
Required:False
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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

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

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:True
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
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSFunction