使用 Azure PowerShell cmdlet 监视和管理流分析作业Monitor and manage Stream Analytics jobs with Azure PowerShell cmdlets

了解如何使用可执行基本流分析任务的 Azure PowerShell cmdlet 和 PowerShell 脚本来监视和管理流分析资源。Learn how to monitor and manage Stream Analytics resources with Azure PowerShell cmdlets and powershell scripting that execute basic Stream Analytics tasks.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

针对流分析运行 Azure PowerShell cmdlet 的先决条件Prerequisites for running Azure PowerShell cmdlets for Stream Analytics

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

# Log in to your Azure account
Connect-AzAccount -Environment AzureChinaCloud

# Select the Azure subscription you want to use to create the resource group if you have more han one subscription on your account.
Select-AzureSubscription -SubscriptionName <subscription name>
# If Stream Analytics has not been registered to the subscription, remove remark symbol below (#)to run the Register-AzureProvider cmdlet to register the provider namespace.
#Register-AzureProvider -Force -ProviderNamespace 'Microsoft.StreamAnalytics'
# Create an Azure resource group
New-AzureResourceGroup -Name <YOUR RESOURCE GROUP NAME> -Location <LOCATION>

Azure PowerShell 1.0:Azure PowerShell 1.0:

# Log in to your Azure account
Connect-AzAccount -Environment AzureChinaCloud
# Select the Azure subscription you want to use to create the resource group.
Get-AzSubscription -SubscriptionName "your sub" | Select-AzSubscription
# If Stream Analytics has not been registered to the subscription, remove remark symbol below (#)to run the Register-AzureProvider cmdlet to register the provider namespace.
#Register-AzResourceProvider -Force -ProviderNamespace 'Microsoft.StreamAnalytics'
# Create an Azure resource group
New-AzResourceGroup -Name <YOUR RESOURCE GROUP NAME> -Location <LOCATION>

备注

以编程方式创建的流分析作业默认情况下并不启用监视功能。Stream Analytics jobs created programmatically do not have monitoring enabled by default. 可以在 Azure 门户中手动启用监视功能,只需导航到作业的“监视”页,并单击“启用”按钮即可;也可以通过编程方式来执行此操作,只需遵循 Azure 流分析 - 以编程方式监视流分析作业中的步骤即可。You can manually enable monitoring in the Azure Portal by navigating to the job's Monitor page and clicking the Enable button or you can do this programmatically by following the steps located at Azure Stream Analytics - Monitor Stream Analytics Jobs Programmatically.

适用于流分析的 Azure PowerShell cmdletAzure PowerShell cmdlets for Stream Analytics

下面的 Azure PowerShell cmdlet 可用于监视和管理 Azure 流分析作业。The following Azure PowerShell cmdlets can be used to monitor and manage Azure Stream Analytics jobs. 请注意,Azure PowerShell 具有不同版本。Note that Azure PowerShell has different versions. 在所列示例中,第一个命令用于 Azure PowerShell 0.9.8,第二个命令用于 Azure PowerShell 1.0。In the examples listed the first command is for Azure PowerShell 0.9.8, the second command is for Azure PowerShell 1.0. Azure PowerShell 1.0 命令会在命令中始终包含“Az”。The Azure PowerShell 1.0 commands will always have "Az" in the command.

Get-AzureStreamAnalyticsJob | Get-AzStreamAnalyticsJobGet-AzureStreamAnalyticsJob | Get-AzStreamAnalyticsJob

列出所有在 Azure 订阅或指定资源组中定义的流分析作业,或者获取有关某个资源组中特定作业的作业信息。Lists all Stream Analytics jobs defined in the Azure subscription or specified resource group, or gets job information about a specific job within a resource group.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

Get-AzureStreamAnalyticsJob

Azure PowerShell 1.0:Azure PowerShell 1.0:

Get-AzStreamAnalyticsJob

此 PowerShell 命令返回有关在 Azure 订阅中所有流分析作业的信息。This PowerShell command returns information about all the Stream Analytics jobs in the Azure subscription.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

Get-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN 

Azure PowerShell 1.0:Azure PowerShell 1.0:

Get-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN 

此 PowerShell 命令在资源组 StreamAnalytics-Default-East-CN 中返回有关所有流分析作业的信息。This PowerShell command returns information about all the Stream Analytics jobs in the resource group StreamAnalytics-Default-East-CN.

示例 3Example 3

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

Get-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob

Azure PowerShell 1.0:Azure PowerShell 1.0:

