1. Packages
  2. Azure Native v2
  3. API Docs
  4. operationalinsights
  5. SavedSearch
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.operationalinsights.SavedSearch

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

Value object for saved search results. Azure REST API version: 2020-08-01. Prior API version in Azure Native 1.x: 2020-08-01.

Other available API versions: 2023-09-01.

Example Usage

SavedSearchCreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var savedSearch = new AzureNative.OperationalInsights.SavedSearch("savedSearch", new()
    {
        Category = "Saved Search Test Category",
        DisplayName = "Create or Update Saved Search Test",
        FunctionAlias = "heartbeat_func",
        FunctionParameters = "a:int=1",
        Query = "Heartbeat | summarize Count() by Computer | take a",
        ResourceGroupName = "TestRG",
        SavedSearchId = "00000000-0000-0000-0000-00000000000",
        Tags = new[]
        {
            new AzureNative.OperationalInsights.Inputs.TagArgs
            {
                Name = "Group",
                Value = "Computer",
            },
        },
        Version = 2,
        WorkspaceName = "TestWS",
    });

});
Copy
package main

import (
	operationalinsights "github.com/pulumi/pulumi-azure-native-sdk/operationalinsights/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := operationalinsights.NewSavedSearch(ctx, "savedSearch", &operationalinsights.SavedSearchArgs{
			Category:           pulumi.String("Saved Search Test Category"),
			DisplayName:        pulumi.String("Create or Update Saved Search Test"),
			FunctionAlias:      pulumi.String("heartbeat_func"),
			FunctionParameters: pulumi.String("a:int=1"),
			Query:              pulumi.String("Heartbeat | summarize Count() by Computer | take a"),
			ResourceGroupName:  pulumi.String("TestRG"),
			SavedSearchId:      pulumi.String("00000000-0000-0000-0000-00000000000"),
			Tags: operationalinsights.TagArray{
				&operationalinsights.TagArgs{
					Name:  pulumi.String("Group"),
					Value: pulumi.String("Computer"),
				},
			},
			Version:       pulumi.Float64(2),
			WorkspaceName: pulumi.String("TestWS"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.operationalinsights.SavedSearch;
import com.pulumi.azurenative.operationalinsights.SavedSearchArgs;
import com.pulumi.azurenative.operationalinsights.inputs.TagArgs;
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 savedSearch = new SavedSearch("savedSearch", SavedSearchArgs.builder()
            .category("Saved Search Test Category")
            .displayName("Create or Update Saved Search Test")
            .functionAlias("heartbeat_func")
            .functionParameters("a:int=1")
            .query("Heartbeat | summarize Count() by Computer | take a")
            .resourceGroupName("TestRG")
            .savedSearchId("00000000-0000-0000-0000-00000000000")
            .tags(TagArgs.builder()
                .name("Group")
                .value("Computer")
                .build())
            .version(2)
            .workspaceName("TestWS")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const savedSearch = new azure_native.operationalinsights.SavedSearch("savedSearch", {
    category: "Saved Search Test Category",
    displayName: "Create or Update Saved Search Test",
    functionAlias: "heartbeat_func",
    functionParameters: "a:int=1",
    query: "Heartbeat | summarize Count() by Computer | take a",
    resourceGroupName: "TestRG",
    savedSearchId: "00000000-0000-0000-0000-00000000000",
    tags: [{
        name: "Group",
        value: "Computer",
    }],
    version: 2,
    workspaceName: "TestWS",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

saved_search = azure_native.operationalinsights.SavedSearch("savedSearch",
    category="Saved Search Test Category",
    display_name="Create or Update Saved Search Test",
    function_alias="heartbeat_func",
    function_parameters="a:int=1",
    query="Heartbeat | summarize Count() by Computer | take a",
    resource_group_name="TestRG",
    saved_search_id="00000000-0000-0000-0000-00000000000",
    tags=[{
        "name": "Group",
        "value": "Computer",
    }],
    version=2,
    workspace_name="TestWS")
Copy
resources:
  savedSearch:
    type: azure-native:operationalinsights:SavedSearch
    properties:
      category: Saved Search Test Category
      displayName: Create or Update Saved Search Test
      functionAlias: heartbeat_func
      functionParameters: a:int=1
      query: Heartbeat | summarize Count() by Computer | take a
      resourceGroupName: TestRG
      savedSearchId: 00000000-0000-0000-0000-00000000000
      tags:
        - name: Group
          value: Computer
      version: 2
      workspaceName: TestWS
Copy

Create SavedSearch Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SavedSearch(name: string, args: SavedSearchArgs, opts?: CustomResourceOptions);
@overload
def SavedSearch(resource_name: str,
                args: SavedSearchArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def SavedSearch(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                category: Optional[str] = None,
                display_name: Optional[str] = None,
                query: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                workspace_name: Optional[str] = None,
                function_alias: Optional[str] = None,
                function_parameters: Optional[str] = None,
                saved_search_id: Optional[str] = None,
                tags: Optional[Sequence[TagArgs]] = None,
                version: Optional[float] = None)
func NewSavedSearch(ctx *Context, name string, args SavedSearchArgs, opts ...ResourceOption) (*SavedSearch, error)
public SavedSearch(string name, SavedSearchArgs args, CustomResourceOptions? opts = null)
public SavedSearch(String name, SavedSearchArgs args)
public SavedSearch(String name, SavedSearchArgs args, CustomResourceOptions options)
type: azure-native:operationalinsights:SavedSearch
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SavedSearchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SavedSearchArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SavedSearchArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SavedSearchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SavedSearchArgs
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 savedSearchResource = new AzureNative.Operationalinsights.SavedSearch("savedSearchResource", new()
{
    Category = "string",
    DisplayName = "string",
    Query = "string",
    ResourceGroupName = "string",
    WorkspaceName = "string",
    FunctionAlias = "string",
    FunctionParameters = "string",
    SavedSearchId = "string",
    Tags = new[]
    {
        
        {
            { "name", "string" },
            { "value", "string" },
        },
    },
    Version = 0,
});
Copy
example, err := operationalinsights.NewSavedSearch(ctx, "savedSearchResource", &operationalinsights.SavedSearchArgs{
	Category:           "string",
	DisplayName:        "string",
	Query:              "string",
	ResourceGroupName:  "string",
	WorkspaceName:      "string",
	FunctionAlias:      "string",
	FunctionParameters: "string",
	SavedSearchId:      "string",
	Tags: []map[string]interface{}{
		map[string]interface{}{
			"name":  "string",
			"value": "string",
		},
	},
	Version: 0,
})
Copy
var savedSearchResource = new SavedSearch("savedSearchResource", SavedSearchArgs.builder()
    .category("string")
    .displayName("string")
    .query("string")
    .resourceGroupName("string")
    .workspaceName("string")
    .functionAlias("string")
    .functionParameters("string")
    .savedSearchId("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .version(0)
    .build());
Copy
saved_search_resource = azure_native.operationalinsights.SavedSearch("savedSearchResource",
    category=string,
    display_name=string,
    query=string,
    resource_group_name=string,
    workspace_name=string,
    function_alias=string,
    function_parameters=string,
    saved_search_id=string,
    tags=[{
        name: string,
        value: string,
    }],
    version=0)
Copy
const savedSearchResource = new azure_native.operationalinsights.SavedSearch("savedSearchResource", {
    category: "string",
    displayName: "string",
    query: "string",
    resourceGroupName: "string",
    workspaceName: "string",
    functionAlias: "string",
    functionParameters: "string",
    savedSearchId: "string",
    tags: [{
        name: "string",
        value: "string",
    }],
    version: 0,
});
Copy
type: azure-native:operationalinsights:SavedSearch
properties:
    category: string
    displayName: string
    functionAlias: string
    functionParameters: string
    query: string
    resourceGroupName: string
    savedSearchId: string
    tags:
        - name: string
          value: string
    version: 0
    workspaceName: string
Copy

SavedSearch 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 SavedSearch resource accepts the following input properties:

Category This property is required. string
The category of the saved search. This helps the user to find a saved search faster.
DisplayName This property is required. string
Saved search display name.
Query This property is required. string
The query expression for the saved search.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
WorkspaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the workspace.
FunctionAlias string
The function alias if query serves as a function.
FunctionParameters string
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
SavedSearchId Changes to this property will trigger replacement. string
The id of the saved search.
Tags List<Pulumi.AzureNative.OperationalInsights.Inputs.Tag>
The tags attached to the saved search.
Version double
The version number of the query language. The current version is 2 and is the default.
Category This property is required. string
The category of the saved search. This helps the user to find a saved search faster.
DisplayName This property is required. string
Saved search display name.
Query This property is required. string
The query expression for the saved search.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
WorkspaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the workspace.
FunctionAlias string
The function alias if query serves as a function.
FunctionParameters string
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
SavedSearchId Changes to this property will trigger replacement. string
The id of the saved search.
Tags []TagArgs
The tags attached to the saved search.
Version float64
The version number of the query language. The current version is 2 and is the default.
category This property is required. String
The category of the saved search. This helps the user to find a saved search faster.
displayName This property is required. String
Saved search display name.
query This property is required. String
The query expression for the saved search.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
workspaceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the workspace.
functionAlias String
The function alias if query serves as a function.
functionParameters String
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
savedSearchId Changes to this property will trigger replacement. String
The id of the saved search.
tags List<Tag>
The tags attached to the saved search.
version Double
The version number of the query language. The current version is 2 and is the default.
category This property is required. string
The category of the saved search. This helps the user to find a saved search faster.
displayName This property is required. string
Saved search display name.
query This property is required. string
The query expression for the saved search.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
workspaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the workspace.
functionAlias string
The function alias if query serves as a function.
functionParameters string
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
savedSearchId Changes to this property will trigger replacement. string
The id of the saved search.
tags Tag[]
The tags attached to the saved search.
version number
The version number of the query language. The current version is 2 and is the default.
category This property is required. str
The category of the saved search. This helps the user to find a saved search faster.
display_name This property is required. str
Saved search display name.
query This property is required. str
The query expression for the saved search.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
workspace_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the workspace.
function_alias str
The function alias if query serves as a function.
function_parameters str
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
saved_search_id Changes to this property will trigger replacement. str
The id of the saved search.
tags Sequence[TagArgs]
The tags attached to the saved search.
version float
The version number of the query language. The current version is 2 and is the default.
category This property is required. String
The category of the saved search. This helps the user to find a saved search faster.
displayName This property is required. String
Saved search display name.
query This property is required. String
The query expression for the saved search.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
workspaceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the workspace.
functionAlias String
The function alias if query serves as a function.
functionParameters String
The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
savedSearchId Changes to this property will trigger replacement. String
The id of the saved search.
tags List<Property Map>
The tags attached to the saved search.
version Number
The version number of the query language. The current version is 2 and is the default.

Outputs

All input properties are implicitly available as output properties. Additionally, the SavedSearch resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Etag string
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Etag string
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag string
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag str
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag

Supporting Types

Tag
, TagArgs

Name This property is required. string
The tag name.
Value This property is required. string
The tag value.
Name This property is required. string
The tag name.
Value This property is required. string
The tag value.
name This property is required. String
The tag name.
value This property is required. String
The tag value.
name This property is required. string
The tag name.
value This property is required. string
The tag value.
name This property is required. str
The tag name.
value This property is required. str
The tag value.
name This property is required. String
The tag name.
value This property is required. String
The tag value.

TagResponse
, TagResponseArgs

Name This property is required. string
The tag name.
Value This property is required. string
The tag value.
Name This property is required. string
The tag name.
Value This property is required. string
The tag value.
name This property is required. String
The tag name.
value This property is required. String
The tag value.
name This property is required. string
The tag name.
value This property is required. string
The tag value.
name This property is required. str
The tag name.
value This property is required. str
The tag value.
name This property is required. String
The tag name.
value This property is required. String
The tag value.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:operationalinsights:SavedSearch myresource1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi