AutoscaleSetting

Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.2.0/24",
        },
    });

    var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        UpgradeMode = "Manual",
        Sku = "Standard_F2",
        Instances = 2,
        AdminUsername = "myadmin",
        AdminSshKeys = new[]
        {
            new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs
            {
                Username = "myadmin",
                PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
            },
        },
        NetworkInterfaces = new[]
        {
            new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs
            {
                Name = "TestNetworkProfile",
                Primary = true,
                IpConfigurations = new[]
                {
                    new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs
                    {
                        Name = "TestIPConfiguration",
                        Primary = true,
                        SubnetId = exampleSubnet.Id,
                    },
                },
            },
        },
        OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs
        {
            Caching = "ReadWrite",
            StorageAccountType = "StandardSSD_LRS",
        },
        SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs
        {
            Publisher = "Canonical",
            Offer = "UbuntuServer",
            Sku = "16.04-LTS",
            Version = "latest",
        },
    });

    var exampleAutoscaleSetting = new Azure.Monitoring.AutoscaleSetting("exampleAutoscaleSetting", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        TargetResourceId = exampleLinuxVirtualMachineScaleSet.Id,
        Profiles = new[]
        {
            new Azure.Monitoring.Inputs.AutoscaleSettingProfileArgs
            {
                Name = "defaultProfile",
                Capacity = new Azure.Monitoring.Inputs.AutoscaleSettingProfileCapacityArgs
                {
                    Default = 1,
                    Minimum = 1,
                    Maximum = 10,
                },
                Rules = new[]
                {
                    new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs
                    {
                        MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs
                        {
                            MetricName = "Percentage CPU",
                            MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id,
                            TimeGrain = "PT1M",
                            Statistic = "Average",
                            TimeWindow = "PT5M",
                            TimeAggregation = "Average",
                            Operator = "GreaterThan",
                            Threshold = 75,
                            MetricNamespace = "microsoft.compute/virtualmachinescalesets",
                            Dimensions = new[]
                            {
                                new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs
                                {
                                    Name = "AppName",
                                    Operator = "Equals",
                                    Values = new[]
                                    {
                                        "App1",
                                    },
                                },
                            },
                        },
                        ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs
                        {
                            Direction = "Increase",
                            Type = "ChangeCount",
                            Value = 1,
                            Cooldown = "PT1M",
                        },
                    },
                    new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs
                    {
                        MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs
                        {
                            MetricName = "Percentage CPU",
                            MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id,
                            TimeGrain = "PT1M",
                            Statistic = "Average",
                            TimeWindow = "PT5M",
                            TimeAggregation = "Average",
                            Operator = "LessThan",
                            Threshold = 25,
                        },
                        ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs
                        {
                            Direction = "Decrease",
                            Type = "ChangeCount",
                            Value = 1,
                            Cooldown = "PT1M",
                        },
                    },
                },
            },
        },
        Notification = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationArgs
        {
            Email = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationEmailArgs
            {
                SendToSubscriptionAdministrator = true,
                SendToSubscriptionCoAdministrator = true,
                CustomEmails = new[]
                {
                    "admin@contoso.com",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
	"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
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.2.0/24"),
			},
		})
		if err != nil {
			return err
		}
		exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			UpgradeMode:       pulumi.String("Manual"),
			Sku:               pulumi.String("Standard_F2"),
			Instances:         pulumi.Int(2),
			AdminUsername:     pulumi.String("myadmin"),
			AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{
				&compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{
					Username:  pulumi.String("myadmin"),
					PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com"),
				},
			},
			NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{
				&compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{
					Name:    pulumi.String("TestNetworkProfile"),
					Primary: pulumi.Bool(true),
					IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{
						&compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{
							Name:     pulumi.String("TestIPConfiguration"),
							Primary:  pulumi.Bool(true),
							SubnetId: exampleSubnet.ID(),
						},
					},
				},
			},
			OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{
				Caching:            pulumi.String("ReadWrite"),
				StorageAccountType: pulumi.String("StandardSSD_LRS"),
			},
			SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{
				Publisher: pulumi.String("Canonical"),
				Offer:     pulumi.String("UbuntuServer"),
				Sku:       pulumi.String("16.04-LTS"),
				Version:   pulumi.String("latest"),
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewAutoscaleSetting(ctx, "exampleAutoscaleSetting", &monitoring.AutoscaleSettingArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			TargetResourceId:  exampleLinuxVirtualMachineScaleSet.ID(),
			Profiles: monitoring.AutoscaleSettingProfileArray{
				&monitoring.AutoscaleSettingProfileArgs{
					Name: pulumi.String("defaultProfile"),
					Capacity: &monitoring.AutoscaleSettingProfileCapacityArgs{
						Default: pulumi.Int(1),
						Minimum: pulumi.Int(1),
						Maximum: pulumi.Int(10),
					},
					Rules: monitoring.AutoscaleSettingProfileRuleArray{
						&monitoring.AutoscaleSettingProfileRuleArgs{
							MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{
								MetricName:       pulumi.String("Percentage CPU"),
								MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(),
								TimeGrain:        pulumi.String("PT1M"),
								Statistic:        pulumi.String("Average"),
								TimeWindow:       pulumi.String("PT5M"),
								TimeAggregation:  pulumi.String("Average"),
								Operator:         pulumi.String("GreaterThan"),
								Threshold:        pulumi.Float64(75),
								MetricNamespace:  pulumi.String("microsoft.compute/virtualmachinescalesets"),
								Dimensions: monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArray{
									&monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs{
										Name:     pulumi.String("AppName"),
										Operator: pulumi.String("Equals"),
										Values: pulumi.StringArray{
											pulumi.String("App1"),
										},
									},
								},
							},
							ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{
								Direction: pulumi.String("Increase"),
								Type:      pulumi.String("ChangeCount"),
								Value:     pulumi.Int(1),
								Cooldown:  pulumi.String("PT1M"),
							},
						},
						&monitoring.AutoscaleSettingProfileRuleArgs{
							MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{
								MetricName:       pulumi.String("Percentage CPU"),
								MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(),
								TimeGrain:        pulumi.String("PT1M"),
								Statistic:        pulumi.String("Average"),
								TimeWindow:       pulumi.String("PT5M"),
								TimeAggregation:  pulumi.String("Average"),
								Operator:         pulumi.String("LessThan"),
								Threshold:        pulumi.Float64(25),
							},
							ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{
								Direction: pulumi.String("Decrease"),
								Type:      pulumi.String("ChangeCount"),
								Value:     pulumi.Int(1),
								Cooldown:  pulumi.String("PT1M"),
							},
						},
					},
				},
			},
			Notification: &monitoring.AutoscaleSettingNotificationArgs{
				Email: &monitoring.AutoscaleSettingNotificationEmailArgs{
					SendToSubscriptionAdministrator:   pulumi.Bool(true),
					SendToSubscriptionCoAdministrator: pulumi.Bool(true),
					CustomEmails: pulumi.StringArray{
						pulumi.String("admin@contoso.com"),
					},
				},
			},
		})
		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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSet;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSetArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetOsDiskArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs;
import com.pulumi.azure.monitoring.AutoscaleSetting;
import com.pulumi.azure.monitoring.AutoscaleSettingArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileCapacityArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationEmailArgs;
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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.2.0/24")
            .build());

        var exampleLinuxVirtualMachineScaleSet = new LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", LinuxVirtualMachineScaleSetArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .upgradeMode("Manual")
            .sku("Standard_F2")
            .instances(2)
            .adminUsername("myadmin")
            .adminSshKeys(LinuxVirtualMachineScaleSetAdminSshKeyArgs.builder()
                .username("myadmin")
                .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com")
                .build())
            .networkInterfaces(LinuxVirtualMachineScaleSetNetworkInterfaceArgs.builder()
                .name("TestNetworkProfile")
                .primary(true)
                .ipConfigurations(LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs.builder()
                    .name("TestIPConfiguration")
                    .primary(true)
                    .subnetId(exampleSubnet.id())
                    .build())
                .build())
            .osDisk(LinuxVirtualMachineScaleSetOsDiskArgs.builder()
                .caching("ReadWrite")
                .storageAccountType("StandardSSD_LRS")
                .build())
            .sourceImageReference(LinuxVirtualMachineScaleSetSourceImageReferenceArgs.builder()
                .publisher("Canonical")
                .offer("UbuntuServer")
                .sku("16.04-LTS")
                .version("latest")
                .build())
            .build());

        var exampleAutoscaleSetting = new AutoscaleSetting("exampleAutoscaleSetting", AutoscaleSettingArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .targetResourceId(exampleLinuxVirtualMachineScaleSet.id())
            .profiles(AutoscaleSettingProfileArgs.builder()
                .name("defaultProfile")
                .capacity(AutoscaleSettingProfileCapacityArgs.builder()
                    .default_(1)
                    .minimum(1)
                    .maximum(10)
                    .build())
                .rules(                
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("GreaterThan")
                            .threshold(75)
                            .metricNamespace("microsoft.compute/virtualmachinescalesets")
                            .dimensions(AutoscaleSettingProfileRuleMetricTriggerDimensionArgs.builder()
                                .name("AppName")
                                .operator("Equals")
                                .values("App1")
                                .build())
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Increase")
                            .type("ChangeCount")
                            .value("1")
                            .cooldown("PT1M")
                            .build())
                        .build(),
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("LessThan")
                            .threshold(25)
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Decrease")
                            .type("ChangeCount")
                            .value("1")
                            .cooldown("PT1M")
                            .build())
                        .build())
                .build())
            .notification(AutoscaleSettingNotificationArgs.builder()
                .email(AutoscaleSettingNotificationEmailArgs.builder()
                    .sendToSubscriptionAdministrator(true)
                    .sendToSubscriptionCoAdministrator(true)
                    .customEmails("admin@contoso.com")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.2.0/24"])
example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    upgrade_mode="Manual",
    sku="Standard_F2",
    instances=2,
    admin_username="myadmin",
    admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs(
        username="myadmin",
        public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
    )],
    network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs(
        name="TestNetworkProfile",
        primary=True,
        ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs(
            name="TestIPConfiguration",
            primary=True,
            subnet_id=example_subnet.id,
        )],
    )],
    os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs(
        caching="ReadWrite",
        storage_account_type="StandardSSD_LRS",
    ),
    source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs(
        publisher="Canonical",
        offer="UbuntuServer",
        sku="16.04-LTS",
        version="latest",
    ))
