This message was deleted.
# azure
s
This message was deleted.
t
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
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
Do you know what the correct name should look like and how it’s different? I don’t know these resources unfortunately.
l
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
Interesting. But at least you found a workaround that works for you?
l
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.
Copy code
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] }
                });
            }
        }