1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. WorkloadGroup
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native.sql.WorkloadGroup

Explore with Pulumi AI

Workload group operations for a data warehouse

Uses Azure REST API version 2021-11-01. In version 1.x of the Azure Native provider, it used API version 2020-11-01-preview.

Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01, 2023-08-01-preview, 2024-05-01-preview.

Example Usage

Create a workload group with all properties specified.

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

return await Deployment.RunAsync(() => 
{
    var workloadGroup = new AzureNative.Sql.WorkloadGroup("workloadGroup", new()
    {
        DatabaseName = "testdb",
        Importance = "normal",
        MaxResourcePercent = 100,
        MaxResourcePercentPerRequest = 3,
        MinResourcePercent = 0,
        MinResourcePercentPerRequest = 3,
        QueryExecutionTimeout = 0,
        ResourceGroupName = "Default-SQL-SouthEastAsia",
        ServerName = "testsvr",
        WorkloadGroupName = "smallrc",
    });

});
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewWorkloadGroup(ctx, "workloadGroup", &sql.WorkloadGroupArgs{
			DatabaseName:                 pulumi.String("testdb"),
			Importance:                   pulumi.String("normal"),
			MaxResourcePercent:           pulumi.Int(100),
			MaxResourcePercentPerRequest: pulumi.Float64(3),
			MinResourcePercent:           pulumi.Int(0),
			MinResourcePercentPerRequest: pulumi.Float64(3),
			QueryExecutionTimeout:        pulumi.Int(0),
			ResourceGroupName:            pulumi.String("Default-SQL-SouthEastAsia"),
			ServerName:                   pulumi.String("testsvr"),
			WorkloadGroupName:            pulumi.String("smallrc"),
		})
		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.sql.WorkloadGroup;
import com.pulumi.azurenative.sql.WorkloadGroupArgs;
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 workloadGroup = new WorkloadGroup("workloadGroup", WorkloadGroupArgs.builder()
            .databaseName("testdb")
            .importance("normal")
            .maxResourcePercent(100)
            .maxResourcePercentPerRequest(3)
            .minResourcePercent(0)
            .minResourcePercentPerRequest(3)
            .queryExecutionTimeout(0)
            .resourceGroupName("Default-SQL-SouthEastAsia")
            .serverName("testsvr")
            .workloadGroupName("smallrc")
            .build());

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