example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    target_resource_id=example_linux_virtual_machine_scale_set.id,
    profiles=[azure.monitoring.AutoscaleSettingProfileArgs(
        name="defaultProfile",
        capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs(
            default=1,
            minimum=1,
            maximum=10,
        ),
        rules=[
            azure.monitoring.AutoscaleSettingProfileRuleArgs(
                metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs(
                    metric_name="Percentage CPU",
                    metric_resource_id=example_linux_virtual_machine_scale_set.id,
                    time_grain="PT1M",
                    statistic="Average",
                    time_window="PT5M",
                    time_aggregation="Average",
                    operator="GreaterThan",
                    threshold=75,
                    metric_namespace="microsoft.compute/virtualmachinescalesets",
                    dimensions=[azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs(
                        name="AppName",
                        operator="Equals",
                        values=["App1"],
                    )],
                ),
                scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs(
                    direction="Increase",
                    type="ChangeCount",
                    value=1,
                    cooldown="PT1M",
                ),
            ),
            azure.monitoring.AutoscaleSettingProfileRuleArgs(
                metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs(
                    metric_name="Percentage CPU",
                    metric_resource_id=example_linux_virtual_machine_scale_set.id,
                    time_grain="PT1M",
                    statistic="Average",
                    time_window="PT5M",
                    time_aggregation="Average",
                    operator="LessThan",
                    threshold=25,
                ),
                scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs(
                    direction="Decrease",
                    type="ChangeCount",
                    value=1,
                    cooldown="PT1M",
                ),
            ),
        ],
    )],
    notification=azure.monitoring.AutoscaleSettingNotificationArgs(
        email=azure.monitoring.AutoscaleSettingNotificationEmailArgs(
            send_to_subscription_administrator=True,
            send_to_subscription_co_administrator=True,
            custom_emails=["admin@contoso.com"],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.2.0/24"],
});
const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    upgradeMode: "Manual",
    sku: "Standard_F2",
    instances: 2,
    adminUsername: "myadmin",
    adminSshKeys: [{
        username: "myadmin",
        publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
    }],
    networkInterfaces: [{
        name: "TestNetworkProfile",
        primary: true,
        ipConfigurations: [{
            name: "TestIPConfiguration",
            primary: true,
            subnetId: exampleSubnet.id,
        }],
    }],
    osDisk: {
        caching: "ReadWrite",
        storageAccountType: "StandardSSD_LRS",
    },
    sourceImageReference: {
        publisher: "Canonical",
        offer: "UbuntuServer",
        sku: "16.04-LTS",
        version: "latest",
    },
});
const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    targetResourceId: exampleLinuxVirtualMachineScaleSet.id,
    profiles: [{
        name: "defaultProfile",
        capacity: {
            "default": 1,
            minimum: 1,
            maximum: 10,
        },
        rules: [
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
                    timeGrain: "PT1M",
                    statistic: "Average",
                    timeWindow: "PT5M",
                    timeAggregation: "Average",
                    operator: "GreaterThan",
                    threshold: 75,
                    metricNamespace: "microsoft.compute/virtualmachinescalesets",
                    dimensions: [{
                        name: "AppName",
                        operator: "Equals",
                        values: ["App1"],
                    }],
                },
                scaleAction: {
                    direction: "Increase",
                    type: "ChangeCount",
                    value: 1,
                    cooldown: "PT1M",
                },
            },
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
                    timeGrain: "PT1M",
                    statistic: "Average",
                    timeWindow: "PT5M",
                    timeAggregation: "Average",
                    operator: "LessThan",
                    threshold: 25,
                },
                scaleAction: {
                    direction: "Decrease",
                    type: "ChangeCount",
                    value: 1,
                    cooldown: "PT1M",
                },
            },
        ],
    }],
    notification: {
        email: {
            sendToSubscriptionAdministrator: true,
            sendToSubscriptionCoAdministrator: true,
            customEmails: ["admin@contoso.com"],
        },
    },
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.2.0/24
  exampleLinuxVirtualMachineScaleSet:
    type: azure:compute:LinuxVirtualMachineScaleSet
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      upgradeMode: Manual
      sku: Standard_F2
      instances: 2
      adminUsername: myadmin
      adminSshKeys:
        - username: myadmin
          publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com
      networkInterfaces:
        - name: TestNetworkProfile
          primary: true
          ipConfigurations:
            - name: TestIPConfiguration
              primary: true
              subnetId: ${exampleSubnet.id}
      osDisk:
        caching: ReadWrite
        storageAccountType: StandardSSD_LRS
      sourceImageReference:
        publisher: Canonical
        offer: UbuntuServer
        sku: 16.04-LTS
        version: latest
  exampleAutoscaleSetting:
    type: azure:monitoring:AutoscaleSetting
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      targetResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
      profiles:
        - name: defaultProfile
          capacity:
            default: 1
            minimum: 1
            maximum: 10
          rules:
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: GreaterThan
                threshold: 75
                metricNamespace: microsoft.compute/virtualmachinescalesets
                dimensions:
                  - name: AppName
                    operator: Equals
                    values:
                      - App1
              scaleAction:
                direction: Increase
                type: ChangeCount
                value: 1
                cooldown: PT1M
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: LessThan
                threshold: 25
              scaleAction:
                direction: Decrease
                type: ChangeCount
                value: 1
                cooldown: PT1M
      notification:
        email:
          sendToSubscriptionAdministrator: true
          sendToSubscriptionCoAdministrator: true
          customEmails:
            - admin@contoso.com

