Modifier

Partager via


New-AzKustoDataConnection

Creates or updates a data connection.

Syntax

New-AzKustoDataConnection
   -ClusterName <String>
   -DatabaseName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Kind <Kind>
   -Location <String>
   [-TableName <String>]
   -EventHubResourceId <String>
   -ConsumerGroup <String>
   [-DataFormat <String>]
   [-EventSystemProperty <String[]>]
   [-MappingRuleName <String>]
   [-Compression <Compression>]
   [-ManagedIdentityResourceId <String>]
   [-DatabaseRouting <DatabaseRouting>]
   [-RetrievalStartDate <DateTime>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzKustoDataConnection
   -ClusterName <String>
   -DatabaseName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Kind <Kind>
   -Location <String>
   [-TableName <String>]
   -EventHubResourceId <String>
   -ConsumerGroup <String>
   [-DataFormat <String>]
   [-MappingRuleName <String>]
   [-ManagedIdentityResourceId <String>]
   [-DatabaseRouting <DatabaseRouting>]
   -StorageAccountResourceId <String>
   [-BlobStorageEventType <BlobStorageEventType>]
   [-IgnoreFirstRecord]
   [-EventGridResourceId <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzKustoDataConnection
   -ClusterName <String>
   -DatabaseName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Kind <Kind>
   -Location <String>
   [-TableName <String>]
   -ConsumerGroup <String>
   [-DataFormat <String>]
   [-EventSystemProperty <String[]>]
   [-MappingRuleName <String>]
   [-DatabaseRouting <DatabaseRouting>]
   [-RetrievalStartDate <DateTime>]
   -IotHubResourceId <String>
   -SharedAccessPolicyName <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzKustoDataConnection
   -ClusterName <String>
   -DatabaseName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Kind <Kind>
   -Location <String>
   [-TableName <String>]
   [-MappingRuleName <String>]
   -ManagedIdentityResourceId <String>
   [-RetrievalStartDate <DateTime>]
   -CosmosDbAccountResourceId <String>
   -CosmosDbDatabase <String>
   -CosmosDbContainer <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates or updates a data connection.

Examples

Example 1: Create a new EventHub data connection

New-AzKustoDataConnection -ResourceGroupName "testrg" -ClusterName "testnewkustocluster" -DatabaseName "mykustodatabase" -DataConnectionName "myeventhubdc" -Location "East US" -Kind "EventHub" -EventHubResourceId "/subscriptions/$subscriptionId/resourcegroups/testrg/providers/Microsoft.EventHub/namespaces/myeventhubns/eventhubs/myeventhub" -DataFormat "JSON" -ConsumerGroup '$Default' -Compression "None" -TableName "Events" -MappingRuleName "EventsMapping"

Kind     Location Name                                             Type
----     -------- ----                                             ----
EventHub East US  testnewkustocluster/mykustodatabase/myeventhubdc Microsoft.Kusto/Clusters/Databases/DataConnections

The above command creates a new EventHub data connection named "myeventhubdc" for the database "mykustodatabase" in the cluster "testnewkustocluster".

Example 2: Create a new EventGrid data connection

New-AzKustoDataConnection -ResourceGroupName "testrg" -ClusterName "testnewkustocluster" -DatabaseName "mykustodatabase" -DataConnectionName "myeventgriddc" -Location "East US" -Kind "EventGrid" -EventHubResourceId "/subscriptions/$subscriptionId/resourcegroups/testrg/providers/Microsoft.EventHub/namespaces/myeventhubns/eventhubs/myeventhub" -StorageAccountResourceId "/subscriptions/$subscriptionId/resourcegroups/testrg/providers/Microsoft.Storage/storageAccounts/mystorage" -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping"

Kind      Location Name                                              Type
----      -------- ----                                              ----
EventGrid East US  testnewkustocluster/mykustodatabase/myeventgriddc Microsoft.Kusto/Clusters/Databases/DataConnections

The above command creates a new EventGrid data connection named "myeventgriddc" for the database "mykustodatabase" in the cluster "testnewkustocluster".

Example 3: Create a new IotHub data connection

New-AzKustoDataConnection -ResourceGroupName "testrg" -ClusterName "testnewkustocluster" -DatabaseName "mykustodatabase" -DataConnectionName "myiothubdc" -Location "East US" -Kind "IotHub" -IotHubResourceId "/subscriptions/$subscriptionId/resourcegroups/testrg/providers/Microsoft.Devices/IotHubs/myiothub" -SharedAccessPolicyName "myiothubpolicy" -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping"

Kind      Location Name                                        Type
----      -------- ----                                        ----
IotHub East US  testnewkustocluster/mykustodatabase/myiothubdc Microsoft.Kusto/Clusters/Databases/DataConnections

The above command creates a new IotHub data connection named "myiothubdc" for the database "mykustodatabase" in the cluster "testnewkustocluster".

Parameters

-AsJob

Run the command as a job

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

-BlobStorageEventType

The name of blob storage event type to process.

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

-ClusterName

The name of the Kusto cluster.

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

-Compression

The event hub messages compression type.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-ConsumerGroup

The event/iot hub consumer group.

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

-CosmosDbAccountResourceId

The resource ID of the Cosmos DB account used to create the data connection.

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

-CosmosDbContainer

The name of an existing container in the Cosmos DB database.

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

-CosmosDbDatabase

The name of an existing database in the Cosmos DB account.

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

-DatabaseName

The name of the database in the Kusto cluster.

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

-DatabaseRouting

Indication for database routing information from the data connection, by default only database routing information is allowed.

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

-DataFormat

The data format of the message. Optionally the data format can be added to each message.

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

-DefaultProfile

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

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

-EventGridResourceId

The resource ID of the event grid that is subscribed to the storage account events.

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

-EventHubResourceId

The resource ID of the event hub to be used to create a data connection / event grid is configured to send events.

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

-EventSystemProperty

System properties of the event/iot hub.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IgnoreFirstRecord

If set to true, indicates that ingestion should ignore the first record of every file.

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

-IotHubResourceId

The resource ID of the Iot hub to be used to create a data connection.

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

-Kind

Kind of the endpoint for the data connection

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

-Location

Resource location.

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

-ManagedIdentityResourceId

The resource ID of a managed identity (system or user assigned) to be used to authenticate with external resources.

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

-MappingRuleName

The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.

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

-Name

The name of the data connection.

Type:String
Aliases:DataConnectionName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

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

-ResourceGroupName

The name of the resource group containing the Kusto cluster.

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

-RetrievalStartDate

When defined, the data connection retrieves existing Event hub events created since the Retrieval start date. It can only retrieve events retained by the Event hub, based on its retention period.

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

-SharedAccessPolicyName

The name of the share access policy.

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

-StorageAccountResourceId

The resource ID of the storage account where the data resides.

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

-SubscriptionId

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TableName

The table where the data should be ingested. Optionally the table information can be added to each message.

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

Outputs

IDataConnection