CloudService

class CloudService : KotlinCustomResource

Describes the cloud service. Azure REST API version: 2022-09-04. Prior API version in Azure Native 1.x: 2021-03-01.

Example Usage

Create New Cloud Service with Multiple Roles

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIpConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoBackend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCloudService(ctx, "cloudService", &compute.CloudServiceArgs{
CloudServiceName: pulumi.String("{cs-name}"),
Location: pulumi.String("westus"),
Properties: compute.CloudServicePropertiesResponse{
Configuration: pulumi.String("{ServiceConfiguration}"),
NetworkProfile: interface{}{
LoadBalancerConfigurations: compute.LoadBalancerConfigurationArray{
interface{}{
Name: pulumi.String("contosolb"),
Properties: interface{}{
FrontendIpConfigurations: compute.LoadBalancerFrontendIpConfigurationArray{
interface{}{
Name: pulumi.String("contosofe"),
Properties: interface{}{
PublicIPAddress: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
},
},
},
},
},
},
PackageUrl: pulumi.String("{PackageUrl}"),
RoleProfile: interface{}{
Roles: compute.CloudServiceRoleProfilePropertiesArray{
interface{}{
Name: pulumi.String("ContosoFrontend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
interface{}{
Name: pulumi.String("ContosoBackend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
},
},
UpgradeMode: pulumi.String("Auto"),
},
ResourceGroupName: pulumi.String("ConstosoRG"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIpConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles",
Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
),
Map.ofEntries(
Map.entry("name", "ContosoBackend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Multiple Roles in a specific availability zone

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIpConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoBackend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
Zones = new[]
{
"1",
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCloudService(ctx, "cloudService", &compute.CloudServiceArgs{
CloudServiceName: pulumi.String("{cs-name}"),
Location: pulumi.String("westus"),
Properties: compute.CloudServicePropertiesResponse{
Configuration: pulumi.String("{ServiceConfiguration}"),
NetworkProfile: interface{}{
LoadBalancerConfigurations: compute.LoadBalancerConfigurationArray{
interface{}{
Name: pulumi.String("contosolb"),
Properties: interface{}{
FrontendIpConfigurations: compute.LoadBalancerFrontendIpConfigurationArray{
interface{}{
Name: pulumi.String("contosofe"),
Properties: interface{}{
PublicIPAddress: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
},
},
},
},
},
},
PackageUrl: pulumi.String("{PackageUrl}"),
RoleProfile: interface{}{
Roles: compute.CloudServiceRoleProfilePropertiesArray{
interface{}{
Name: pulumi.String("ContosoFrontend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
interface{}{
Name: pulumi.String("ContosoBackend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
},
},
UpgradeMode: pulumi.String("Auto"),
},
ResourceGroupName: pulumi.String("ConstosoRG"),
Zones: pulumi.StringArray{
pulumi.String("1"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIpConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles",
Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
),
Map.ofEntries(
Map.entry("name", "ContosoBackend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.zones("1")
.build());
}
}

Create New Cloud Service with Single Role

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "myLoadBalancer",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIpConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationArgs
{
Name = "myfe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCloudService(ctx, "cloudService", &compute.CloudServiceArgs{
CloudServiceName: pulumi.String("{cs-name}"),
Location: pulumi.String("westus"),
Properties: compute.CloudServicePropertiesResponse{
Configuration: pulumi.String("{ServiceConfiguration}"),
NetworkProfile: interface{}{
LoadBalancerConfigurations: compute.LoadBalancerConfigurationArray{
interface{}{
Name: pulumi.String("myLoadBalancer"),
Properties: interface{}{
FrontendIpConfigurations: compute.LoadBalancerFrontendIpConfigurationArray{
interface{}{
Name: pulumi.String("myfe"),
Properties: interface{}{
PublicIPAddress: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"),
},
},
},
},
},
},
},
},
PackageUrl: pulumi.String("{PackageUrl}"),
RoleProfile: interface{}{
Roles: compute.CloudServiceRoleProfilePropertiesArray{
interface{}{
Name: pulumi.String("ContosoFrontend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
},
},
UpgradeMode: pulumi.String("Auto"),
},
ResourceGroupName: pulumi.String("ConstosoRG"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "myLoadBalancer"),
Map.entry("properties", Map.of("frontendIpConfigurations", Map.ofEntries(
Map.entry("name", "myfe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Single Role and Certificate from Key Vault

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIpConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
OsProfile = new AzureNative.Compute.Inputs.CloudServiceOsProfileArgs
{
Secrets = new[]
{
new AzureNative.Compute.Inputs.CloudServiceVaultSecretGroupArgs
{
SourceVault = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}",
},
VaultCertificates = new[]
{
new AzureNative.Compute.Inputs.CloudServiceVaultCertificateArgs
{
CertificateUrl = "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}",
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCloudService(ctx, "cloudService", &compute.CloudServiceArgs{
CloudServiceName: pulumi.String("{cs-name}"),
Location: pulumi.String("westus"),
Properties: compute.CloudServicePropertiesResponse{
Configuration: pulumi.String("{ServiceConfiguration}"),
NetworkProfile: interface{}{
LoadBalancerConfigurations: compute.LoadBalancerConfigurationArray{
interface{}{
Name: pulumi.String("contosolb"),
Properties: interface{}{
FrontendIpConfigurations: compute.LoadBalancerFrontendIpConfigurationArray{
interface{}{
Name: pulumi.String("contosofe"),
Properties: interface{}{
PublicIPAddress: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
},
},
},
},
},
},
OsProfile: interface{}{
Secrets: compute.CloudServiceVaultSecretGroupArray{
interface{}{
SourceVault: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"),
},
VaultCertificates: compute.CloudServiceVaultCertificateArray{
&compute.CloudServiceVaultCertificateArgs{
CertificateUrl: pulumi.String("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"),
},
},
},
},
},
PackageUrl: pulumi.String("{PackageUrl}"),
RoleProfile: interface{}{
Roles: compute.CloudServiceRoleProfilePropertiesArray{
interface{}{
Name: pulumi.String("ContosoFrontend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
},
},
UpgradeMode: pulumi.String("Auto"),
},
ResourceGroupName: pulumi.String("ConstosoRG"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIpConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("osProfile", Map.of("secrets", Map.ofEntries(
Map.entry("sourceVault", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}")),
Map.entry("vaultCertificates", Map.of("certificateUrl", "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Single Role and RDP Extension

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
ExtensionProfile = new AzureNative.Compute.Inputs.CloudServiceExtensionProfileArgs
{
Extensions = new[]
{
new AzureNative.Compute.Inputs.ExtensionArgs
{
Name = "RDPExtension",
Properties = new AzureNative.Compute.Inputs.CloudServiceExtensionPropertiesArgs
{
AutoUpgradeMinorVersion = false,
ProtectedSettings = "<PrivateConfig><Password>{password}</Password></PrivateConfig>",
Publisher = "Microsoft.Windows.Azure.Extensions",
Settings = "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>",
Type = "RDP",
TypeHandlerVersion = "1.2",
},
},
},
},
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIpConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIpConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewCloudService(ctx, "cloudService", &compute.CloudServiceArgs{
CloudServiceName: pulumi.String("{cs-name}"),
Location: pulumi.String("westus"),
Properties: compute.CloudServicePropertiesResponse{
Configuration: pulumi.String("{ServiceConfiguration}"),
ExtensionProfile: interface{}{
Extensions: compute.ExtensionArray{
interface{}{
Name: pulumi.String("RDPExtension"),
Properties: &compute.CloudServiceExtensionPropertiesArgs{
AutoUpgradeMinorVersion: pulumi.Bool(false),
ProtectedSettings: pulumi.Any("<PrivateConfig><Password>{password}</Password></PrivateConfig>"),
Publisher: pulumi.String("Microsoft.Windows.Azure.Extensions"),
Settings: pulumi.Any("<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>"),
Type: pulumi.String("RDP"),
TypeHandlerVersion: pulumi.String("1.2"),
},
},
},
},
NetworkProfile: interface{}{
LoadBalancerConfigurations: compute.LoadBalancerConfigurationArray{
interface{}{
Name: pulumi.String("contosolb"),
Properties: interface{}{
FrontendIpConfigurations: compute.LoadBalancerFrontendIpConfigurationArray{
interface{}{
Name: pulumi.String("contosofe"),
Properties: interface{}{
PublicIPAddress: &compute.SubResourceArgs{
Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
},
},
},
},
},
},
PackageUrl: pulumi.String("{PackageUrl}"),
RoleProfile: interface{}{
Roles: compute.CloudServiceRoleProfilePropertiesArray{
interface{}{
Name: pulumi.String("ContosoFrontend"),
Sku: &compute.CloudServiceRoleSkuArgs{
Capacity: pulumi.Float64(1),
Name: pulumi.String("Standard_D1_v2"),
Tier: pulumi.String("Standard"),
},
},
},
},
UpgradeMode: pulumi.String("Auto"),
},
ResourceGroupName: pulumi.String("ConstosoRG"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("extensionProfile", Map.of("extensions", Map.ofEntries(
Map.entry("name", "RDPExtension"),
Map.entry("properties", Map.ofEntries(
Map.entry("autoUpgradeMinorVersion", false),
Map.entry("protectedSettings", "<PrivateConfig><Password>{password}</Password></PrivateConfig>"),
Map.entry("publisher", "Microsoft.Windows.Azure.Extensions"),
Map.entry("settings", "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>"),
Map.entry("type", "RDP"),
Map.entry("typeHandlerVersion", "1.2")
))
))),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIpConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Import

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

$ pulumi import azure-native:compute:CloudService {cs-name} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

Resource location.

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

Cloud service properties

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The system meta data relating to this resource.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zones: Output<List<String>>?

List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional.