We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
Manages a Kusto Script.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new Azure.Kusto.ClusterArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = new Azure.Kusto.Inputs.ClusterSkuArgs
{
Name = "Dev(No SLA)_Standard_D11_v2",
Capacity = 1,
},
});
var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new Azure.Kusto.DatabaseArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
ClusterName = exampleCluster.Name,
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleContainer = new Azure.Storage.Container("exampleContainer", new Azure.Storage.ContainerArgs
{
StorageAccountName = exampleAccount.Name,
ContainerAccessType = "private",
});
var exampleBlob = new Azure.Storage.Blob("exampleBlob", new Azure.Storage.BlobArgs
{
StorageAccountName = exampleAccount.Name,
StorageContainerName = exampleContainer.Name,
Type = "Block",
SourceContent = ".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)",
});
var exampleAccountBlobContainerSAS = Azure.Storage.GetAccountBlobContainerSAS.Invoke(new Azure.Storage.GetAccountBlobContainerSASInvokeArgs
{
ConnectionString = exampleAccount.PrimaryConnectionString,
ContainerName = exampleContainer.Name,
HttpsOnly = true,
Start = "2017-03-21",
Expiry = "2022-03-21",
Permissions = new Azure.Storage.Inputs.GetAccountBlobContainerSASPermissionsInputArgs
{
Read = true,
Add = false,
Create = false,
Write = true,
Delete = false,
List = true,
},
});
var exampleScript = new Azure.Kusto.Script("exampleScript", new Azure.Kusto.ScriptArgs
{
DatabaseId = exampleDatabase.Id,
Url = exampleBlob.Id,
SasToken = exampleAccountBlobContainerSAS.Apply(exampleAccountBlobContainerSAS => exampleAccountBlobContainerSAS.Sas),
ContinueOnErrorsEnabled = true,
ForceAnUpdateWhenValueChanged = "first",
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/kusto"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: &kusto.ClusterSkuArgs{
Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"),
Capacity: pulumi.Int(1),
},
})
if err != nil {
return err
}
exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
ClusterName: exampleCluster.Name,
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
StorageAccountName: exampleAccount.Name,
ContainerAccessType: pulumi.String("private"),
})
if err != nil {
return err
}
exampleBlob, err := storage.NewBlob(ctx, "exampleBlob", &storage.BlobArgs{
StorageAccountName: exampleAccount.Name,
StorageContainerName: exampleContainer.Name,
Type: pulumi.String("Block"),
SourceContent: pulumi.String(".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)"),
})
if err != nil {
return err
}
exampleAccountBlobContainerSAS := storage.GetAccountBlobContainerSASOutput(ctx, storage.GetAccountBlobContainerSASOutputArgs{
ConnectionString: exampleAccount.PrimaryConnectionString,
ContainerName: exampleContainer.Name,
HttpsOnly: pulumi.Bool(true),
Start: pulumi.String("2017-03-21"),
Expiry: pulumi.String("2022-03-21"),
Permissions: &storage.GetAccountBlobContainerSASPermissionsArgs{
Read: pulumi.Bool(true),
Add: pulumi.Bool(false),
Create: pulumi.Bool(false),
Write: pulumi.Bool(true),
Delete: pulumi.Bool(false),
List: pulumi.Bool(true),
},
}, nil)
_, err = kusto.NewScript(ctx, "exampleScript", &kusto.ScriptArgs{
DatabaseId: exampleDatabase.ID(),
Url: exampleBlob.ID(),
SasToken: exampleAccountBlobContainerSAS.ApplyT(func(exampleAccountBlobContainerSAS storage.GetAccountBlobContainerSASResult) (string, error) {
return exampleAccountBlobContainerSAS.Sas, nil
}).(pulumi.StringOutput),
ContinueOnErrorsEnabled: pulumi.Bool(true),
ForceAnUpdateWhenValueChanged: pulumi.String("first"),
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleCluster = new azure.kusto.Cluster("exampleCluster", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: {
name: "Dev(No SLA)_Standard_D11_v2",
capacity: 1,
},
});
const exampleDatabase = new azure.kusto.Database("exampleDatabase", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
clusterName: exampleCluster.name,
});
const exampleAccount = new azure.storage.Account("exampleAccount", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleContainer = new azure.storage.Container("exampleContainer", {
storageAccountName: exampleAccount.name,
containerAccessType: "private",
});
const exampleBlob = new azure.storage.Blob("exampleBlob", {
storageAccountName: exampleAccount.name,
storageContainerName: exampleContainer.name,
type: "Block",
sourceContent: ".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)",
});
const exampleAccountBlobContainerSAS = azure.storage.getAccountBlobContainerSASOutput({
connectionString: exampleAccount.primaryConnectionString,
containerName: exampleContainer.name,
httpsOnly: true,
start: "2017-03-21",
expiry: "2022-03-21",
permissions: {
read: true,
add: false,
create: false,
write: true,
"delete": false,
list: true,
},
});
const exampleScript = new azure.kusto.Script("exampleScript", {
databaseId: exampleDatabase.id,
url: exampleBlob.id,
sasToken: exampleAccountBlobContainerSAS.apply(exampleAccountBlobContainerSAS => exampleAccountBlobContainerSAS.sas),
continueOnErrorsEnabled: true,
forceAnUpdateWhenValueChanged: "first",
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_cluster = azure.kusto.Cluster("exampleCluster",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku=azure.kusto.ClusterSkuArgs(
name="Dev(No SLA)_Standard_D11_v2",
capacity=1,
))
example_database = azure.kusto.Database("exampleDatabase",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
cluster_name=example_cluster.name)
example_account = azure.storage.Account("exampleAccount",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
account_tier="Standard",
account_replication_type="LRS")
example_container = azure.storage.Container("exampleContainer",
storage_account_name=example_account.name,
container_access_type="private")
example_blob = azure.storage.Blob("exampleBlob",
storage_account_name=example_account.name,
storage_container_name=example_container.name,
type="Block",
source_content=".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)")
example_account_blob_container_sas = azure.storage.get_account_blob_container_sas_output(connection_string=example_account.primary_connection_string,
container_name=example_container.name,
https_only=True,
start="2017-03-21",
expiry="2022-03-21",
permissions=azure.storage.GetAccountBlobContainerSASPermissionsArgs(
read=True,
add=False,
create=False,
write=True,
delete=False,
list=True,
))
example_script = azure.kusto.Script("exampleScript",
database_id=example_database.id,
url=example_blob.id,
sas_token=example_account_blob_container_sas.sas,
continue_on_errors_enabled=True,
force_an_update_when_value_changed="first")
Example coming soon!
Create Script Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Script(name: string, args: ScriptArgs, opts?: CustomResourceOptions);@overload
def Script(resource_name: str,
args: ScriptArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Script(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_id: Optional[str] = None,
sas_token: Optional[str] = None,
url: Optional[str] = None,
continue_on_errors_enabled: Optional[bool] = None,
force_an_update_when_value_changed: Optional[str] = None,
name: Optional[str] = None)func NewScript(ctx *Context, name string, args ScriptArgs, opts ...ResourceOption) (*Script, error)public Script(string name, ScriptArgs args, CustomResourceOptions? opts = null)
public Script(String name, ScriptArgs args)
public Script(String name, ScriptArgs args, CustomResourceOptions options)
type: azure:kusto:Script
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ScriptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ScriptArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ScriptArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScriptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ScriptArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var scriptResource = new Azure.Kusto.Script("scriptResource", new()
{
DatabaseId = "string",
SasToken = "string",
Url = "string",
ContinueOnErrorsEnabled = false,
ForceAnUpdateWhenValueChanged = "string",
Name = "string",
});
example, err := kusto.NewScript(ctx, "scriptResource", &kusto.ScriptArgs{
DatabaseId: pulumi.String("string"),
SasToken: pulumi.String("string"),
Url: pulumi.String("string"),
ContinueOnErrorsEnabled: pulumi.Bool(false),
ForceAnUpdateWhenValueChanged: pulumi.String("string"),
Name: pulumi.String("string"),
})
var scriptResource = new Script("scriptResource", ScriptArgs.builder()
.databaseId("string")
.sasToken("string")
.url("string")
.continueOnErrorsEnabled(false)
.forceAnUpdateWhenValueChanged("string")
.name("string")
.build());
script_resource = azure.kusto.Script("scriptResource",
database_id="string",
sas_token="string",
url="string",
continue_on_errors_enabled=False,
force_an_update_when_value_changed="string",
name="string")
const scriptResource = new azure.kusto.Script("scriptResource", {
databaseId: "string",
sasToken: "string",
url: "string",
continueOnErrorsEnabled: false,
forceAnUpdateWhenValueChanged: "string",
name: "string",
});
type: azure:kusto:Script
properties:
continueOnErrorsEnabled: false
databaseId: string
forceAnUpdateWhenValueChanged: string
name: string
sasToken: string
url: string
Script Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Script resource accepts the following input properties:
- Database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- Sas
Token string - The SAS token used to access the script.
- Url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- Continue
On boolErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- Force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- Name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- Database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- Sas
Token string - The SAS token used to access the script.
- Url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- Continue
On boolErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- Force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- Name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- database
Id String - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- sas
Token String - The SAS token used to access the script.
- url String
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On BooleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- force
An StringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name String
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- sas
Token string - The SAS token used to access the script.
- url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On booleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- database_
id str - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- sas_
token str - The SAS token used to access the script.
- url str
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue_
on_ boolerrors_ enabled - Flag that indicates whether to continue if one of the command fails.
- force_
an_ strupdate_ when_ value_ changed - A unique string. If changed the script will be applied again.
- name str
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- database
Id String - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- sas
Token String - The SAS token used to access the script.
- url String
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On BooleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- force
An StringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name String
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Script resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Script Resource
Get an existing Script resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ScriptState, opts?: CustomResourceOptions): Script@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
continue_on_errors_enabled: Optional[bool] = None,
database_id: Optional[str] = None,
force_an_update_when_value_changed: Optional[str] = None,
name: Optional[str] = None,
sas_token: Optional[str] = None,
url: Optional[str] = None) -> Scriptfunc GetScript(ctx *Context, name string, id IDInput, state *ScriptState, opts ...ResourceOption) (*Script, error)public static Script Get(string name, Input<string> id, ScriptState? state, CustomResourceOptions? opts = null)public static Script get(String name, Output<String> id, ScriptState state, CustomResourceOptions options)resources: _: type: azure:kusto:Script get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Continue
On boolErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- Database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- Force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- Name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- Sas
Token string - The SAS token used to access the script.
- Url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- Continue
On boolErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- Database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- Force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- Name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- Sas
Token string - The SAS token used to access the script.
- Url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On BooleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- database
Id String - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- force
An StringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name String
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- sas
Token String - The SAS token used to access the script.
- url String
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On booleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- database
Id string - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- force
An stringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name string
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- sas
Token string - The SAS token used to access the script.
- url string
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue_
on_ boolerrors_ enabled - Flag that indicates whether to continue if one of the command fails.
- database_
id str - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- force_
an_ strupdate_ when_ value_ changed - A unique string. If changed the script will be applied again.
- name str
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- sas_
token str - The SAS token used to access the script.
- url str
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
- continue
On BooleanErrors Enabled - Flag that indicates whether to continue if one of the command fails.
- database
Id String - The ID of the Kusto Database. Changing this forces a new Kusto Script to be created.
- force
An StringUpdate When Value Changed - A unique string. If changed the script will be applied again.
- name String
- The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created.
- sas
Token String - The SAS token used to access the script.
- url String
- The url to the KQL script blob file. Please reference this documentation that describes the commands that are allowed in the script.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
