https://pulumi.com logo
Title
l

limited-carpenter-34991

06/17/2021, 2:15 PM
I need help regarding the azure data explorer (kusto / adx). Inside the documentation there are several database objects. https://www.pulumi.com/docs/reference/pkg/azure-native/kusto/ What database obect is actual / newest one ? And depending on the database, what is the right one for one for the data ingestion to an eventhub? There are two object types. If i use the EventHubDataConnection, i got the error "Code="ResourceNotFound" Message="The resource with identifier" for the database.
t

tall-librarian-49374

06/17/2021, 2:20 PM
Database
is deprecated (you should see this in its docs)
Same goes for
DataConnection
ResourceNotFound
suggests that maybe the parent resource does not exist with the names you specified?
l

limited-carpenter-34991

06/17/2021, 3:01 PM
I use the ReadWriteDatabase database object and the EventHubDataConnection.
var database = new AzureNative.Kusto.ReadWriteDatabase($"historyItemsDb{environment}"
and when i use database.Name it uses a wrong resource identifier for the EventHubDataConnection and then error
ResourceNotFound
will be raised.
t

tall-librarian-49374

06/17/2021, 8:01 PM
Do you know what the correct name should look like and how it’s different? I don’t know these resources unfortunately.
l

limited-carpenter-34991

06/21/2021, 2:10 PM
The database.Name prop does not get back the correct output which i can use for other resources I use then my own string naming through c# standards.
t

tall-librarian-49374

06/21/2021, 2:32 PM
Interesting. But at least you found a workaround that works for you?
l

limited-carpenter-34991

06/21/2021, 2:38 PM
Yes this workaround works for me. I have another thread regarding the kusto.script object
I want to deploy serveral kusto scripts but i get often an 404 during script deployment.
var scripts = System.IO.Directory.GetFiles("./scripts");
        Console.WriteLine($"script len: {scripts.Length}");
        AzureNative.Kusto.Script[] adxScripts = new AzureNative.Kusto.Script[scripts.Length];
        Blob[] blobs = new Blob[scripts.Length];

        for (int i = 0; i < scripts.Length; i++)
        {
            Console.WriteLine($"script {i}: {scripts[i]}");
            blobs[i] = new Blob($"scriptBlop{i + 1}", new BlobArgs
            {
                AccountName = scripStorageAccount.Name,
                ResourceGroupName = resourceGroup,
                Type = BlobType.Block,
                ContainerName = scriptContainer.Name,
                Source = new FileAsset(scripts[i]),
            });

            if (i == 0)
            {
                adxScripts[i] = new AzureNative.Kusto.Script($"script{i + 1}", new AzureNative.Kusto.ScriptArgs
                {
                    ClusterName = adx.Name,
                    ContinueOnErrors = true,
                    DatabaseName = $"historyItemsDb{environment}",
                    ResourceGroupName = resourceGroup,
                    ScriptName = $"script{i + 1}",
                    ScriptUrl = blobs[i].Url,
                    ScriptUrlSasToken = Output.Tuple(resourceGroup, scripStorageAccount.Name).Apply(names =>
                                        Output.CreateSecret(GetStorageAccountPrimaryKey(names.Item1, names.Item2)))
                }, new CustomResourceOptions
                {
                    DependsOn = { blobs[i], database }
                });
            }
            else
            {
                adxScripts[i] = new AzureNative.Kusto.Script($"script{i + 1}", new AzureNative.Kusto.ScriptArgs
                {
                    ClusterName = adx.Name,
                    ContinueOnErrors = true,
                    DatabaseName = $"historyItemsDb{environment}",
                    ResourceGroupName = resourceGroup,
                    ScriptName = $"script{i + 1}",
                    ScriptUrl = blobs[i].Url,
                    ScriptUrlSasToken = Output.Tuple(resourceGroup, scripStorageAccount.Name).Apply(names =>
                                        Output.CreateSecret(GetStorageAccountPrimaryKey(names.Item1, names.Item2)))
                }, new CustomResourceOptions
                {
                    DependsOn = { blobs[i], adxScripts[i - 1] }
                });
            }
        }