Get-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob

此 PowerShell 命令在资源组 StreamAnalytics-Default-East-CN 中返回有关流分析作业 StreamingJob 的信息。This PowerShell command returns information about the Stream Analytics job StreamingJob in the resource group StreamAnalytics-Default-East-CN.

Get-AzureStreamAnalyticsInput | Get-AzStreamAnalyticsInputGet-AzureStreamAnalyticsInput | Get-AzStreamAnalyticsInput

列出在指定流分析作业中定义的所有输入,或获取有关特定输入的信息。Lists all of the inputs that are defined in a specified Stream Analytics job, or gets information about a specific input.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

Get-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob

Azure PowerShell 1.0:Azure PowerShell 1.0:

Get-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob

此 PowerShell 命令返回在作业 StreamingJob 中定义的所有输入的相关信息。This PowerShell command returns information about all the inputs defined in the job StreamingJob.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

Get-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EntryStream

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Get-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EntryStream

此 PowerShell 命令返回在作业 StreamingJob 中定义的名为 EntryStream 的输入的相关信息。This PowerShell command returns information about the input named EntryStream defined in the job StreamingJob.

Get-AzureStreamAnalyticsOutput | Get-AzStreamAnalyticsOutputGet-AzureStreamAnalyticsOutput | Get-AzStreamAnalyticsOutput

列出在指定流分析作业中定义的所有输出,或获取有关特定输出的信息。Lists all of the outputs that are defined in a specified Stream Analytics job, or gets information about a specific output.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Get-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Get-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob

此 PowerShell 命令返回在作业 StreamingJob 中定义的输出的相关信息。This PowerShell command returns information about the outputs defined in the job StreamingJob.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Get-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Get-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

此 PowerShell 命令返回在作业 StreamingJob 中定义的名为 Output 的输出的相关信息。This PowerShell command returns information about the output named Output defined in the job StreamingJob.

Get-AzureStreamAnalyticsQuota | Get-AzStreamAnalyticsQuotaGet-AzureStreamAnalyticsQuota | Get-AzStreamAnalyticsQuota

获取指定区域中流式处理单元配额的相关信息。Gets information about the quota of streaming units in a specified region.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Get-AzureStreamAnalyticsQuota -Location "China East" 

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Get-AzStreamAnalyticsQuota -Location "China East" 

此 PowerShell 命令返回有关中国东部区域配额和流式处理单位使用情况的信息。This PowerShell command returns information about the quota and usage of streaming units in the China East region.

Get-AzureStreamAnalyticsTransformation | Get-AzStreamAnalyticsTransformationGet-AzureStreamAnalyticsTransformation | Get-AzStreamAnalyticsTransformation

获取在流分析作业中定义的特定转换的相关信息。Gets information about a specific transformation defined in a Stream Analytics job.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Get-AzureStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name StreamingJob

Azure PowerShell 1.0:Azure PowerShell 1.0:

Get-AzStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name StreamingJob

此 PowerShell 命令返回作业 StreamingJob 中名为 StreamingJob 的转换的相关信息。This PowerShell command returns information about the transformation called StreamingJob in the job StreamingJob.

New-AzureStreamAnalyticsInput | New-AzStreamAnalyticsInputNew-AzureStreamAnalyticsInput | New-AzStreamAnalyticsInput

在流分析作业中创建新的输入,或者更新现有的指定输入。Creates a new input within a Stream Analytics job, or updates an existing specified input.

输入的名称可以在 .json 文件中指定,也可以在命令行中指定。The name of the input can be specified in the .json file or on the command line. 如果在两处同时指定,则命令行的名称必须与文件中的名称相同。If both are specified, the name on the command line must be the same as the one in the file.

如果所指定的输入已存在,而且你并未指定 -Force 参数,则该 cmdlet 会询问你是否替换现有输入。If you specify an input that already exists and do not specify the -Force parameter, the cmdlet will ask whether or not to replace the existing input.

如果指定了 -Force 参数,同时又指定了一个现有的输入名称,则会在不进行确认的情况下替换该输入。If you specify the -Force parameter and specify an existing input name, the input will be replaced without confirmation.

有关 JSON 文件结构和内容的详细信息,请参阅[流分析管理 REST API 参考库][stream.analytics.rest.api.reference]的[创建输入(Azure 流分析)][msdn-rest-api-create-stream-analytics-input]部分。For detailed information on the JSON file structure and contents, refer to the [Create Input (Azure Stream Analytics)][msdn-rest-api-create-stream-analytics-input] section of the [Stream Analytics Management REST API Reference Library][stream.analytics.rest.api.reference].

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" 

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" 