Repeating On Weekends)

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.2.0/24",
        },
    });

    var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        UpgradeMode = "Manual",
        Sku = "Standard_F2",
        Instances = 2,
        AdminUsername = "myadmin",
        AdminSshKeys = new[]
        {
            new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs
            {
                Username = "myadmin",
                PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
            },
        },
        NetworkInterfaces = new[]
        {
            new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs
            {
                Name = "TestNetworkProfile",
                Primary = true,
                IpConfigurations = new[]
                {
                    new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs
                    {
                        Name = "TestIPConfiguration",
                        Primary = true,
                        SubnetId = exampleSubnet.Id,
                    },
                },
            },
        },
        OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs
        {
            Caching = "ReadWrite",
            StorageAccountType = "StandardSSD_LRS",
        },
        SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs
        {
            Publisher = "Canonical",
            Offer = "UbuntuServer",
            Sku = "16.04-LTS",
            Version = "latest",
        },
    });

    var exampleAutoscaleSetting = new Azure.Monitoring.AutoscaleSetting("exampleAutoscaleSetting", new()
    {
        Enabled = true,
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        TargetResourceId = exampleLinuxVirtualMachineScaleSet.Id,
        Profiles = new[]
        {
            new Azure.Monitoring.Inputs.AutoscaleSettingProfileArgs
            {
                Name = "forJuly",
                Capacity = new Azure.Monitoring.Inputs.AutoscaleSettingProfileCapacityArgs
                {
                    Default = 1,
                    Minimum = 1,
                    Maximum = 10,
                },
                Rules = new[]
                {
                    new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs
                    {
                        MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs
                        {
                            MetricName = "Percentage CPU",
                            MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id,
                            TimeGrain = "PT1M",
                            Statistic = "Average",
                            TimeWindow = "PT5M",
                            TimeAggregation = "Average",
                            Operator = "GreaterThan",
                            Threshold = 90,
                        },
                        ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs
                        {
                            Direction = "Increase",
                            Type = "ChangeCount",
                            Value = 2,
                            Cooldown = "PT1M",
                        },
                    },
                    new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs
                    {
                        MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs
                        {
                            MetricName = "Percentage CPU",
                            MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id,
                            TimeGrain = "PT1M",
                            Statistic = "Average",
                            TimeWindow = "PT5M",
                            TimeAggregation = "Average",
                            Operator = "LessThan",
                            Threshold = 10,
                        },
                        ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs
                        {
                            Direction = "Decrease",
                            Type = "ChangeCount",
                            Value = 2,
                            Cooldown = "PT1M",
                        },
                    },
                },
                FixedDate = new Azure.Monitoring.Inputs.AutoscaleSettingProfileFixedDateArgs
                {
                    Timezone = "Pacific Standard Time",
                    Start = "2020-07-01T00:00:00Z",
                    End = "2020-07-31T23:59:59Z",
                },
            },
        },
        Notification = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationArgs
        {
            Email = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationEmailArgs
            {
                SendToSubscriptionAdministrator = true,
                SendToSubscriptionCoAdministrator = true,
                CustomEmails = new[]
                {
                    "admin@contoso.com",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
	"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
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.2.0/24"),
			},
		})
		if err != nil {
			return err
		}
		exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			UpgradeMode:       pulumi.String("Manual"),
			Sku:               pulumi.String("Standard_F2"),
			Instances:         pulumi.Int(2),
			AdminUsername:     pulumi.String("myadmin"),
			AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{
				&compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{
					Username:  pulumi.String("myadmin"),
					PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com"),
				},
			},
			NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{
				&compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{
					Name:    pulumi.String("TestNetworkProfile"),
					Primary: pulumi.Bool(true),
					IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{
						&compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{
							Name:     pulumi.String("TestIPConfiguration"),
							Primary:  pulumi.Bool(true),
							SubnetId: exampleSubnet.ID(),
						},
					},
				},
			},
			OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{
				Caching:            pulumi.String("ReadWrite"),
				StorageAccountType: pulumi.String("StandardSSD_LRS"),
			},
			SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{
				Publisher: pulumi.String("Canonical"),
				Offer:     pulumi.String("UbuntuServer"),
				Sku:       pulumi.String("16.04-LTS"),
				Version:   pulumi.String("latest"),
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewAutoscaleSetting(ctx, "exampleAutoscaleSetting", &monitoring.AutoscaleSettingArgs{
			Enabled:           pulumi.Bool(true),
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			TargetResourceId:  exampleLinuxVirtualMachineScaleSet.ID(),
			Profiles: monitoring.AutoscaleSettingProfileArray{
				&monitoring.AutoscaleSettingProfileArgs{
					Name: pulumi.String("forJuly"),
					Capacity: &monitoring.AutoscaleSettingProfileCapacityArgs{
						Default: pulumi.Int(1),
						Minimum: pulumi.Int(1),
						Maximum: pulumi.Int(10),
					},
					Rules: monitoring.AutoscaleSettingProfileRuleArray{
						&monitoring.AutoscaleSettingProfileRuleArgs{
							MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{
								MetricName:       pulumi.String("Percentage CPU"),
								MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(),
								TimeGrain:        pulumi.String("PT1M"),
								Statistic:        pulumi.String("Average"),
								TimeWindow:       pulumi.String("PT5M"),
								TimeAggregation:  pulumi.String("Average"),
								Operator:         pulumi.String("GreaterThan"),
								Threshold:        pulumi.Float64(90),
							},
							ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{
								Direction: pulumi.String("Increase"),
								Type:      pulumi.String("ChangeCount"),
								Value:     pulumi.Int(2),
								Cooldown:  pulumi.String("PT1M"),
							},
						},
						&monitoring.AutoscaleSettingProfileRuleArgs{
							MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{
								MetricName:       pulumi.String("Percentage CPU"),
								MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(),
								TimeGrain:        pulumi.String("PT1M"),
								Statistic:        pulumi.String("Average"),
								TimeWindow:       pulumi.String("PT5M"),
								TimeAggregation:  pulumi.String("Average"),
								Operator:         pulumi.String("LessThan"),
								Threshold:        pulumi.Float64(10),
							},
							ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{
								Direction: pulumi.String("Decrease"),
								Type:      pulumi.String("ChangeCount"),
								Value:     pulumi.Int(2),
								Cooldown:  pulumi.String("PT1M"),
							},
						},
					},
					FixedDate: &monitoring.AutoscaleSettingProfileFixedDateArgs{
						Timezone: pulumi.String("Pacific Standard Time"),
						Start:    pulumi.String("2020-07-01T00:00:00Z"),
						End:      pulumi.String("2020-07-31T23:59:59Z"),
					},
				},
			},
			Notification: &monitoring.AutoscaleSettingNotificationArgs{
				Email: &monitoring.AutoscaleSettingNotificationEmailArgs{
					SendToSubscriptionAdministrator:   pulumi.Bool(true),
					SendToSubscriptionCoAdministrator: pulumi.Bool(true),
					CustomEmails: pulumi.StringArray{
						pulumi.String("admin@contoso.com"),
					},
				},
			},
		})
		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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSet;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSetArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetOsDiskArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs;
import com.pulumi.azure.monitoring.AutoscaleSetting;
import com.pulumi.azure.monitoring.AutoscaleSettingArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileCapacityArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileRecurrenceArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationEmailArgs;
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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.2.0/24")
            .build());

        var exampleLinuxVirtualMachineScaleSet = new LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", LinuxVirtualMachineScaleSetArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .upgradeMode("Manual")
            .sku("Standard_F2")
            .instances(2)
            .adminUsername("myadmin")
            .adminSshKeys(LinuxVirtualMachineScaleSetAdminSshKeyArgs.builder()
                .username("myadmin")
                .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com")
                .build())
            .networkInterfaces(LinuxVirtualMachineScaleSetNetworkInterfaceArgs.builder()
                .name("TestNetworkProfile")
                .primary(true)
                .ipConfigurations(LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs.builder()
                    .name("TestIPConfiguration")
                    .primary(true)
                    .subnetId(exampleSubnet.id())
                    .build())
                .build())
            .osDisk(LinuxVirtualMachineScaleSetOsDiskArgs.builder()
                .caching("ReadWrite")
                .storageAccountType("StandardSSD_LRS")
                .build())
            .sourceImageReference(LinuxVirtualMachineScaleSetSourceImageReferenceArgs.builder()
                .publisher("Canonical")
                .offer("UbuntuServer")
                .sku("16.04-LTS")
                .version("latest")
                .build())
            .build());

        var exampleAutoscaleSetting = new AutoscaleSetting("exampleAutoscaleSetting", AutoscaleSettingArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .targetResourceId(exampleLinuxVirtualMachineScaleSet.id())
            .profiles(AutoscaleSettingProfileArgs.builder()
                .name("Weekends")
                .capacity(AutoscaleSettingProfileCapacityArgs.builder()
                    .default_(1)
                    .minimum(1)
                    .maximum(10)
                    .build())
                .rules(                
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("GreaterThan")
                            .threshold(90)
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Increase")
                            .type("ChangeCount")
                            .value("2")
                            .cooldown("PT1M")
                            .build())
                        .build(),
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("LessThan")
                            .threshold(10)
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Decrease")
                            .type("ChangeCount")
                            .value("2")
                            .cooldown("PT1M")
                            .build())
                        .build())
                .recurrence(AutoscaleSettingProfileRecurrenceArgs.builder()
                    .timezone("Pacific Standard Time")
                    .days(                    
                        "Saturday",
                        "Sunday")
                    .hours(12)
                    .minutes(0)
                    .build())
                .build())
            .notification(AutoscaleSettingNotificationArgs.builder()
                .email(AutoscaleSettingNotificationEmailArgs.builder()
                    .sendToSubscriptionAdministrator(true)
                    .sendToSubscriptionCoAdministrator(true)
                    .customEmails("admin@contoso.com")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.2.0/24"])
example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    upgrade_mode="Manual",
    sku="Standard_F2",
    instances=2,
    admin_username="myadmin",
    admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs(
        username="myadmin",
        public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
    )],
    network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs(
        name="TestNetworkProfile",
        primary=True,
        ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs(
            name="TestIPConfiguration",
            primary=True,
            subnet_id=example_subnet.id,
        )],
    )],
    os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs(
        caching="ReadWrite",
        storage_account_type="StandardSSD_LRS",
    ),
    source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs(
        publisher="Canonical",
        offer="UbuntuServer",
        sku="16.04-LTS",
        version="latest",
    ))
example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting",
    enabled=True,
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    target_resource_id=example_linux_virtual_machine_scale_set.id,
    profiles=[azure.monitoring.AutoscaleSettingProfileArgs(
        name="forJuly",
        capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs(
            default=1,
            minimum=1,
            maximum=10,
        ),
        rules=[
            azure.monitoring.AutoscaleSettingProfileRuleArgs(
                metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs(
                    metric_name="Percentage CPU",
                    metric_resource_id=example_linux_virtual_machine_scale_set.id,
                    time_grain="PT1M",
                    statistic="Average",
                    time_window="PT5M",
                    time_aggregation="Average",
                    operator="GreaterThan",
                    threshold=90,
                ),
                scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs(
                    direction="Increase",
                    type="ChangeCount",
                    value=2,
                    cooldown="PT1M",
                ),
            ),
            azure.monitoring.AutoscaleSettingProfileRuleArgs(
                metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs(
                    metric_name="Percentage CPU",
                    metric_resource_id=example_linux_virtual_machine_scale_set.id,
                    time_grain="PT1M",
                    statistic="Average",
                    time_window="PT5M",
                    time_aggregation="Average",
                    operator="LessThan",
                    threshold=10,
                ),
                scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs(
                    direction="Decrease",
                    type="ChangeCount",
                    value=2,
                    cooldown="PT1M",
                ),
            ),
        ],
        fixed_date=azure.monitoring.AutoscaleSettingProfileFixedDateArgs(
            timezone="Pacific Standard Time",
            start="2020-07-01T00:00:00Z",
            end="2020-07-31T23:59:59Z",
        ),
    )],
    notification=azure.monitoring.AutoscaleSettingNotificationArgs(
        email=azure.monitoring.AutoscaleSettingNotificationEmailArgs(
            send_to_subscription_administrator=True,
            send_to_subscription_co_administrator=True,
            custom_emails=["admin@contoso.com"],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.2.0/24"],
});
const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    upgradeMode: "Manual",
    sku: "Standard_F2",
    instances: 2,
    adminUsername: "myadmin",
    adminSshKeys: [{
        username: "myadmin",
        publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
    }],
    networkInterfaces: [{
        name: "TestNetworkProfile",
        primary: true,
        ipConfigurations: [{
            name: "TestIPConfiguration",
            primary: true,
            subnetId: exampleSubnet.id,
        }],
    }],
    osDisk: {
        caching: "ReadWrite",
        storageAccountType: "StandardSSD_LRS",
    },
    sourceImageReference: {
        publisher: "Canonical",
        offer: "UbuntuServer",
        sku: "16.04-LTS",
        version: "latest",
    },
});
const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", {
    enabled: true,
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    targetResourceId: exampleLinuxVirtualMachineScaleSet.id,
    profiles: [{
        name: "forJuly",
        capacity: {
            "default": 1,
            minimum: 1,
            maximum: 10,
        },
        rules: [
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
                    timeGrain: "PT1M",
                    statistic: "Average",
                    timeWindow: "PT5M",
                    timeAggregation: "Average",
                    operator: "GreaterThan",
                    threshold: 90,
                },
                scaleAction: {
                    direction: "Increase",
                    type: "ChangeCount",
                    value: 2,
                    cooldown: "PT1M",
                },
            },
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
                    timeGrain: "PT1M",
                    statistic: "Average",
                    timeWindow: "PT5M",
                    timeAggregation: "Average",
                    operator: "LessThan",
                    threshold: 10,
                },
                scaleAction: {
                    direction: "Decrease",
                    type: "ChangeCount",
                    value: 2,
                    cooldown: "PT1M",
                },
            },
        ],
        fixedDate: {
            timezone: "Pacific Standard Time",
            start: "2020-07-01T00:00:00Z",
            end: "2020-07-31T23:59:59Z",
        },
    }],
    notification: {
        email: {
            sendToSubscriptionAdministrator: true,
            sendToSubscriptionCoAdministrator: true,
            customEmails: ["admin@contoso.com"],
        },
    },
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.2.0/24
  exampleLinuxVirtualMachineScaleSet:
    type: azure:compute:LinuxVirtualMachineScaleSet
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      upgradeMode: Manual
      sku: Standard_F2
      instances: 2
      adminUsername: myadmin
      adminSshKeys:
        - username: myadmin
          publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com
      networkInterfaces:
        - name: TestNetworkProfile
          primary: true
          ipConfigurations:
            - name: TestIPConfiguration
              primary: true
              subnetId: ${exampleSubnet.id}
      osDisk:
        caching: ReadWrite
        storageAccountType: StandardSSD_LRS
      sourceImageReference:
        publisher: Canonical
        offer: UbuntuServer
        sku: 16.04-LTS
        version: latest
  exampleAutoscaleSetting:
    type: azure:monitoring:AutoscaleSetting
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      targetResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
      profiles:
        - name: Weekends
          capacity:
            default: 1
            minimum: 1
            maximum: 10
          rules:
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: GreaterThan
                threshold: 90
              scaleAction:
                direction: Increase
                type: ChangeCount
                value: 2
                cooldown: PT1M
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: LessThan
                threshold: 10
              scaleAction:
                direction: Decrease
                type: ChangeCount
                value: 2
                cooldown: PT1M
          recurrence:
            timezone: Pacific Standard Time
            days:
              - Saturday
              - Sunday
            hours:
              - 12
            minutes:
              - 0
      notification:
        email:
          sendToSubscriptionAdministrator: true
          sendToSubscriptionCoAdministrator: true
          customEmails:
            - admin@contoso.com

For Fixed Dates)

Coming soon!

Coming soon!

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.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSet;
import com.pulumi.azure.compute.LinuxVirtualMachineScaleSetArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetOsDiskArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs;
import com.pulumi.azure.monitoring.AutoscaleSetting;
import com.pulumi.azure.monitoring.AutoscaleSettingArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileCapacityArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileFixedDateArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationArgs;
import com.pulumi.azure.monitoring.inputs.AutoscaleSettingNotificationEmailArgs;
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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.2.0/24")
            .build());

        var exampleLinuxVirtualMachineScaleSet = new LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", LinuxVirtualMachineScaleSetArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .upgradeMode("Manual")
            .sku("Standard_F2")
            .instances(2)
            .adminUsername("myadmin")
            .adminSshKeys(LinuxVirtualMachineScaleSetAdminSshKeyArgs.builder()
                .username("myadmin")
                .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com")
                .build())
            .networkInterfaces(LinuxVirtualMachineScaleSetNetworkInterfaceArgs.builder()
                .name("TestNetworkProfile")
                .primary(true)
                .ipConfigurations(LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs.builder()
                    .name("TestIPConfiguration")
                    .primary(true)
                    .subnetId(exampleSubnet.id())
                    .build())
                .build())
            .osDisk(LinuxVirtualMachineScaleSetOsDiskArgs.builder()
                .caching("ReadWrite")
                .storageAccountType("StandardSSD_LRS")
                .build())
            .sourceImageReference(LinuxVirtualMachineScaleSetSourceImageReferenceArgs.builder()
                .publisher("Canonical")
                .offer("UbuntuServer")
                .sku("16.04-LTS")
                .version("latest")
                .build())
            .build());

        var exampleAutoscaleSetting = new AutoscaleSetting("exampleAutoscaleSetting", AutoscaleSettingArgs.builder()        
            .enabled(true)
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .targetResourceId(exampleLinuxVirtualMachineScaleSet.id())
            .profiles(AutoscaleSettingProfileArgs.builder()
                .name("forJuly")
                .capacity(AutoscaleSettingProfileCapacityArgs.builder()
                    .default_(1)
                    .minimum(1)
                    .maximum(10)
                    .build())
                .rules(                
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("GreaterThan")
                            .threshold(90)
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Increase")
                            .type("ChangeCount")
                            .value("2")
                            .cooldown("PT1M")
                            .build())
                        .build(),
                    AutoscaleSettingProfileRuleArgs.builder()
                        .metricTrigger(AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
                            .metricName("Percentage CPU")
                            .metricResourceId(exampleLinuxVirtualMachineScaleSet.id())
                            .timeGrain("PT1M")
                            .statistic("Average")
                            .timeWindow("PT5M")
                            .timeAggregation("Average")
                            .operator("LessThan")
                            .threshold(10)
                            .build())
                        .scaleAction(AutoscaleSettingProfileRuleScaleActionArgs.builder()
                            .direction("Decrease")
                            .type("ChangeCount")
                            .value("2")
                            .cooldown("PT1M")
                            .build())
                        .build())
                .fixedDate(AutoscaleSettingProfileFixedDateArgs.builder()
                    .timezone("Pacific Standard Time")
                    .start("2020-07-01T00:00:00Z")
                    .end("2020-07-31T23:59:59Z")
                    .build())
                .build())
            .notification(AutoscaleSettingNotificationArgs.builder()
                .email(AutoscaleSettingNotificationEmailArgs.builder()
                    .sendToSubscriptionAdministrator(true)
                    .sendToSubscriptionCoAdministrator(true)
                    .customEmails("admin@contoso.com")
                    .build())
                .build())
            .build());

    }
}

Coming soon!

Coming soon!

resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.2.0/24
  exampleLinuxVirtualMachineScaleSet:
    type: azure:compute:LinuxVirtualMachineScaleSet
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      upgradeMode: Manual
      sku: Standard_F2
      instances: 2
      adminUsername: myadmin
      adminSshKeys:
        - username: myadmin
          publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com
      networkInterfaces:
        - name: TestNetworkProfile
          primary: true
          ipConfigurations:
            - name: TestIPConfiguration
              primary: true
              subnetId: ${exampleSubnet.id}
      osDisk:
        caching: ReadWrite
        storageAccountType: StandardSSD_LRS
      sourceImageReference:
        publisher: Canonical
        offer: UbuntuServer
        sku: 16.04-LTS
        version: latest
  exampleAutoscaleSetting:
    type: azure:monitoring:AutoscaleSetting
    properties:
      enabled: true
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      targetResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
      profiles:
        - name: forJuly
          capacity:
            default: 1
            minimum: 1
            maximum: 10
          rules:
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: GreaterThan
                threshold: 90
              scaleAction:
                direction: Increase
                type: ChangeCount
                value: 2
                cooldown: PT1M
            - metricTrigger:
                metricName: Percentage CPU
                metricResourceId: ${exampleLinuxVirtualMachineScaleSet.id}
                timeGrain: PT1M
                statistic: Average
                timeWindow: PT5M
                timeAggregation: Average
                operator: LessThan
                threshold: 10
              scaleAction:
                direction: Decrease
                type: ChangeCount
                value: 2
                cooldown: PT1M
          fixedDate:
            timezone: Pacific Standard Time
            start: 2020-07-01T00:00:00Z
            end: 2020-07-31T23:59:59Z
      notification:
        email:
          sendToSubscriptionAdministrator: true
          sendToSubscriptionCoAdministrator: true
          customEmails:
            - admin@contoso.com

Create AutoscaleSetting Resource

new AutoscaleSetting(name: string, args: AutoscaleSettingArgs, opts?: CustomResourceOptions);
@overload
def AutoscaleSetting(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     enabled: Optional[bool] = None,
                     location: Optional[str] = None,
                     name: Optional[str] = None,
                     notification: Optional[AutoscaleSettingNotificationArgs] = None,
                     profiles: Optional[Sequence[AutoscaleSettingProfileArgs]] = None,
                     resource_group_name: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     target_resource_id: Optional[str] = None)
@overload
def AutoscaleSetting(resource_name: str,
                     args: AutoscaleSettingArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAutoscaleSetting(ctx *Context, name string, args AutoscaleSettingArgs, opts ...ResourceOption) (*AutoscaleSetting, error)
public AutoscaleSetting(string name, AutoscaleSettingArgs args, CustomResourceOptions? opts = null)
public AutoscaleSetting(String name, AutoscaleSettingArgs args)
public AutoscaleSetting(String name, AutoscaleSettingArgs args, CustomResourceOptions options)
type: azure:monitoring:AutoscaleSetting
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AutoscaleSettingArgs
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 AutoscaleSettingArgs
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 AutoscaleSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AutoscaleSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AutoscaleSettingArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AutoscaleSetting Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AutoscaleSetting resource accepts the following input properties:

Profiles List<AutoscaleSettingProfileArgs>

Specifies one or more (up to 20) profile blocks as defined below.

ResourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

TargetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

Enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

Location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

Name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

Notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

Profiles []AutoscaleSettingProfileArgs

Specifies one or more (up to 20) profile blocks as defined below.

ResourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

TargetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

Enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

Location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

Name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

Notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

Tags map[string]string

A mapping of tags to assign to the resource.

profiles List<AutoscaleSettingProfileArgs>

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName String

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

targetResourceId String

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled Boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location String

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name String

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

tags Map<String,String>

A mapping of tags to assign to the resource.

profiles AutoscaleSettingProfileArgs[]

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

targetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

profiles Sequence[AutoscaleSettingProfileArgs]

Specifies one or more (up to 20) profile blocks as defined below.

resource_group_name str

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

target_resource_id str

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location str

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name str

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

profiles List<Property Map>

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName String

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

targetResourceId String

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled Boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location String

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name String

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification Property Map

Specifies a notification block as defined below.

tags Map<String>

A mapping of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the AutoscaleSetting 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 AutoscaleSetting Resource

Get an existing AutoscaleSetting 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?: AutoscaleSettingState, opts?: CustomResourceOptions): AutoscaleSetting
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        notification: Optional[AutoscaleSettingNotificationArgs] = None,
        profiles: Optional[Sequence[AutoscaleSettingProfileArgs]] = None,
        resource_group_name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        target_resource_id: Optional[str] = None) -> AutoscaleSetting
func GetAutoscaleSetting(ctx *Context, name string, id IDInput, state *AutoscaleSettingState, opts ...ResourceOption) (*AutoscaleSetting, error)
public static AutoscaleSetting Get(string name, Input<string> id, AutoscaleSettingState? state, CustomResourceOptions? opts = null)
public static AutoscaleSetting get(String name, Output<String> id, AutoscaleSettingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
Enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

Location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

Name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

Notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

Profiles List<AutoscaleSettingProfileArgs>

Specifies one or more (up to 20) profile blocks as defined below.

ResourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

TargetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

Enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

Location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

Name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

Notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

Profiles []AutoscaleSettingProfileArgs

Specifies one or more (up to 20) profile blocks as defined below.

ResourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource.

TargetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled Boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location String

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name String

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

profiles List<AutoscaleSettingProfileArgs>

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName String

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

tags Map<String,String>

A mapping of tags to assign to the resource.

targetResourceId String

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location string

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name string

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

profiles AutoscaleSettingProfileArgs[]

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName string

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

targetResourceId string

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled bool

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location str

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name str

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification AutoscaleSettingNotificationArgs

Specifies a notification block as defined below.

profiles Sequence[AutoscaleSettingProfileArgs]

Specifies one or more (up to 20) profile blocks as defined below.

resource_group_name str

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

target_resource_id str

Specifies the resource ID of the resource that the autoscale setting should be added to.

enabled Boolean

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

location String

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

name String

The name of the AutoScale Setting. Changing this forces a new resource to be created.

notification Property Map

Specifies a notification block as defined below.

profiles List<Property Map>

Specifies one or more (up to 20) profile blocks as defined below.

resourceGroupName String

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

tags Map<String>

A mapping of tags to assign to the resource.

targetResourceId String

Specifies the resource ID of the resource that the autoscale setting should be added to.

Supporting Types

AutoscaleSettingNotification

Email AutoscaleSettingNotificationEmail

A email block as defined below.

Webhooks List<AutoscaleSettingNotificationWebhook>

One or more webhook blocks as defined below.

Email AutoscaleSettingNotificationEmail

A email block as defined below.

Webhooks []AutoscaleSettingNotificationWebhook

One or more webhook blocks as defined below.

email AutoscaleSettingNotificationEmail

A email block as defined below.

webhooks List<AutoscaleSettingNotificationWebhook>

One or more webhook blocks as defined below.

email AutoscaleSettingNotificationEmail

A email block as defined below.

webhooks AutoscaleSettingNotificationWebhook[]

One or more webhook blocks as defined below.

email AutoscaleSettingNotificationEmail

A email block as defined below.

webhooks Sequence[AutoscaleSettingNotificationWebhook]

One or more webhook blocks as defined below.

email Property Map

A email block as defined below.

webhooks List<Property Map>

One or more webhook blocks as defined below.

AutoscaleSettingNotificationEmail

CustomEmails List<string>

Specifies a list of custom email addresses to which the email notifications will be sent.

SendToSubscriptionAdministrator bool

Should email notifications be sent to the subscription administrator? Defaults to false.

SendToSubscriptionCoAdministrator bool

Should email notifications be sent to the subscription co-administrator? Defaults to false.

CustomEmails []string

Specifies a list of custom email addresses to which the email notifications will be sent.

SendToSubscriptionAdministrator bool

Should email notifications be sent to the subscription administrator? Defaults to false.

SendToSubscriptionCoAdministrator bool

Should email notifications be sent to the subscription co-administrator? Defaults to false.

customEmails List<String>

Specifies a list of custom email addresses to which the email notifications will be sent.

sendToSubscriptionAdministrator Boolean

Should email notifications be sent to the subscription administrator? Defaults to false.

sendToSubscriptionCoAdministrator Boolean

Should email notifications be sent to the subscription co-administrator? Defaults to false.

customEmails string[]

Specifies a list of custom email addresses to which the email notifications will be sent.

sendToSubscriptionAdministrator boolean

Should email notifications be sent to the subscription administrator? Defaults to false.

sendToSubscriptionCoAdministrator boolean

Should email notifications be sent to the subscription co-administrator? Defaults to false.

custom_emails Sequence[str]

Specifies a list of custom email addresses to which the email notifications will be sent.

send_to_subscription_administrator bool

Should email notifications be sent to the subscription administrator? Defaults to false.

send_to_subscription_co_administrator bool

Should email notifications be sent to the subscription co-administrator? Defaults to false.

customEmails List<String>

Specifies a list of custom email addresses to which the email notifications will be sent.

sendToSubscriptionAdministrator Boolean

Should email notifications be sent to the subscription administrator? Defaults to false.

sendToSubscriptionCoAdministrator Boolean

Should email notifications be sent to the subscription co-administrator? Defaults to false.

AutoscaleSettingNotificationWebhook

ServiceUri string

The HTTPS URI which should receive scale notifications.

Properties Dictionary<string, string>

A map of settings.

ServiceUri string

The HTTPS URI which should receive scale notifications.

Properties map[string]string

A map of settings.

serviceUri String

The HTTPS URI which should receive scale notifications.

properties Map<String,String>

A map of settings.

serviceUri string

The HTTPS URI which should receive scale notifications.

properties {[key: string]: string}

A map of settings.

service_uri str

The HTTPS URI which should receive scale notifications.

properties Mapping[str, str]

A map of settings.

serviceUri String

The HTTPS URI which should receive scale notifications.

properties Map<String>

A map of settings.

AutoscaleSettingProfile

Capacity AutoscaleSettingProfileCapacity

A capacity block as defined below.

Name string

Specifies the name of the profile.

FixedDate AutoscaleSettingProfileFixedDate

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

Recurrence AutoscaleSettingProfileRecurrence

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

Rules List<AutoscaleSettingProfileRule>

One or more (up to 10) rule blocks as defined below.

Capacity AutoscaleSettingProfileCapacity

A capacity block as defined below.

Name string

Specifies the name of the profile.

FixedDate AutoscaleSettingProfileFixedDate

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

Recurrence AutoscaleSettingProfileRecurrence

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

Rules []AutoscaleSettingProfileRule

One or more (up to 10) rule blocks as defined below.

capacity AutoscaleSettingProfileCapacity

A capacity block as defined below.

name String

Specifies the name of the profile.

fixedDate AutoscaleSettingProfileFixedDate

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

recurrence AutoscaleSettingProfileRecurrence

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

rules List<AutoscaleSettingProfileRule>

One or more (up to 10) rule blocks as defined below.

capacity AutoscaleSettingProfileCapacity

A capacity block as defined below.

name string

Specifies the name of the profile.

fixedDate AutoscaleSettingProfileFixedDate

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

recurrence AutoscaleSettingProfileRecurrence

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

rules AutoscaleSettingProfileRule[]

One or more (up to 10) rule blocks as defined below.

capacity AutoscaleSettingProfileCapacity

A capacity block as defined below.

name str

Specifies the name of the profile.

fixed_date AutoscaleSettingProfileFixedDate

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

recurrence AutoscaleSettingProfileRecurrence

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

rules Sequence[AutoscaleSettingProfileRule]

One or more (up to 10) rule blocks as defined below.

capacity Property Map

A capacity block as defined below.

name String

Specifies the name of the profile.

fixedDate Property Map

A fixed_date block as defined below. This cannot be specified if a recurrence block is specified.

recurrence Property Map

A recurrence block as defined below. This cannot be specified if a fixed_date block is specified.

rules List<Property Map>

One or more (up to 10) rule blocks as defined below.

AutoscaleSettingProfileCapacity

Default int

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

Maximum int

The maximum number of instances for this resource. Valid values are between 0 and 1000.

Minimum int

The minimum number of instances for this resource. Valid values are between 0 and 1000.

Default int

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

Maximum int

The maximum number of instances for this resource. Valid values are between 0 and 1000.

Minimum int

The minimum number of instances for this resource. Valid values are between 0 and 1000.

default_ Integer

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

maximum Integer

The maximum number of instances for this resource. Valid values are between 0 and 1000.

minimum Integer

The minimum number of instances for this resource. Valid values are between 0 and 1000.

default number

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

maximum number

The maximum number of instances for this resource. Valid values are between 0 and 1000.

minimum number

The minimum number of instances for this resource. Valid values are between 0 and 1000.

default int

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

maximum int

The maximum number of instances for this resource. Valid values are between 0 and 1000.

minimum int

The minimum number of instances for this resource. Valid values are between 0 and 1000.

default Number

The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

maximum Number

The maximum number of instances for this resource. Valid values are between 0 and 1000.

minimum Number

The minimum number of instances for this resource. Valid values are between 0 and 1000.

AutoscaleSettingProfileFixedDate

End string

Specifies the end date for the profile, formatted as an RFC3339 date string.

Start string

Specifies the start date for the profile, formatted as an RFC3339 date string.

Timezone string

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

End string

Specifies the end date for the profile, formatted as an RFC3339 date string.

Start string

Specifies the start date for the profile, formatted as an RFC3339 date string.

Timezone string

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

end String

Specifies the end date for the profile, formatted as an RFC3339 date string.

start String

Specifies the start date for the profile, formatted as an RFC3339 date string.

timezone String

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

end string

Specifies the end date for the profile, formatted as an RFC3339 date string.

start string

Specifies the start date for the profile, formatted as an RFC3339 date string.

timezone string

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

end str

Specifies the end date for the profile, formatted as an RFC3339 date string.

start str

Specifies the start date for the profile, formatted as an RFC3339 date string.

timezone str

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

end String

Specifies the end date for the profile, formatted as an RFC3339 date string.

start String

Specifies the start date for the profile, formatted as an RFC3339 date string.

timezone String

The Time Zone of the start and end times. A list of possible values can be found here. Defaults to UTC.

AutoscaleSettingProfileRecurrence

Days List<string>

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

Hours int

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

Minutes int

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

Timezone string

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

Days []string

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

Hours int

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

Minutes int

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

Timezone string

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

days List<String>

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

hours Integer

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

minutes Integer

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

timezone String

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

days string[]

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

hours number

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

minutes number

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

timezone string

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

days Sequence[str]

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

hours int

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

minutes int

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

timezone str

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

days List<String>

A list of days that this profile takes effect on. Possible values include Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.

hours Number

A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

minutes Number

A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.

timezone String

The Time Zone used for the hours field. A list of possible values can be found here. Defaults to UTC.

AutoscaleSettingProfileRule

MetricTrigger AutoscaleSettingProfileRuleMetricTrigger

A metric_trigger block as defined below.

ScaleAction AutoscaleSettingProfileRuleScaleAction

A scale_action block as defined below.

MetricTrigger AutoscaleSettingProfileRuleMetricTrigger

A metric_trigger block as defined below.

ScaleAction AutoscaleSettingProfileRuleScaleAction

A scale_action block as defined below.

metricTrigger AutoscaleSettingProfileRuleMetricTrigger

A metric_trigger block as defined below.

scaleAction AutoscaleSettingProfileRuleScaleAction

A scale_action block as defined below.

metricTrigger AutoscaleSettingProfileRuleMetricTrigger

A metric_trigger block as defined below.

scaleAction AutoscaleSettingProfileRuleScaleAction

A scale_action block as defined below.

metric_trigger AutoscaleSettingProfileRuleMetricTrigger

A metric_trigger block as defined below.

scale_action AutoscaleSettingProfileRuleScaleAction

A scale_action block as defined below.

metricTrigger Property Map

A metric_trigger block as defined below.

scaleAction Property Map

A scale_action block as defined below.

AutoscaleSettingProfileRuleMetricTrigger

MetricName string

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

MetricResourceId string

The ID of the Resource which the Rule monitors.

Operator string

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

Statistic string

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

Threshold double

Specifies the threshold of the metric that triggers the scale action.

TimeAggregation string

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

TimeGrain string

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

TimeWindow string

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

Dimensions List<AutoscaleSettingProfileRuleMetricTriggerDimension>

One or more dimensions block as defined below.

DivideByInstanceCount bool

Whether to enable metric divide by instance count.

MetricNamespace string

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

MetricName string

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

MetricResourceId string

The ID of the Resource which the Rule monitors.

Operator string

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

Statistic string

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

Threshold float64

Specifies the threshold of the metric that triggers the scale action.

TimeAggregation string

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

TimeGrain string

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

TimeWindow string

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

Dimensions []AutoscaleSettingProfileRuleMetricTriggerDimension

One or more dimensions block as defined below.

DivideByInstanceCount bool

Whether to enable metric divide by instance count.

MetricNamespace string

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

metricName String

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

metricResourceId String

The ID of the Resource which the Rule monitors.

operator String

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

statistic String

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

threshold Double

Specifies the threshold of the metric that triggers the scale action.

timeAggregation String

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

timeGrain String

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

timeWindow String

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

dimensions List<AutoscaleSettingProfileRuleMetricTriggerDimension>

One or more dimensions block as defined below.

divideByInstanceCount Boolean

Whether to enable metric divide by instance count.

metricNamespace String

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

metricName string

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

metricResourceId string

The ID of the Resource which the Rule monitors.

operator string

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

statistic string

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

threshold number

Specifies the threshold of the metric that triggers the scale action.

timeAggregation string

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

timeGrain string

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

timeWindow string

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

dimensions AutoscaleSettingProfileRuleMetricTriggerDimension[]

One or more dimensions block as defined below.

divideByInstanceCount boolean

Whether to enable metric divide by instance count.

metricNamespace string

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

metric_name str

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

metric_resource_id str

The ID of the Resource which the Rule monitors.

operator str

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

statistic str

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

threshold float

Specifies the threshold of the metric that triggers the scale action.

time_aggregation str

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

time_grain str

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

time_window str

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

dimensions Sequence[AutoscaleSettingProfileRuleMetricTriggerDimension]

One or more dimensions block as defined below.

divide_by_instance_count bool

Whether to enable metric divide by instance count.

metric_namespace str

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

metricName String

The name of the metric that defines what the rule monitors, such as Percentage CPU for Virtual Machine Scale Sets and CpuPercentage for App Service Plan.

metricResourceId String

The ID of the Resource which the Rule monitors.

operator String

Specifies the operator used to compare the metric data and threshold. Possible values are: Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual.

statistic String

Specifies how the metrics from multiple instances are combined. Possible values are Average, Max, Min and Sum.

threshold Number

Specifies the threshold of the metric that triggers the scale action.

timeAggregation String

Specifies how the data that's collected should be combined over time. Possible values include Average, Count, Maximum, Minimum, Last and Total. Defaults to Average.

timeGrain String

Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

timeWindow String

Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

dimensions List<Property Map>

One or more dimensions block as defined below.

divideByInstanceCount Boolean

Whether to enable metric divide by instance count.

metricNamespace String

The namespace of the metric that defines what the rule monitors, such as microsoft.compute/virtualmachinescalesets for Virtual Machine Scale Sets.

AutoscaleSettingProfileRuleMetricTriggerDimension

Name string

The name of the dimension.

Operator string

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

Values List<string>

A list of dimension values.

Name string

The name of the dimension.

Operator string

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

Values []string

A list of dimension values.

name String

The name of the dimension.

operator String

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

values List<String>

A list of dimension values.

name string

The name of the dimension.

operator string

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

values string[]

A list of dimension values.

name str

The name of the dimension.

operator str

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

values Sequence[str]

A list of dimension values.

name String

The name of the dimension.

operator String

The dimension operator. Possible values are Equals and NotEquals. Equals means being equal to any of the values. NotEquals means being not equal to any of the values.

values List<String>

A list of dimension values.

AutoscaleSettingProfileRuleScaleAction

Cooldown string

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

Direction string

The scale direction. Possible values are Increase and Decrease.

Type string

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

Value int

The number of instances involved in the scaling action. Defaults to 1.

Cooldown string

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

Direction string

The scale direction. Possible values are Increase and Decrease.

Type string

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

Value int

The number of instances involved in the scaling action. Defaults to 1.

cooldown String

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

direction String

The scale direction. Possible values are Increase and Decrease.

type String

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

value Integer

The number of instances involved in the scaling action. Defaults to 1.

cooldown string

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

direction string

The scale direction. Possible values are Increase and Decrease.

type string

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

value number

The number of instances involved in the scaling action. Defaults to 1.

cooldown str

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

direction str

The scale direction. Possible values are Increase and Decrease.

type str

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

value int

The number of instances involved in the scaling action. Defaults to 1.

cooldown String

The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

direction String

The scale direction. Possible values are Increase and Decrease.

type String

The type of action that should occur. Possible values are ChangeCount, ExactCount, PercentChangeCount and ServiceAllowedNextValue.

value Number

The number of instances involved in the scaling action. Defaults to 1.

Import

AutoScale Setting can be imported using the resource id, e.g.

 $ pulumi import azure:monitoring/autoscaleSetting:AutoscaleSetting example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/autoScaleSettings/setting1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.