ScriptArgs

data class ScriptArgs(val continueOnErrorsEnabled: Output<Boolean>? = null, val databaseId: Output<String>? = null, val forceAnUpdateWhenValueChanged: Output<String>? = null, val name: Output<String>? = null, val sasToken: Output<String>? = null, val scriptContent: Output<String>? = null, val url: Output<String>? = null) : ConvertibleToJava<ScriptArgs>

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

Constructors

Link copied to clipboard
fun ScriptArgs(continueOnErrorsEnabled: Output<Boolean>? = null, databaseId: Output<String>? = null, forceAnUpdateWhenValueChanged: Output<String>? = null, name: Output<String>? = null, sasToken: Output<String>? = null, scriptContent: Output<String>? = null, url: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ScriptArgs

Properties

Link copied to clipboard
val continueOnErrorsEnabled: Output<Boolean>? = null

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

Link copied to clipboard
val databaseId: Output<String>? = null

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 name: Output<String>? = null

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 sasToken: Output<String>? = null

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>? = null

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>? = null

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.