Service
Describes an Azure Cognitive Search service and its current state. API Version: 2020-08-01.
Example Usage
SearchCreateOrUpdateService
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.Search.Service("service", new()
{
HostingMode = AzureNative.Search.HostingMode.@Default,
Location = "westus",
PartitionCount = 1,
ReplicaCount = 3,
ResourceGroupName = "rg1",
SearchServiceName = "mysearchservice",
Sku = new AzureNative.Search.Inputs.SkuArgs
{
Name = AzureNative.Search.SkuName.Standard,
},
Tags =
{
{ "app-name", "My e-commerce app" },
},
});
});
package main
import (
search "github.com/pulumi/pulumi-azure-native-sdk/search"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := search.NewService(ctx, "service", &search.ServiceArgs{
HostingMode: search.HostingModeDefault,
Location: pulumi.String("westus"),
PartitionCount: pulumi.Int(1),
ReplicaCount: pulumi.Int(3),
ResourceGroupName: pulumi.String("rg1"),
SearchServiceName: pulumi.String("mysearchservice"),
Sku: &search.SkuArgs{
Name: search.SkuNameStandard,
},
Tags: pulumi.StringMap{
"app-name": pulumi.String("My e-commerce app"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.search.Service;
import com.pulumi.azurenative.search.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.hostingMode("default")
.location("westus")
.partitionCount(1)
.replicaCount(3)
.resourceGroupName("rg1")
.searchServiceName("mysearchservice")
.sku(Map.of("name", "standard"))
.tags(Map.of("app-name", "My e-commerce app"))
.build());
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.Search.Service("service", new()
{
HostingMode = AzureNative.Search.HostingMode.@Default,
Location = "westus",
PartitionCount = 1,
PublicNetworkAccess = AzureNative.Search.PublicNetworkAccess.Disabled,
ReplicaCount = 3,
ResourceGroupName = "rg1",
SearchServiceName = "mysearchservice",
Sku = new AzureNative.Search.Inputs.SkuArgs
{
Name = AzureNative.Search.SkuName.Standard,
},
Tags =
{
{ "app-name", "My e-commerce app" },
},
});
});
package main
import (
search "github.com/pulumi/pulumi-azure-native-sdk/search"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := search.NewService(ctx, "service", &search.ServiceArgs{
HostingMode: search.HostingModeDefault,
Location: pulumi.String("westus"),
PartitionCount: pulumi.Int(1),
PublicNetworkAccess: search.PublicNetworkAccessDisabled,
ReplicaCount: pulumi.Int(3),
ResourceGroupName: pulumi.String("rg1"),
SearchServiceName: pulumi.String("mysearchservice"),
Sku: &search.SkuArgs{
Name: search.SkuNameStandard,
},
Tags: pulumi.StringMap{
"app-name": pulumi.String("My e-commerce app"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.search.Service;
import com.pulumi.azurenative.search.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.hostingMode("default")
.location("westus")
.partitionCount(1)
.publicNetworkAccess("disabled")
.replicaCount(3)
.resourceGroupName("rg1")
.searchServiceName("mysearchservice")
.sku(Map.of("name", "standard"))
.tags(Map.of("app-name", "My e-commerce app"))
.build());
}
}
SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.Search.Service("service", new()
{
HostingMode = AzureNative.Search.HostingMode.@Default,
Location = "westus",
NetworkRuleSet = new AzureNative.Search.Inputs.NetworkRuleSetArgs
{
IpRules = new[]
{
new AzureNative.Search.Inputs.IpRuleArgs
{
Value = "123.4.5.6",
},
new AzureNative.Search.Inputs.IpRuleArgs
{
Value = "123.4.6.0/18",
},
},
},
PartitionCount = 1,
ReplicaCount = 1,
ResourceGroupName = "rg1",
SearchServiceName = "mysearchservice",
Sku = new AzureNative.Search.Inputs.SkuArgs
{
Name = AzureNative.Search.SkuName.Standard,
},
Tags =
{
{ "app-name", "My e-commerce app" },
},
});
});
package main
import (
search "github.com/pulumi/pulumi-azure-native-sdk/search"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := search.NewService(ctx, "service", &search.ServiceArgs{
HostingMode: search.HostingModeDefault,
Location: pulumi.String("westus"),
NetworkRuleSet: search.NetworkRuleSetResponse{
IpRules: search.IpRuleArray{
&search.IpRuleArgs{
Value: pulumi.String("123.4.5.6"),
},
&search.IpRuleArgs{
Value: pulumi.String("123.4.6.0/18"),
},
},
},
PartitionCount: pulumi.Int(1),
ReplicaCount: pulumi.Int(1),
ResourceGroupName: pulumi.String("rg1"),
SearchServiceName: pulumi.String("mysearchservice"),
Sku: &search.SkuArgs{
Name: search.SkuNameStandard,
},
Tags: pulumi.StringMap{
"app-name": pulumi.String("My e-commerce app"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.search.Service;
import com.pulumi.azurenative.search.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.hostingMode("default")
.location("westus")
.networkRuleSet(Map.of("ipRules",
Map.of("value", "123.4.5.6"),
Map.of("value", "123.4.6.0/18")))
.partitionCount(1)
.replicaCount(1)
.resourceGroupName("rg1")
.searchServiceName("mysearchservice")
.sku(Map.of("name", "standard"))
.tags(Map.of("app-name", "My e-commerce app"))
.build());
}
}
SearchCreateOrUpdateServiceWithIdentity
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.Search.Service("service", new()
{
HostingMode = AzureNative.Search.HostingMode.@Default,
Identity = new AzureNative.Search.Inputs.IdentityArgs
{
Type = AzureNative.Search.IdentityType.SystemAssigned,
},
Location = "westus",
PartitionCount = 1,
ReplicaCount = 3,
ResourceGroupName = "rg1",
SearchServiceName = "mysearchservice",
Sku = new AzureNative.Search.Inputs.SkuArgs
{
Name = AzureNative.Search.SkuName.Standard,
},
Tags =
{
{ "app-name", "My e-commerce app" },
},
});
});
package main
import (
search "github.com/pulumi/pulumi-azure-native-sdk/search"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := search.NewService(ctx, "service", &search.ServiceArgs{
HostingMode: search.HostingModeDefault,
Identity: &search.IdentityArgs{
Type: search.IdentityTypeSystemAssigned,
},
Location: pulumi.String("westus"),
PartitionCount: pulumi.Int(1),
ReplicaCount: pulumi.Int(3),
ResourceGroupName: pulumi.String("rg1"),
SearchServiceName: pulumi.String("mysearchservice"),
Sku: &search.SkuArgs{
Name: search.SkuNameStandard,
},
Tags: pulumi.StringMap{
"app-name": pulumi.String("My e-commerce app"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.search.Service;
import com.pulumi.azurenative.search.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.hostingMode("default")
.identity(Map.of("type", "SystemAssigned"))
.location("westus")
.partitionCount(1)
.replicaCount(3)
.resourceGroupName("rg1")
.searchServiceName("mysearchservice")
.sku(Map.of("name", "standard"))
.tags(Map.of("app-name", "My e-commerce app"))
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:search:Service mysearchservice /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice
Properties
Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'.
The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up.
The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned.