Returns a data connection.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}?api-version=2023-08-15
URI Parameters
Name |
In |
Required |
Type |
Description |
clusterName
|
path |
True
|
string
|
The name of the Kusto cluster.
Regex pattern: ^.*$
|
databaseName
|
path |
True
|
string
|
The name of the database in the Kusto cluster.
Regex pattern: ^.*$
|
dataConnectionName
|
path |
True
|
string
|
The name of the data connection.
Regex pattern: ^.*$
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
DataConnection:
|
Successfully retrieved the specified data connection.
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
Examples
KustoDataConnectionsCosmosDbGet
Sample Request
GET https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/kustoCluster/databases/KustoDatabase1/dataConnections/dataConnectionTest?api-version=2023-08-15
/** Samples for DataConnections Get. */
public final class Main {
/*
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsCosmosDbGet.json
*/
/**
* Sample code: KustoDataConnectionsCosmosDbGet.
*
* @param manager Entry point to KustoManager.
*/
public static void kustoDataConnectionsCosmosDbGet(com.azure.resourcemanager.kusto.KustoManager manager) {
manager
.dataConnections()
.getWithResponse(
"kustorptest",
"kustoCluster",
"KustoDatabase1",
"dataConnectionTest",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.kusto import KustoManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-kusto
# USAGE
python kusto_data_connections_cosmos_db_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = KustoManagementClient(
credential=DefaultAzureCredential(),
subscription_id="12345678-1234-1234-1234-123456789098",
)
response = client.data_connections.get(
resource_group_name="kustorptest",
cluster_name="kustoCluster",
database_name="KustoDatabase1",
data_connection_name="dataConnectionTest",
)
print(response)
# x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsCosmosDbGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armkusto_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsCosmosDbGet.json
func ExampleDataConnectionsClient_Get_kustoDataConnectionsCosmosDbGet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armkusto.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase1", "dataConnectionTest", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armkusto.DataConnectionsClientGetResponse{
// DataConnectionClassification: &armkusto.CosmosDbDataConnection{
// Name: to.Ptr("kustoCluster/KustoDatabase1/KustoDataConnection1"),
// Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase1/DataConnections/KustoDataConnection1"),
// Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb),
// Location: to.Ptr("westus"),
// Properties: &armkusto.CosmosDbDataConnectionProperties{
// CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"),
// CosmosDbContainer: to.Ptr("cosmosDbContainerTest"),
// CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"),
// ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"),
// ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"),
// MappingRuleName: to.Ptr("TestMapping"),
// ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded),
// RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.655Z"); return t}()),
// TableName: to.Ptr("TestTable"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { KustoManagementClient } = require("@azure/arm-kusto");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns a data connection.
*
* @summary Returns a data connection.
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsCosmosDbGet.json
*/
async function kustoDataConnectionsCosmosDbGet() {
const subscriptionId =
process.env["KUSTO_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098";
const resourceGroupName = process.env["KUSTO_RESOURCE_GROUP"] || "kustorptest";
const clusterName = "kustoCluster";
const databaseName = "KustoDatabase1";
const dataConnectionName = "dataConnectionTest";
const credential = new DefaultAzureCredential();
const client = new KustoManagementClient(credential, subscriptionId);
const result = await client.dataConnections.get(
resourceGroupName,
clusterName,
databaseName,
dataConnectionName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Kusto;
using Azure.ResourceManager.Kusto.Models;
// Generated from example definition: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsCosmosDbGet.json
// this example is just showing the usage of "DataConnections_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this KustoDataConnectionResource created on azure
// for more information of creating KustoDataConnectionResource, please refer to the document of KustoDataConnectionResource
string subscriptionId = "12345678-1234-1234-1234-123456789098";
string resourceGroupName = "kustorptest";
string clusterName = "kustoCluster";
string databaseName = "KustoDatabase1";
string dataConnectionName = "dataConnectionTest";
ResourceIdentifier kustoDataConnectionResourceId = KustoDataConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, databaseName, dataConnectionName);
KustoDataConnectionResource kustoDataConnection = client.GetKustoDataConnectionResource(kustoDataConnectionResourceId);
// invoke the operation
KustoDataConnectionResource result = await kustoDataConnection.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
KustoDataConnectionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase1/DataConnections/KustoDataConnection1",
"name": "kustoCluster/KustoDatabase1/KustoDataConnection1",
"type": "Microsoft.Kusto/Clusters/Databases/DataConnections",
"location": "westus",
"kind": "CosmosDb",
"properties": {
"tableName": "TestTable",
"mappingRuleName": "TestMapping",
"managedIdentityResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
"managedIdentityObjectId": "87654321-1234-1234-1234-123456789123",
"cosmosDbAccountResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1",
"cosmosDbDatabase": "cosmosDbDatabaseTest",
"cosmosDbContainer": "cosmosDbContainerTest",
"retrievalStartDate": "2022-07-29T12:00:00.6554616Z",
"provisioningState": "Succeeded"
}
}
KustoDataConnectionsEventGridGet
Sample Request
GET https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/kustoCluster/databases/KustoDatabase8/dataConnections/dataConnectionTest?api-version=2023-08-15
/** Samples for DataConnections Get. */
public final class Main {
/*
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsEventGridGet.json
*/
/**
* Sample code: KustoDataConnectionsEventGridGet.
*
* @param manager Entry point to KustoManager.
*/
public static void kustoDataConnectionsEventGridGet(com.azure.resourcemanager.kusto.KustoManager manager) {
manager
.dataConnections()
.getWithResponse(
"kustorptest",
"kustoCluster",
"KustoDatabase8",
"dataConnectionTest",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.kusto import KustoManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-kusto
# USAGE
python kusto_data_connections_event_grid_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = KustoManagementClient(
credential=DefaultAzureCredential(),
subscription_id="12345678-1234-1234-1234-123456789098",
)
response = client.data_connections.get(
resource_group_name="kustorptest",
cluster_name="kustoCluster",
database_name="KustoDatabase8",
data_connection_name="dataConnectionTest",
)
print(response)
# x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsEventGridGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armkusto_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsEventGridGet.json
func ExampleDataConnectionsClient_Get_kustoDataConnectionsEventGridGet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armkusto.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armkusto.DataConnectionsClientGetResponse{
// DataConnectionClassification: &armkusto.EventGridDataConnection{
// Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"),
// Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection9"),
// Kind: to.Ptr(armkusto.DataConnectionKindEventGrid),
// Location: to.Ptr("westus"),
// Properties: &armkusto.EventGridConnectionProperties{
// BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated),
// ConsumerGroup: to.Ptr("$Default"),
// DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON),
// DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle),
// EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"),
// EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"),
// IgnoreFirstRecord: to.Ptr(false),
// ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"),
// ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"),
// MappingRuleName: to.Ptr("TestMapping"),
// ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded),
// StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"),
// TableName: to.Ptr("TestTable"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { KustoManagementClient } = require("@azure/arm-kusto");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns a data connection.
*
* @summary Returns a data connection.
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsEventGridGet.json
*/
async function kustoDataConnectionsEventGridGet() {
const subscriptionId =
process.env["KUSTO_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098";
const resourceGroupName = process.env["KUSTO_RESOURCE_GROUP"] || "kustorptest";
const clusterName = "kustoCluster";
const databaseName = "KustoDatabase8";
const dataConnectionName = "dataConnectionTest";
const credential = new DefaultAzureCredential();
const client = new KustoManagementClient(credential, subscriptionId);
const result = await client.dataConnections.get(
resourceGroupName,
clusterName,
databaseName,
dataConnectionName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Kusto;
using Azure.ResourceManager.Kusto.Models;
// Generated from example definition: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsEventGridGet.json
// this example is just showing the usage of "DataConnections_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this KustoDataConnectionResource created on azure
// for more information of creating KustoDataConnectionResource, please refer to the document of KustoDataConnectionResource
string subscriptionId = "12345678-1234-1234-1234-123456789098";
string resourceGroupName = "kustorptest";
string clusterName = "kustoCluster";
string databaseName = "KustoDatabase8";
string dataConnectionName = "dataConnectionTest";
ResourceIdentifier kustoDataConnectionResourceId = KustoDataConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, databaseName, dataConnectionName);
KustoDataConnectionResource kustoDataConnection = client.GetKustoDataConnectionResource(kustoDataConnectionResourceId);
// invoke the operation
KustoDataConnectionResource result = await kustoDataConnection.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
KustoDataConnectionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection9",
"name": "kustoCluster/KustoDatabase8/dataConnectionTest",
"type": "Microsoft.Kusto/Clusters/Databases/DataConnections",
"location": "westus",
"kind": "EventGrid",
"properties": {
"ignoreFirstRecord": false,
"storageAccountResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount",
"eventGridResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest",
"eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2",
"consumerGroup": "$Default",
"tableName": "TestTable",
"mappingRuleName": "TestMapping",
"dataFormat": "JSON",
"blobStorageEventType": "Microsoft.Storage.BlobCreated",
"managedIdentityResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
"managedIdentityObjectId": "87654321-1234-1234-1234-123456789123",
"databaseRouting": "Single",
"provisioningState": "Succeeded"
}
}
KustoDataConnectionsGet
Sample Request
GET https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/kustoCluster/databases/KustoDatabase8/dataConnections/dataConnectionTest?api-version=2023-08-15
/** Samples for DataConnections Get. */
public final class Main {
/*
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsGet.json
*/
/**
* Sample code: KustoDataConnectionsGet.
*
* @param manager Entry point to KustoManager.
*/
public static void kustoDataConnectionsGet(com.azure.resourcemanager.kusto.KustoManager manager) {
manager
.dataConnections()
.getWithResponse(
"kustorptest",
"kustoCluster",
"KustoDatabase8",
"dataConnectionTest",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.kusto import KustoManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-kusto
# USAGE
python kusto_data_connections_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = KustoManagementClient(
credential=DefaultAzureCredential(),
subscription_id="12345678-1234-1234-1234-123456789098",
)
response = client.data_connections.get(
resource_group_name="kustorptest",
cluster_name="kustoCluster",
database_name="KustoDatabase8",
data_connection_name="dataConnectionTest",
)
print(response)
# x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armkusto_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsGet.json
func ExampleDataConnectionsClient_Get_kustoDataConnectionsGet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armkusto.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armkusto.DataConnectionsClientGetResponse{
// DataConnectionClassification: &armkusto.EventHubDataConnection{
// Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"),
// Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/dataConnectionTest"),
// Kind: to.Ptr(armkusto.DataConnectionKindEventHub),
// Location: to.Ptr("westus"),
// Properties: &armkusto.EventHubConnectionProperties{
// Compression: to.Ptr(armkusto.CompressionNone),
// ConsumerGroup: to.Ptr("$Default"),
// DataFormat: to.Ptr(armkusto.EventHubDataFormatJSON),
// DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle),
// EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"),
// EventSystemProperties: []*string{
// },
// ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"),
// ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"),
// MappingRuleName: to.Ptr("TestMapping"),
// ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded),
// RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.655Z"); return t}()),
// TableName: to.Ptr("TestTable"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { KustoManagementClient } = require("@azure/arm-kusto");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns a data connection.
*
* @summary Returns a data connection.
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsGet.json
*/
async function kustoDataConnectionsGet() {
const subscriptionId =
process.env["KUSTO_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098";
const resourceGroupName = process.env["KUSTO_RESOURCE_GROUP"] || "kustorptest";
const clusterName = "kustoCluster";
const databaseName = "KustoDatabase8";
const dataConnectionName = "dataConnectionTest";
const credential = new DefaultAzureCredential();
const client = new KustoManagementClient(credential, subscriptionId);
const result = await client.dataConnections.get(
resourceGroupName,
clusterName,
databaseName,
dataConnectionName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Kusto;
using Azure.ResourceManager.Kusto.Models;
// Generated from example definition: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/examples/KustoDataConnectionsGet.json
// this example is just showing the usage of "DataConnections_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this KustoDataConnectionResource created on azure
// for more information of creating KustoDataConnectionResource, please refer to the document of KustoDataConnectionResource
string subscriptionId = "12345678-1234-1234-1234-123456789098";
string resourceGroupName = "kustorptest";
string clusterName = "kustoCluster";
string databaseName = "KustoDatabase8";
string dataConnectionName = "dataConnectionTest";
ResourceIdentifier kustoDataConnectionResourceId = KustoDataConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, databaseName, dataConnectionName);
KustoDataConnectionResource kustoDataConnection = client.GetKustoDataConnectionResource(kustoDataConnectionResourceId);
// invoke the operation
KustoDataConnectionResource result = await kustoDataConnection.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
KustoDataConnectionData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/dataConnectionTest",
"name": "kustoCluster/KustoDatabase8/dataConnectionTest",
"type": "Microsoft.Kusto/Clusters/Databases/DataConnections",
"location": "westus",
"kind": "EventHub",
"properties": {
"eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
"consumerGroup": "$Default",
"tableName": "TestTable",
"mappingRuleName": "TestMapping",
"dataFormat": "JSON",
"eventSystemProperties": [],
"compression": "None",
"managedIdentityResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
"managedIdentityObjectId": "87654321-1234-1234-1234-123456789123",
"databaseRouting": "Single",
"retrievalStartDate": "2022-07-29T12:00:00.6554616Z",
"provisioningState": "Succeeded"
}
}
Definitions
blobStorageEventType
The name of blob storage event type to process.
Name |
Type |
Description |
Microsoft.Storage.BlobCreated
|
string
|
|
Microsoft.Storage.BlobRenamed
|
string
|
|
compression
The event hub messages compression type
Name |
Type |
Description |
GZip
|
string
|
|
None
|
string
|
|
CosmosDbDataConnection
Class representing a CosmosDb data connection.
Name |
Type |
Description |
id
|
string
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
kind
|
string:
CosmosDb
|
Kind of the endpoint for the data connection
|
location
|
string
|
Resource location.
|
name
|
string
|
The name of the resource
|
properties.cosmosDbAccountResourceId
|
string
|
The resource ID of the Cosmos DB account used to create the data connection.
|
properties.cosmosDbContainer
|
string
|
The name of an existing container in the Cosmos DB database.
|
properties.cosmosDbDatabase
|
string
|
The name of an existing database in the Cosmos DB account.
|
properties.managedIdentityObjectId
|
string
|
The object ID of the managed identity resource.
|
properties.managedIdentityResourceId
|
string
|
The resource ID of a managed system or user-assigned identity. The identity is used to authenticate with Cosmos DB.
|
properties.mappingRuleName
|
string
|
The name of an existing mapping rule to use when ingesting the retrieved data.
|
properties.provisioningState
|
ProvisioningState
|
The provisioned state of the resource.
|
properties.retrievalStartDate
|
string
|
Optional. If defined, the data connection retrieves Cosmos DB documents created or updated after the specified retrieval start date.
|
properties.tableName
|
string
|
The case-sensitive name of the existing target table in your cluster. Retrieved data is ingested into this table.
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
DatabaseRouting
Indication for database routing information from the data connection, by default only database routing information is allowed
Name |
Type |
Description |
Multi
|
string
|
|
Single
|
string
|
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|
EventGridDataConnection
Class representing an Event Grid data connection.
Name |
Type |
Default Value |
Description |
id
|
string
|
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
kind
|
string:
EventGrid
|
|
Kind of the endpoint for the data connection
|
location
|
string
|
|
Resource location.
|
name
|
string
|
|
The name of the resource
|
properties.blobStorageEventType
|
blobStorageEventType
|
|
The name of blob storage event type to process.
|
properties.consumerGroup
|
string
|
|
The event hub consumer group.
|
properties.dataFormat
|
eventGridDataFormat
|
|
The data format of the message. Optionally the data format can be added to each message.
|
properties.databaseRouting
|
DatabaseRouting
|
Single
|
Indication for database routing information from the data connection, by default only database routing information is allowed
|
properties.eventGridResourceId
|
string
|
|
The resource ID of the event grid that is subscribed to the storage account events.
|
properties.eventHubResourceId
|
string
|
|
The resource ID where the event grid is configured to send events.
|
properties.ignoreFirstRecord
|
boolean
|
|
A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file
|
properties.managedIdentityObjectId
|
string
|
|
The object ID of managedIdentityResourceId
|
properties.managedIdentityResourceId
|
string
|
|
The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub and storage account.
|
properties.mappingRuleName
|
string
|
|
The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
|
properties.provisioningState
|
ProvisioningState
|
|
The provisioned state of the resource.
|
properties.storageAccountResourceId
|
string
|
|
The resource ID of the storage account where the data resides.
|
properties.tableName
|
string
|
|
The table where the data should be ingested. Optionally the table information can be added to each message.
|
type
|
string
|
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
The data format of the message. Optionally the data format can be added to each message.
Name |
Type |
Description |
APACHEAVRO
|
string
|
|
AVRO
|
string
|
|
CSV
|
string
|
|
JSON
|
string
|
|
MULTIJSON
|
string
|
|
ORC
|
string
|
|
PARQUET
|
string
|
|
PSV
|
string
|
|
RAW
|
string
|
|
SCSV
|
string
|
|
SINGLEJSON
|
string
|
|
SOHSV
|
string
|
|
TSV
|
string
|
|
TSVE
|
string
|
|
TXT
|
string
|
|
W3CLOGFILE
|
string
|
|
EventHubDataConnection
Class representing an event hub data connection.
Name |
Type |
Default Value |
Description |
id
|
string
|
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
kind
|
string:
EventHub
|
|
Kind of the endpoint for the data connection
|
location
|
string
|
|
Resource location.
|
name
|
string
|
|
The name of the resource
|
properties.compression
|
compression
|
None
|
The event hub messages compression type
|
properties.consumerGroup
|
string
|
|
The event hub consumer group.
|
properties.dataFormat
|
eventHubDataFormat
|
|
The data format of the message. Optionally the data format can be added to each message.
|
properties.databaseRouting
|
DatabaseRouting
|
Single
|
Indication for database routing information from the data connection, by default only database routing information is allowed
|
properties.eventHubResourceId
|
string
|
|
The resource ID of the event hub to be used to create a data connection.
|
properties.eventSystemProperties
|
string[]
|
|
System properties of the event hub
|
properties.managedIdentityObjectId
|
string
|
|
The object ID of the managedIdentityResourceId
|
properties.managedIdentityResourceId
|
string
|
|
The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub.
|
properties.mappingRuleName
|
string
|
|
The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
|
properties.provisioningState
|
ProvisioningState
|
|
The provisioned state of the resource.
|
properties.retrievalStartDate
|
string
|
|
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.
|
properties.tableName
|
string
|
|
The table where the data should be ingested. Optionally the table information can be added to each message.
|
type
|
string
|
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
The data format of the message. Optionally the data format can be added to each message.
Name |
Type |
Description |
APACHEAVRO
|
string
|
|
AVRO
|
string
|
|
CSV
|
string
|
|
JSON
|
string
|
|
MULTIJSON
|
string
|
|
ORC
|
string
|
|
PARQUET
|
string
|
|
PSV
|
string
|
|
RAW
|
string
|
|
SCSV
|
string
|
|
SINGLEJSON
|
string
|
|
SOHSV
|
string
|
|
TSV
|
string
|
|
TSVE
|
string
|
|
TXT
|
string
|
|
W3CLOGFILE
|
string
|
|
IotHubDataConnection
Class representing an iot hub data connection.
Name |
Type |
Default Value |
Description |
id
|
string
|
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
kind
|
string:
IotHub
|
|
Kind of the endpoint for the data connection
|
location
|
string
|
|
Resource location.
|
name
|
string
|
|
The name of the resource
|
properties.consumerGroup
|
string
|
|
The iot hub consumer group.
|
properties.dataFormat
|
iotHubDataFormat
|
|
The data format of the message. Optionally the data format can be added to each message.
|
properties.databaseRouting
|
DatabaseRouting
|
Single
|
Indication for database routing information from the data connection, by default only database routing information is allowed
|
properties.eventSystemProperties
|
string[]
|
|
System properties of the iot hub
|
properties.iotHubResourceId
|
string
|
|
The resource ID of the Iot hub to be used to create a data connection.
|
properties.mappingRuleName
|
string
|
|
The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
|
properties.provisioningState
|
ProvisioningState
|
|
The provisioned state of the resource.
|
properties.retrievalStartDate
|
string
|
|
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.
|
properties.sharedAccessPolicyName
|
string
|
|
The name of the share access policy
|
properties.tableName
|
string
|
|
The table where the data should be ingested. Optionally the table information can be added to each message.
|
type
|
string
|
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
The data format of the message. Optionally the data format can be added to each message.
Name |
Type |
Description |
APACHEAVRO
|
string
|
|
AVRO
|
string
|
|
CSV
|
string
|
|
JSON
|
string
|
|
MULTIJSON
|
string
|
|
ORC
|
string
|
|
PARQUET
|
string
|
|
PSV
|
string
|
|
RAW
|
string
|
|
SCSV
|
string
|
|
SINGLEJSON
|
string
|
|
SOHSV
|
string
|
|
TSV
|
string
|
|
TSVE
|
string
|
|
TXT
|
string
|
|
W3CLOGFILE
|
string
|
|
ProvisioningState
The provisioned state of the resource.
Name |
Type |
Description |
Canceled
|
string
|
|
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Moving
|
string
|
|
Running
|
string
|
|
Succeeded
|
string
|
|