此 PowerShell 命令从文件 Input.json 创建新的输入。This PowerShell command creates a new input from the file Input.json. 如果已定义了现有的输入,在输入定义文件中指定了名称,则该 cmdlet 会询问是否替换该输入。If an existing input with the name specified in the input definition file is already defined, the cmdlet will ask whether or not to replace it.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" -Name EntryStream

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" -Name EntryStream

此 PowerShell 命令在名为 EntryStream 的作业中创建新的输入。This PowerShell command creates a new input in the job called EntryStream. 如果已定义了使用此名称的现有输入,则该 cmdlet 会询问是否替换该输入。If an existing input with this name is already defined, the cmdlet will ask whether or not to replace it.

示例 3Example 3

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" -Name EntryStream -Force

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -File "C:\Input.json" -Name EntryStream -Force

此 PowerShell 命令会使用文件中的定义来替换名为 EntryStream 的现有输入源的定义。This PowerShell command replaces the definition of the existing input source called EntryStream with the definition from the file.

New-AzureStreamAnalyticsJob | New-AzStreamAnalyticsJobNew-AzureStreamAnalyticsJob | New-AzStreamAnalyticsJob

在 Azure 中创建新的流分析作业,或者更新现有的指定作业的定义。Creates a new Stream Analytics job in Azure, or updates the definition of an existing specified job.

作业的名称可以在 .json 文件中指定,也可以在命令行中指定。The name of the job can be specified in the .json file or on the command line. 如果在两处同时指定,则命令行的名称必须与文件中的名称相同。If both are specified, the name on the command line must be the same as the one in the file.

如果所指定的作业名称已存在,而且你并未指定 -Force 参数,则该 cmdlet 会询问你是否替换现有作业。If you specify a job name that already exists and do not specify the -Force parameter, the cmdlet will ask whether or not to replace the existing job.

如果指定了 -Force 参数,同时又指定了一个现有的作业名称,则会在不进行确认的情况下替换作业定义。If you specify the -Force parameter and specify an existing job name, the job definition will be replaced without confirmation.

有关 JSON 文件结构和内容的详细信息,请参阅[流分析管理 REST API 参考库][stream.analytics.rest.api.reference]的[创建流分析作业][msdn-rest-api-create-stream-analytics-job]部分。For detailed information on the JSON file structure and contents, refer to the [Create Stream Analytics Job][msdn-rest-api-create-stream-analytics-job] section of the [Stream Analytics Management REST API Reference Library][stream.analytics.rest.api.reference].

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\JobDefinition.json" 

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\JobDefinition.json" 

此 PowerShell 命令在 JobDefinition.json 的定义中创建新的作业。This PowerShell command creates a new job from the definition in JobDefinition.json. 如果已定义了现有的作业,在作业定义文件中指定了名称,则该 cmdlet 会询问是否替换该作业。If an existing job with the name specified in the job definition file is already defined, the cmdlet will ask whether or not to replace it.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\JobDefinition.json" -Name StreamingJob -Force

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\JobDefinition.json" -Name StreamingJob -Force

此 PowerShell 命令替换 StreamingJob 的作业定义。This PowerShell command replaces the job definition for StreamingJob.

New-AzureStreamAnalyticsOutput | New-AzStreamAnalyticsOutputNew-AzureStreamAnalyticsOutput | New-AzStreamAnalyticsOutput

在流分析作业中创建新的输出,或者更新现有的输出。Creates a new output within a Stream Analytics job, or updates an existing output.

输出的名称可以在 .json 文件中指定,也可以在命令行中指定。The name of the output can be specified in the .json file or on the command line. 如果在两处同时指定,则命令行的名称必须与文件中的名称相同。If both are specified, the name on the command line must be the same as the one in the file.

如果所指定的输出已存在,而且你并未指定 -Force 参数,则该 cmdlet 会询问你是否替换现有输出。If you specify an output that already exists and do not specify the -Force parameter, the cmdlet will ask whether or not to replace the existing output.

如果指定了 -Force 参数,同时又指定了一个现有的输出名称,则会在不进行确认的情况下替换该输出。If you specify the -Force parameter and specify an existing output name, the output will be replaced without confirmation.