const workloadGroup = new azure_native.sql.WorkloadGroup("workloadGroup", {
    databaseName: "testdb",
    importance: "normal",
    maxResourcePercent: 100,
    maxResourcePercentPerRequest: 3,
    minResourcePercent: 0,
    minResourcePercentPerRequest: 3,
    queryExecutionTimeout: 0,
    resourceGroupName: "Default-SQL-SouthEastAsia",
    serverName: "testsvr",
    workloadGroupName: "smallrc",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

workload_group = azure_native.sql.WorkloadGroup("workloadGroup",
    database_name="testdb",
    importance="normal",
    max_resource_percent=100,
    max_resource_percent_per_request=3,
    min_resource_percent=0,
    min_resource_percent_per_request=3,
    query_execution_timeout=0,
    resource_group_name="Default-SQL-SouthEastAsia",
    server_name="testsvr",
    workload_group_name="smallrc")
Copy
resources:
  workloadGroup:
    type: azure-native:sql:WorkloadGroup
    properties:
      databaseName: testdb
      importance: normal
      maxResourcePercent: 100
      maxResourcePercentPerRequest: 3
      minResourcePercent: 0
      minResourcePercentPerRequest: 3
      queryExecutionTimeout: 0
      resourceGroupName: Default-SQL-SouthEastAsia
      serverName: testsvr
      workloadGroupName: smallrc
Copy

Create a workload group with the required properties specified.

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

return await Deployment.RunAsync(() => 
{
    var workloadGroup = new AzureNative.Sql.WorkloadGroup("workloadGroup", new()
    {
        DatabaseName = "testdb",
        MaxResourcePercent = 100,
        MinResourcePercent = 0,
        MinResourcePercentPerRequest = 3,
        ResourceGroupName = "Default-SQL-SouthEastAsia",
        ServerName = "testsvr",
        WorkloadGroupName = "smallrc",
    });

});
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewWorkloadGroup(ctx, "workloadGroup", &sql.WorkloadGroupArgs{
			DatabaseName:                 pulumi.String("testdb"),
			MaxResourcePercent:           pulumi.Int(100),
			MinResourcePercent:           pulumi.Int(0),
			MinResourcePercentPerRequest: pulumi.Float64(3),
			ResourceGroupName:            pulumi.String("Default-SQL-SouthEastAsia"),
			ServerName:                   pulumi.String("testsvr"),
			WorkloadGroupName:            pulumi.String("smallrc"),
		})
		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.sql.WorkloadGroup;
import com.pulumi.azurenative.sql.WorkloadGroupArgs;
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 workloadGroup = new WorkloadGroup("workloadGroup", WorkloadGroupArgs.builder()
            .databaseName("testdb")
            .maxResourcePercent(100)
            .minResourcePercent(0)
            .minResourcePercentPerRequest(3)
            .resourceGroupName("Default-SQL-SouthEastAsia")
            .serverName("testsvr")
            .workloadGroupName("smallrc")
            .build());

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

const workloadGroup = new azure_native.sql.WorkloadGroup("workloadGroup", {
    databaseName: "testdb",
    maxResourcePercent: 100,
    minResourcePercent: 0,
    minResourcePercentPerRequest: 3,
    resourceGroupName: "Default-SQL-SouthEastAsia",
    serverName: "testsvr",
    workloadGroupName: "smallrc",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

workload_group = azure_native.sql.WorkloadGroup("workloadGroup",
    database_name="testdb",
    max_resource_percent=100,
    min_resource_percent=0,
    min_resource_percent_per_request=3,
    resource_group_name="Default-SQL-SouthEastAsia",
    server_name="testsvr",
    workload_group_name="smallrc")
Copy
resources:
  workloadGroup:
    type: azure-native:sql:WorkloadGroup
    properties:
      databaseName: testdb
      maxResourcePercent: 100
      minResourcePercent: 0
      minResourcePercentPerRequest: 3
      resourceGroupName: Default-SQL-SouthEastAsia
      serverName: testsvr
      workloadGroupName: smallrc
Copy

Create WorkloadGroup Resource

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

Constructor syntax

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

@overload
def WorkloadGroup(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  database_name: Optional[str] = None,
                  max_resource_percent: Optional[int] = None,
                  min_resource_percent: Optional[int] = None,
                  min_resource_percent_per_request: Optional[float] = None,
                  resource_group_name: Optional[str] = None,
                  server_name: Optional[str] = None,
                  importance: Optional[str] = None,
                  max_resource_percent_per_request: Optional[float] = None,
                  query_execution_timeout: Optional[int] = None,
                  workload_group_name: Optional[str] = None)
func NewWorkloadGroup(ctx *Context, name string, args WorkloadGroupArgs, opts ...ResourceOption) (*WorkloadGroup, error)
public WorkloadGroup(string name, WorkloadGroupArgs args, CustomResourceOptions? opts = null)
public WorkloadGroup(String name, WorkloadGroupArgs args)
public WorkloadGroup(String name, WorkloadGroupArgs args, CustomResourceOptions options)
type: azure-native:sql:WorkloadGroup
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. WorkloadGroupArgs
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. WorkloadGroupArgs
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. WorkloadGroupArgs
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. WorkloadGroupArgs
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. WorkloadGroupArgs
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 workloadGroupResource = new AzureNative.Sql.WorkloadGroup("workloadGroupResource", new()
{
    DatabaseName = "string",
    MaxResourcePercent = 0,
    MinResourcePercent = 0,
    MinResourcePercentPerRequest = 0,
    ResourceGroupName = "string",
    ServerName = "string",
    Importance = "string",
    MaxResourcePercentPerRequest = 0,
    QueryExecutionTimeout = 0,
    WorkloadGroupName = "string",
});
Copy
example, err := sql.NewWorkloadGroup(ctx, "workloadGroupResource", &sql.WorkloadGroupArgs{
	DatabaseName:                 pulumi.String("string"),
	MaxResourcePercent:           pulumi.Int(0),
	MinResourcePercent:           pulumi.Int(0),
	MinResourcePercentPerRequest: pulumi.Float64(0),
	ResourceGroupName:            pulumi.String("string"),
	ServerName:                   pulumi.String("string"),
	Importance:                   pulumi.String("string"),
	MaxResourcePercentPerRequest: pulumi.Float64(0),
	QueryExecutionTimeout:        pulumi.Int(0),
	WorkloadGroupName:            pulumi.String("string"),
})
Copy
var workloadGroupResource = new WorkloadGroup("workloadGroupResource", WorkloadGroupArgs.builder()
    .databaseName("string")
    .maxResourcePercent(0)
    .minResourcePercent(0)
    .minResourcePercentPerRequest(0)
    .resourceGroupName("string")
    .serverName("string")
    .importance("string")
    .maxResourcePercentPerRequest(0)
    .queryExecutionTimeout(0)
    .workloadGroupName("string")
    .build());
Copy
workload_group_resource = azure_native.sql.WorkloadGroup("workloadGroupResource",
    database_name="string",
    max_resource_percent=0,
    min_resource_percent=0,
    min_resource_percent_per_request=0,
    resource_group_name="string",
    server_name="string",
    importance="string",
    max_resource_percent_per_request=0,
    query_execution_timeout=0,
    workload_group_name="string")
Copy
const workloadGroupResource = new azure_native.sql.WorkloadGroup("workloadGroupResource", {
    databaseName: "string",
    maxResourcePercent: 0,
    minResourcePercent: 0,
    minResourcePercentPerRequest: 0,
    resourceGroupName: "string",
    serverName: "string",
    importance: "string",
    maxResourcePercentPerRequest: 0,
    queryExecutionTimeout: 0,
    workloadGroupName: "string",
});
Copy
type: azure-native:sql:WorkloadGroup
properties:
    databaseName: string
    importance: string
    maxResourcePercent: 0
    maxResourcePercentPerRequest: 0
    minResourcePercent: 0
    minResourcePercentPerRequest: 0
    queryExecutionTimeout: 0
    resourceGroupName: string
    serverName: string
    workloadGroupName: string
Copy

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

DatabaseName
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
MaxResourcePercent This property is required. int
The workload group cap percentage resource.
MinResourcePercent This property is required. int
The workload group minimum percentage resource.
MinResourcePercentPerRequest This property is required. double
The workload group request minimum grant percentage.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Importance string
The workload group importance level.
MaxResourcePercentPerRequest double
The workload group request maximum grant percentage.
QueryExecutionTimeout int
The workload group query execution timeout.
WorkloadGroupName Changes to this property will trigger replacement. string
The name of the workload group.
DatabaseName
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
MaxResourcePercent This property is required. int
The workload group cap percentage resource.
MinResourcePercent This property is required. int
The workload group minimum percentage resource.
MinResourcePercentPerRequest This property is required. float64
The workload group request minimum grant percentage.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Importance string
The workload group importance level.
MaxResourcePercentPerRequest float64
The workload group request maximum grant percentage.
QueryExecutionTimeout int
The workload group query execution timeout.
WorkloadGroupName Changes to this property will trigger replacement. string
The name of the workload group.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
The name of the database.
maxResourcePercent This property is required. Integer
The workload group cap percentage resource.
minResourcePercent This property is required. Integer
The workload group minimum percentage resource.
minResourcePercentPerRequest This property is required. Double
The workload group request minimum grant percentage.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
importance String
The workload group importance level.
maxResourcePercentPerRequest Double
The workload group request maximum grant percentage.
queryExecutionTimeout Integer
The workload group query execution timeout.
workloadGroupName Changes to this property will trigger replacement. String
The name of the workload group.
databaseName
This property is required.
Changes to this property will trigger replacement.
string
The name of the database.
maxResourcePercent This property is required. number
The workload group cap percentage resource.
minResourcePercent This property is required. number
The workload group minimum percentage resource.
minResourcePercentPerRequest This property is required. number
The workload group request minimum grant percentage.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
importance string
The workload group importance level.
maxResourcePercentPerRequest number
The workload group request maximum grant percentage.
queryExecutionTimeout number
The workload group query execution timeout.
workloadGroupName Changes to this property will trigger replacement. string
The name of the workload group.
database_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the database.
max_resource_percent This property is required. int
The workload group cap percentage resource.
min_resource_percent This property is required. int
The workload group minimum percentage resource.
min_resource_percent_per_request This property is required. float
The workload group request minimum grant percentage.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
server_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
importance str
The workload group importance level.
max_resource_percent_per_request float
The workload group request maximum grant percentage.
query_execution_timeout int
The workload group query execution timeout.
workload_group_name Changes to this property will trigger replacement. str
The name of the workload group.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
The name of the database.
maxResourcePercent This property is required. Number
The workload group cap percentage resource.
minResourcePercent This property is required. Number
The workload group minimum percentage resource.
minResourcePercentPerRequest This property is required. Number
The workload group request minimum grant percentage.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
importance String
The workload group importance level.
maxResourcePercentPerRequest Number
The workload group request maximum grant percentage.
queryExecutionTimeout Number
The workload group query execution timeout.
workloadGroupName Changes to this property will trigger replacement. String
The name of the workload group.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name.
type string
Resource type.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name.
type str
Resource type.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.

Import

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

$ pulumi import azure-native:sql:WorkloadGroup smallrc /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName} 
Copy

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

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0