Skip to content

Latest commit

 

History

History
206 lines (149 loc) · 5.93 KB

New-KustoClientRequestProperties.md

File metadata and controls

206 lines (149 loc) · 5.93 KB
external help file Module Name online version schema
PowerShellKusto.dll-Help.xml
PowerShellKusto
2.0.0

New-KustoClientRequestProperties

SYNOPSIS

Creates a new ClientRequestProperties object.

SYNTAX

New-KustoClientRequestProperties
    [-Application <String>]
    [-User <String>]
    [-ClientRequestId <String>]
    [-Parameters <Hashtable>]
    [-Options <Hashtable>]
    [-NoTruncation]
    [-ServerTimeout <TimeSpan>]
    [<CommonParameters>]

DESCRIPTION

The New-KustoClientRequestProperties cmdlet can be used to create a new ClientRequestProperties object to manage the interaction between client and service. This object can be later on passed as argument to the request cmdlets: Invoke-KustoControlCommand, Invoke-KustoQuery, Set-KustoBatchingPolicy and Set-KustoIngestionMapping.

The object contains the following information:

  • Request properties: A mapping of specific options for customizing request behavior.
  • Query parameters: A mapping of user-declared parameters that allow for secure query customization.
  • Named properties: Client request ID, application details, and user data, primarily used for debugging and tracing.

EXAMPLES

Example 1: Run a KQL Query with specified request properties

$requestProps = New-KustoClientRequestProperties -NoTruncation -ServerTimeout '00:05:00'
Invoke-KustoQuery 'myTable | project fooProp, barProp' -RequestProperties $requestProps

This example demonstrates how you can specify request properties for your query.

  • In this case -NoTruncation is particularly useful to overcome the 500k row limit on your query.
  • -ServerTimeout '00:05:00' allows the query to run for at least 5 minutes before timing out.

Example 2: Create a new ClientRequestProperties object with supported request properties

$requestProps = New-KustoClientRequestProperties -Options @{
    query_language   = 'sql'
    request_app_name = 'myApp'
    norequesttimeout = $true
}
Invoke-KustoQuery 'SELECT top(10) * FROM MyTable' -RequestProperties $requestProps

Tip

Out of the supported request properties, this cmdlet offers -NoTruncation (notruncation) and -ServerTimeout (servertimeout) as a Parameter. The -Options Parameter is used to add extra options to your request that aren't by default available.
See Supported request properties for the additional options.

PARAMETERS

-Application

The name of the client application that makes the request. This value is used for tracing.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ClientRequestId

An ID used to identify the request. This specification is helpful for debugging and may be required for specific scenarios like query cancellation.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NoTruncation

Disables truncation of query results returned to the caller.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Options

Specifies a Hashtable of additional Supported request properties that aren't by default available as a Parameter.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Parameters

Specifies a Hashtable of query parameters declaration statement that are used to declare parameters for a Kusto Query Language (KQL) query.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ServerTimeout

Overrides the default request timeout.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-User

The identity of the user that makes the request. This value is used for tracing.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

Kusto.Data.Common.ClientRequestProperties

NOTES

RELATED LINKS

Kusto Data ClientRequestProperties class

Query parameters declaration statement

Request properties