有关 JSON 文件结构和内容的详细信息,请参阅[流分析管理 REST API 参考库][stream.analytics.rest.api.reference]的[创建输出(Azure 流分析)][msdn-rest-api-create-stream-analytics-output]部分。For detailed information on the JSON file structure and contents, refer to the [Create Output (Azure Stream Analytics)][msdn-rest-api-create-stream-analytics-output] section of the [Stream Analytics Management REST API Reference Library][stream.analytics.rest.api.reference].

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Output.json" -JobName StreamingJob -Name output

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Output.json" -JobName StreamingJob -Name output

此 PowerShell 命令在 StreamingJob 作业中创建新的名为“output”的输出。This PowerShell command creates a new output called "output" in the job StreamingJob. 如果已定义了使用此名称的现有输出,则该 cmdlet 会询问是否替换该输出。If an existing output with this name is already defined, the cmdlet will ask whether or not to replace it.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Output.json" -JobName StreamingJob -Name output -Force

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Output.json" -JobName StreamingJob -Name output -Force

此 PowerShell 命令替换作业 StreamingJob 中“output”的定义。This PowerShell command replaces the definition for "output" in the job StreamingJob.

New-AzureStreamAnalyticsTransformation | New-AzStreamAnalyticsTransformationNew-AzureStreamAnalyticsTransformation | New-AzStreamAnalyticsTransformation

在流分析作业中创建新的转换,或者更新现有转换。Creates a new transformation within a Stream Analytics job, or updates the existing transformation.

转换的名称可以在 .json 文件中指定,也可以在命令行中指定。The name of the transformation can be specified in the .json file or on the command line. 如果在两处同时指定,则命令行的名称必须与文件中的名称相同。If both are specified, the name on the command line must be the same as the one in the file.

如果所指定的转换已存在,而且你并未指定 -Force 参数,则该 cmdlet 会询问你是否替换现有转换。If you specify a transformation that already exists and do not specify the -Force parameter, the cmdlet will ask whether or not to replace the existing transformation.

如果指定了 -Force 参数,同时又指定了一个现有的转换名称,则会在不进行确认的情况下替换转换。If you specify the -Force parameter and specify an existing transformation name, the transformation will be replaced without confirmation.

有关 JSON 文件结构和内容的详细信息,请参阅[流分析管理 REST API 参考库][stream.analytics.rest.api.reference]的[创建转换(Azure 流分析)][msdn-rest-api-create-stream-analytics-transformation]部分。For detailed information on the JSON file structure and contents, refer to the [Create Transformation (Azure Stream Analytics)][msdn-rest-api-create-stream-analytics-transformation] section of the [Stream Analytics Management REST API Reference Library][stream.analytics.rest.api.reference].

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Transformation.json" -JobName StreamingJob -Name StreamingJobTransform

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Transformation.json" -JobName StreamingJob -Name StreamingJobTransform

此 PowerShell 命令在作业 StreamingJob 中创建名为 StreamingJobTransform 的新转换。This PowerShell command creates a new transformation called StreamingJobTransform in the job StreamingJob. 如果已定义了使用此名称的现有转换,则该 cmdlet 会询问是否替换该转换。If an existing transformation is already defined with this name, the cmdlet will ask whether or not to replace it.

示例 2Example 2

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    New-AzureStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Transformation.json" -JobName StreamingJob -Name StreamingJobTransform -Force

Azure PowerShell 1.0:Azure PowerShell 1.0:

    New-AzStreamAnalyticsTransformation -ResourceGroupName StreamAnalytics-Default-East-CN -File "C:\Transformation.json" -JobName StreamingJob -Name StreamingJobTransform -Force

此 PowerShell 命令替换作业 StreamingJob 中 StreamingJobTransform 的定义。This PowerShell command replaces the definition of StreamingJobTransform in the job StreamingJob.

Remove-AzureStreamAnalyticsInput | Remove-AzStreamAnalyticsInputRemove-AzureStreamAnalyticsInput | Remove-AzStreamAnalyticsInput

以异步方式从 Azure 的流分析作业中删除特定的输入。Asynchronously deletes a specific input from a Stream Analytics job in Azure.
如果指定 -Force 参数,则会在不确认的情况下删除输入。If you specify the -Force parameter, the input will be deleted without confirmation.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Remove-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EventStream

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Remove-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EventStream

此 PowerShell 命令删除作业 StreamingJob 中的输入 EventStream。This PowerShell command removes the input EventStream in the job StreamingJob.

