Script

class Script : KotlinCustomResource

Manages a Kusto Script.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.kusto.Cluster;
import com.pulumi.azure.kusto.ClusterArgs;
import com.pulumi.azure.kusto.inputs.ClusterSkuArgs;
import com.pulumi.azure.kusto.Database;
import com.pulumi.azure.kusto.DatabaseArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Container;
import com.pulumi.azure.storage.ContainerArgs;
import com.pulumi.azure.storage.Blob;
import com.pulumi.azure.storage.BlobArgs;
import com.pulumi.azure.storage.StorageFunctions;
import com.pulumi.azure.storage.inputs.GetAccountBlobContainerSASArgs;
import com.pulumi.azure.storage.inputs.GetAccountBlobContainerSASPermissionsArgs;
import com.pulumi.azure.kusto.Script;
import com.pulumi.azure.kusto.ScriptArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku(ClusterSkuArgs.builder()
.name("Dev(No SLA)_Standard_D11_v2")
.capacity(1)
.build())
.build());
var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.clusterName(exampleCluster.name())
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
.storageAccountName(exampleAccount.name())
.containerAccessType("private")
.build());
var exampleBlob = new Blob("exampleBlob", BlobArgs.builder()
.storageAccountName(exampleAccount.name())
.storageContainerName(exampleContainer.name())
.type("Block")
.sourceContent(".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)")
.build());
final var exampleAccountBlobContainerSAS = StorageFunctions.getAccountBlobContainerSAS(GetAccountBlobContainerSASArgs.builder()
.connectionString(exampleAccount.primaryConnectionString())
.containerName(exampleContainer.name())
.httpsOnly(true)
.start("2017-03-21")
.expiry("2022-03-21")
.permissions(GetAccountBlobContainerSASPermissionsArgs.builder()
.read(true)
.add(false)
.create(false)
.write(true)
.delete(false)
.list(true)
.build())
.build());
var exampleScript = new Script("exampleScript", ScriptArgs.builder()
.databaseId(exampleDatabase.id())
.url(exampleBlob.id())
.sasToken(exampleAccountBlobContainerSAS.applyValue(getAccountBlobContainerSASResult -> getAccountBlobContainerSASResult).applyValue(exampleAccountBlobContainerSAS -> exampleAccountBlobContainerSAS.applyValue(getAccountBlobContainerSASResult -> getAccountBlobContainerSASResult.sas())))
.continueOnErrorsEnabled(true)
.forceAnUpdateWhenValueChanged("first")
.build());
}
}

Import

Kusto Scripts can be imported using the resource id, e.g.

$ pulumi import azure:kusto/script:Script example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/scripts/script1

Properties

Link copied to clipboard

Flag that indicates whether to continue if one of the command fails.

Link copied to clipboard
val databaseId: Output<String>

The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.

Link copied to clipboard

A unique string. If changed the script will be applied again.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sasToken: Output<String>?

The SAS token used to access the script. Must be provided when using scriptUrl property. Changing this forces a new resource to be created.

Link copied to clipboard
val scriptContent: Output<String>?

The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with url and sas_token properties. Changing this forces a new resource to be created.

Link copied to clipboard
val url: Output<String>?

The url to the KQL script blob file. Must not be used together with scriptContent property. Please reference this documentation that describes the commands that are allowed in the script.

Link copied to clipboard
val urn: Output<String>