Remove-AzureStreamAnalyticsJob | Remove-AzStreamAnalyticsJobRemove-AzureStreamAnalyticsJob | Remove-AzStreamAnalyticsJob

以异步方式删除 Azure 中的特定流分析作业。Asynchronously deletes a specific Stream Analytics job in Azure.
如果指定 -Force 参数,则会在不确认的情况下删除作业。If you specify the -Force parameter, the job will be deleted without confirmation.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Remove-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob 

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Remove-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob 

此 PowerShell 命令删除作业 StreamingJob。This PowerShell command removes the job StreamingJob.

Remove-AzureStreamAnalyticsOutput | Remove-AzStreamAnalyticsOutputRemove-AzureStreamAnalyticsOutput | Remove-AzStreamAnalyticsOutput

以异步方式从 Azure 的流分析作业中删除特定的输出。Asynchronously deletes a specific output from a Stream Analytics job in Azure.
如果指定 -Force 参数,则会在不确认的情况下删除输出。If you specify the -Force parameter, the output will be deleted without confirmation.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Remove-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Remove-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

此 PowerShell 命令删除作业 StreamingJob 中的输出 Output。This PowerShell command removes the output Output in the job StreamingJob.

Start-AzureStreamAnalyticsJob | Start-AzStreamAnalyticsJobStart-AzureStreamAnalyticsJob | Start-AzStreamAnalyticsJob

以异步方式部署和启动 Azure 中的流分析作业。Asynchronously deploys and starts a Stream Analytics job in Azure.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Start-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob -OutputStartMode CustomTime -OutputStartTime 2012-12-12T12:12:12Z

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Start-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob -OutputStartMode CustomTime -OutputStartTime 2012-12-12T12:12:12Z

此 PowerShell 命令启动作业 StreamingJob,并将自定义输出开始时间设置为 2012 年 12 月 12 日 12:12:12(UTC)。This PowerShell command starts the job StreamingJob with a custom output start time set to December 12, 2012, 12:12:12 UTC.

Stop-AzureStreamAnalyticsJob | Stop-AzStreamAnalyticsJobStop-AzureStreamAnalyticsJob | Stop-AzStreamAnalyticsJob

以异步方式停止流分析作业在 Azure 中的运行,并取消分配所使用的资源。Asynchronously stops a Stream Analytics job from running in Azure and de-allocates resources that were that were being used. 通过 Azure 门户和管理 API,仍可获取订阅中的作业定义和元数据,因此作业可以编辑和重启。The job definition and metadata will remain available within your subscription through both the Azure portal and management APIs, such that the job can be edited and restarted. 处于停止状态的作业不收费。You will not be charged for a job in the stopped state.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Stop-AzureStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob 

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Stop-AzStreamAnalyticsJob -ResourceGroupName StreamAnalytics-Default-East-CN -Name StreamingJob 

此 PowerShell 命令停止作业 StreamingJob。This PowerShell command stops the job StreamingJob.

Test-AzureStreamAnalyticsInput | Test-AzStreamAnalyticsInputTest-AzureStreamAnalyticsInput | Test-AzStreamAnalyticsInput

测试流分析能否连接到指定的输入。Tests the ability of Stream Analytics to connect to a specified input.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Test-AzureStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EntryStream

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Test-AzStreamAnalyticsInput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name EntryStream

此 PowerShell 命令测试 StreamingJob 中输入 EntryStream 的连接状态。This PowerShell command tests the connection status of the input EntryStream in StreamingJob.

Test-AzureStreamAnalyticsOutput | Test-AzStreamAnalyticsOutputTest-AzureStreamAnalyticsOutput | Test-AzStreamAnalyticsOutput

测试流分析能否连接到指定的输出。Tests the ability of Stream Analytics to connect to a specified output.

示例 1Example 1

Azure PowerShell 0.9.8:Azure PowerShell 0.9.8:

    Test-AzureStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

Azure PowerShell 1.0:Azure PowerShell 1.0:

    Test-AzStreamAnalyticsOutput -ResourceGroupName StreamAnalytics-Default-East-CN -JobName StreamingJob -Name Output

此 PowerShell 命令测试 StreamingJob 中输出 Output 的连接状态。This PowerShell command tests the connection status of the output Output in StreamingJob.

获取支持Get support

若要获得进一步的帮助,可前往 Azure 流分析的 Microsoft 问答问题页面For further assistance, try our Microsoft Q&A question page for Azure Stream Analytics.

后续步骤Next steps