Cree o actualice un servicio en la nube. Tenga en cuenta que algunas propiedades solo se pueden establecer durante la creación del servicio en la nube.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}?api-version=2022-09-04
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
cloudServiceName
|
path |
True
|
string
|
Nombre del servicio en la nube.
|
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos.
|
subscriptionId
|
path |
True
|
string
|
Credenciales de suscripción que identifican de forma única la suscripción de Microsoft Azure. El identificador de suscripción forma parte del URI para cada llamada al servicio.
|
api-version
|
query |
True
|
string
|
Versión de api de cliente.
|
Cuerpo de la solicitud
Nombre |
Requerido |
Tipo |
Description |
location
|
True
|
string
|
Ubicación del recurso
|
properties
|
|
CloudServiceProperties
|
Propiedades del servicio en la nube
|
systemData
|
|
SystemData
|
Metadatos del sistema relacionados con este recurso.
|
tags
|
|
object
|
Etiquetas del recurso.
|
zones
|
|
string[]
|
Lista de la zona de disponibilidad lógica del recurso. La lista debe contener solo 1 zona donde se debe aprovisionar el servicio en la nube. Este campo es opcional.
|
Respuestas
Seguridad
azure_auth
Flujo OAuth2 de Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
Create New Cloud Service with Multiple Roles
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}?api-version=2022-09-04
{
"properties": {
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
},
"name": "contosofe"
}
]
},
"name": "contosolb"
}
]
},
"roleProfile": {
"roles": [
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoFrontend"
},
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoBackend"
}
]
},
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto"
},
"location": "westus"
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
import com.azure.resourcemanager.compute.models.CloudServiceProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
import java.util.Arrays;
/** Samples for CloudServices CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRoles(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getCloudServices()
.createOrUpdate(
"ConstosoRG",
"{cs-name}",
new CloudServiceInner()
.withLocation("westus")
.withProperties(
new CloudServiceProperties()
.withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(
new CloudServiceRoleProfile()
.withRoles(
Arrays
.asList(
new CloudServiceRoleProfileProperties()
.withName("ContosoFrontend")
.withSku(
new CloudServiceRoleSku()
.withName("Standard_D1_v2")
.withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties()
.withName("ContosoBackend")
.withSku(
new CloudServiceRoleSku()
.withName("Standard_D1_v2")
.withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(
new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(
Arrays
.asList(
new LoadBalancerConfiguration()
.withName("contosolb")
.withProperties(
new LoadBalancerConfigurationProperties()
.withFrontendIpConfigurations(
Arrays
.asList(
new LoadBalancerFrontendIpConfiguration()
.withName("contosofe")
.withProperties(
new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(
new SubResource()
.withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json
func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithMultipleRoles() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{
Location: to.Ptr("westus"),
Properties: &armcompute.CloudServiceProperties{
Configuration: to.Ptr("{ServiceConfiguration}"),
NetworkProfile: &armcompute.CloudServiceNetworkProfile{
LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
{
Name: to.Ptr("contosolb"),
Properties: &armcompute.LoadBalancerConfigurationProperties{
FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
{
Name: to.Ptr("contosofe"),
Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
PublicIPAddress: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
}},
},
}},
},
PackageURL: to.Ptr("{PackageUrl}"),
RoleProfile: &armcompute.CloudServiceRoleProfile{
Roles: []*armcompute.CloudServiceRoleProfileProperties{
{
Name: to.Ptr("ContosoFrontend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
},
{
Name: to.Ptr("ContosoBackend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
}},
},
UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CloudService = armcompute.CloudService{
// Name: to.Ptr("{cs-name}"),
// Type: to.Ptr("Microsoft.Compute/cloudServices"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.CloudServiceProperties{
// Configuration: to.Ptr("{ServiceConfiguration}"),
// NetworkProfile: &armcompute.CloudServiceNetworkProfile{
// LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
// {
// Name: to.Ptr("contosolb"),
// Properties: &armcompute.LoadBalancerConfigurationProperties{
// FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
// {
// Name: to.Ptr("contosofe"),
// Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
// PublicIPAddress: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
// },
// },
// }},
// },
// }},
// },
// OSProfile: &armcompute.CloudServiceOsProfile{
// Secrets: []*armcompute.CloudServiceVaultSecretGroup{
// },
// },
// PackageURL: to.Ptr("{PackageUrl}"),
// ProvisioningState: to.Ptr("Succeeded"),
// RoleProfile: &armcompute.CloudServiceRoleProfile{
// Roles: []*armcompute.CloudServiceRoleProfileProperties{
// {
// Name: to.Ptr("ContosoFrontend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// },
// {
// Name: to.Ptr("ContosoBackend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// }},
// },
// UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"),
// UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
// },
// SystemData: &armcompute.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation.
*
* @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json
*/
async function createNewCloudServiceWithMultipleRoles() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG";
const cloudServiceName = "{cs-name}";
const parameters = {
location: "westus",
properties: {
configuration: "{ServiceConfiguration}",
networkProfile: {
loadBalancerConfigurations: [
{
name: "contosolb",
properties: {
frontendIpConfigurations: [
{
name: "contosofe",
properties: {
publicIPAddress: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
],
},
},
],
},
packageUrl: "{PackageUrl}",
roleProfile: {
roles: [
{
name: "ContosoFrontend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
{
name: "ContosoBackend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
],
},
upgradeMode: "Auto",
},
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.cloudServices.beginCreateOrUpdateAndWait(
resourceGroupName,
cloudServiceName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json
// this example is just showing the usage of "CloudServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "ConstosoRG";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this CloudServiceResource
CloudServiceCollection collection = resourceGroupResource.GetCloudServices();
// invoke the operation
string cloudServiceName = "{cs-name}";
CloudServiceData data = new CloudServiceData(new AzureLocation("westus"))
{
PackageUri = new Uri("{PackageUrl}"),
Configuration = "{ServiceConfiguration}",
UpgradeMode = CloudServiceUpgradeMode.Auto,
Roles =
{
new CloudServiceRoleProfileProperties()
{
Name = "ContosoFrontend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
},new CloudServiceRoleProfileProperties()
{
Name = "ContosoBackend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
}
},
NetworkProfile = new CloudServiceNetworkProfile()
{
LoadBalancerConfigurations =
{
new CloudServiceLoadBalancerConfiguration("contosolb",new LoadBalancerFrontendIPConfiguration[]
{
new LoadBalancerFrontendIPConfiguration("contosofe")
{
PublicIPAddressId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
}
})
},
},
};
ArmOperation<CloudServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cloudServiceName, data);
CloudServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CloudServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
},
{
"name": "ContosoBackend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Updating",
"uniqueId": "7f3edf91-cb34-4a3e-971a-177dc3dd43cb"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
location: https://foo.com/operationstatus
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
},
{
"name": "ContosoBackend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Creating",
"uniqueId": "7f3edf91-cb34-4a3e-971a-177dc3dd43cb"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
Create New Cloud Service with Multiple Roles in a specific availability zone
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}?api-version=2022-09-04
{
"properties": {
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
},
"name": "contosofe"
}
]
},
"name": "contosolb"
}
]
},
"roleProfile": {
"roles": [
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoFrontend"
},
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoBackend"
}
]
},
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto"
},
"location": "westus",
"zones": [
"1"
]
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
import com.azure.resourcemanager.compute.models.CloudServiceProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
import java.util.Arrays;
/** Samples for CloudServices CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles in a specific availability zone.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(
com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getCloudServices()
.createOrUpdate(
"ConstosoRG",
"{cs-name}",
new CloudServiceInner()
.withLocation("westus")
.withProperties(
new CloudServiceProperties()
.withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(
new CloudServiceRoleProfile()
.withRoles(
Arrays
.asList(
new CloudServiceRoleProfileProperties()
.withName("ContosoFrontend")
.withSku(
new CloudServiceRoleSku()
.withName("Standard_D1_v2")
.withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties()
.withName("ContosoBackend")
.withSku(
new CloudServiceRoleSku()
.withName("Standard_D1_v2")
.withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(
new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(
Arrays
.asList(
new LoadBalancerConfiguration()
.withName("contosolb")
.withProperties(
new LoadBalancerConfigurationProperties()
.withFrontendIpConfigurations(
Arrays
.asList(
new LoadBalancerFrontendIpConfiguration()
.withName("contosofe")
.withProperties(
new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(
new SubResource()
.withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))))
.withZones(Arrays.asList("1")),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json
func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{
Location: to.Ptr("westus"),
Properties: &armcompute.CloudServiceProperties{
Configuration: to.Ptr("{ServiceConfiguration}"),
NetworkProfile: &armcompute.CloudServiceNetworkProfile{
LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
{
Name: to.Ptr("contosolb"),
Properties: &armcompute.LoadBalancerConfigurationProperties{
FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
{
Name: to.Ptr("contosofe"),
Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
PublicIPAddress: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
}},
},
}},
},
PackageURL: to.Ptr("{PackageUrl}"),
RoleProfile: &armcompute.CloudServiceRoleProfile{
Roles: []*armcompute.CloudServiceRoleProfileProperties{
{
Name: to.Ptr("ContosoFrontend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
},
{
Name: to.Ptr("ContosoBackend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
}},
},
UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
},
Zones: []*string{
to.Ptr("1")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CloudService = armcompute.CloudService{
// Name: to.Ptr("{cs-name}"),
// Type: to.Ptr("Microsoft.Compute/cloudServices"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.CloudServiceProperties{
// Configuration: to.Ptr("{ServiceConfiguration}"),
// NetworkProfile: &armcompute.CloudServiceNetworkProfile{
// LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
// {
// Name: to.Ptr("contosolb"),
// Properties: &armcompute.LoadBalancerConfigurationProperties{
// FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
// {
// Name: to.Ptr("contosofe"),
// Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
// PublicIPAddress: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
// },
// },
// }},
// },
// }},
// },
// OSProfile: &armcompute.CloudServiceOsProfile{
// Secrets: []*armcompute.CloudServiceVaultSecretGroup{
// },
// },
// PackageURL: to.Ptr("{PackageUrl}"),
// ProvisioningState: to.Ptr("Succeeded"),
// RoleProfile: &armcompute.CloudServiceRoleProfile{
// Roles: []*armcompute.CloudServiceRoleProfileProperties{
// {
// Name: to.Ptr("ContosoFrontend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// },
// {
// Name: to.Ptr("ContosoBackend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// }},
// },
// UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"),
// UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
// },
// SystemData: &armcompute.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// },
// Zones: []*string{
// to.Ptr("1")},
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation.
*
* @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json
*/
async function createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG";
const cloudServiceName = "{cs-name}";
const parameters = {
location: "westus",
properties: {
configuration: "{ServiceConfiguration}",
networkProfile: {
loadBalancerConfigurations: [
{
name: "contosolb",
properties: {
frontendIpConfigurations: [
{
name: "contosofe",
properties: {
publicIPAddress: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
],
},
},
],
},
packageUrl: "{PackageUrl}",
roleProfile: {
roles: [
{
name: "ContosoFrontend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
{
name: "ContosoBackend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
],
},
upgradeMode: "Auto",
},
zones: ["1"],
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.cloudServices.beginCreateOrUpdateAndWait(
resourceGroupName,
cloudServiceName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json
// this example is just showing the usage of "CloudServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "ConstosoRG";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this CloudServiceResource
CloudServiceCollection collection = resourceGroupResource.GetCloudServices();
// invoke the operation
string cloudServiceName = "{cs-name}";
CloudServiceData data = new CloudServiceData(new AzureLocation("westus"))
{
Zones =
{
"1"
},
PackageUri = new Uri("{PackageUrl}"),
Configuration = "{ServiceConfiguration}",
UpgradeMode = CloudServiceUpgradeMode.Auto,
Roles =
{
new CloudServiceRoleProfileProperties()
{
Name = "ContosoFrontend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
},new CloudServiceRoleProfileProperties()
{
Name = "ContosoBackend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
}
},
NetworkProfile = new CloudServiceNetworkProfile()
{
LoadBalancerConfigurations =
{
new CloudServiceLoadBalancerConfiguration("contosolb",new LoadBalancerFrontendIPConfiguration[]
{
new LoadBalancerFrontendIPConfiguration("contosofe")
{
PublicIPAddressId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
}
})
},
},
};
ArmOperation<CloudServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cloudServiceName, data);
CloudServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CloudServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
},
{
"name": "ContosoBackend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Updating",
"uniqueId": "7f3edf91-cb34-4a3e-971a-177dc3dd43cb"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
},
"zones": [
"1"
]
}
location: https://foo.com/operationstatus
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
},
{
"name": "ContosoBackend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Creating",
"uniqueId": "7f3edf91-cb34-4a3e-971a-177dc3dd43cb"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
},
"zones": [
"1"
]
}
Create New Cloud Service with Single Role
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}?api-version=2022-09-04
{
"location": "westus",
"properties": {
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"
}
},
"name": "myfe"
}
]
},
"name": "myLoadBalancer"
}
]
},
"roleProfile": {
"roles": [
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoFrontend"
}
]
},
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto"
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProfile;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProperties;
import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
import com.azure.resourcemanager.compute.models.CloudServiceProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
import com.azure.resourcemanager.compute.models.Extension;
import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
import java.util.Arrays;
/**
* Samples for CloudServices CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithSingleRole.json
*/
/**
* Sample code: Create New Cloud Service with Single Role.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithSingleRole(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices().createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus").withProperties(new CloudServiceProperties()
.withPackageUrl("{PackageUrl}").withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(
Arrays.asList(new CloudServiceRoleProfileProperties().withName("ContosoFrontend").withSku(
new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard").withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile().withLoadBalancerConfigurations(
Arrays.asList(new LoadBalancerConfiguration().withName("myLoadBalancer")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("myfe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))))))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithSingleRoleAndRDP.json
*/
/**
* Sample code: Create New Cloud Service with Single Role and RDP Extension.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createNewCloudServiceWithSingleRoleAndRDPExtension(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices().createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus").withProperties(new CloudServiceProperties()
.withPackageUrl("{PackageUrl}").withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(
Arrays.asList(new CloudServiceRoleProfileProperties().withName("ContosoFrontend").withSku(
new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard").withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))
.withExtensionProfile(new CloudServiceExtensionProfile().withExtensions(Arrays.asList(new Extension()
.withName("RDPExtension")
.withProperties(new CloudServiceExtensionProperties()
.withPublisher("Microsoft.Windows.Azure.Extensions").withType("RDP")
.withTypeHandlerVersion("1.2").withAutoUpgradeMinorVersion(false)
.withSettings(
"<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>")
.withProtectedSettings("<PrivateConfig><Password>{password}</Password></PrivateConfig>")))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithMultiRole.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRoles(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices()
.createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus")
.withProperties(new CloudServiceProperties().withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}").withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(Arrays.asList(
new CloudServiceRoleProfileProperties().withName("ContosoFrontend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties().withName("ContosoBackend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile().withLoadBalancerConfigurations(
Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithMultiRole_WithZones.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles in a specific availability zone.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices()
.createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus")
.withProperties(new CloudServiceProperties().withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}").withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(Arrays.asList(
new CloudServiceRoleProfileProperties().withName("ContosoFrontend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties().withName("ContosoBackend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile().withLoadBalancerConfigurations(
Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))))
.withZones(Arrays.asList("1")),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json
func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRole() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{
Location: to.Ptr("westus"),
Properties: &armcompute.CloudServiceProperties{
Configuration: to.Ptr("{ServiceConfiguration}"),
NetworkProfile: &armcompute.CloudServiceNetworkProfile{
LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
{
Name: to.Ptr("myLoadBalancer"),
Properties: &armcompute.LoadBalancerConfigurationProperties{
FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
{
Name: to.Ptr("myfe"),
Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
PublicIPAddress: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"),
},
},
}},
},
}},
},
PackageURL: to.Ptr("{PackageUrl}"),
RoleProfile: &armcompute.CloudServiceRoleProfile{
Roles: []*armcompute.CloudServiceRoleProfileProperties{
{
Name: to.Ptr("ContosoFrontend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
}},
},
UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CloudService = armcompute.CloudService{
// Name: to.Ptr("{cs-name}"),
// Type: to.Ptr("Microsoft.Compute/cloudServices"),
// ID: to.Ptr("/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.CloudServiceProperties{
// Configuration: to.Ptr("{ServiceConfiguration}"),
// NetworkProfile: &armcompute.CloudServiceNetworkProfile{
// LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
// {
// Name: to.Ptr("myLoadBalancer"),
// Properties: &armcompute.LoadBalancerConfigurationProperties{
// FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
// {
// Name: to.Ptr("myfe"),
// Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
// PublicIPAddress: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"),
// },
// },
// }},
// },
// }},
// },
// OSProfile: &armcompute.CloudServiceOsProfile{
// Secrets: []*armcompute.CloudServiceVaultSecretGroup{
// },
// },
// PackageURL: to.Ptr("{PackageUrl}"),
// ProvisioningState: to.Ptr("Succeeded"),
// RoleProfile: &armcompute.CloudServiceRoleProfile{
// Roles: []*armcompute.CloudServiceRoleProfileProperties{
// {
// Name: to.Ptr("ContosoFrontend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// }},
// },
// UniqueID: to.Ptr("14d10b45-ced7-42ef-a406-50a3df2cea7d"),
// UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
// },
// SystemData: &armcompute.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation.
*
* @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json
*/
async function createNewCloudServiceWithSingleRole() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG";
const cloudServiceName = "{cs-name}";
const parameters = {
location: "westus",
properties: {
configuration: "{ServiceConfiguration}",
networkProfile: {
loadBalancerConfigurations: [
{
name: "myLoadBalancer",
properties: {
frontendIpConfigurations: [
{
name: "myfe",
properties: {
publicIPAddress: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP",
},
},
},
],
},
},
],
},
packageUrl: "{PackageUrl}",
roleProfile: {
roles: [
{
name: "ContosoFrontend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
],
},
upgradeMode: "Auto",
},
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.cloudServices.beginCreateOrUpdateAndWait(
resourceGroupName,
cloudServiceName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json
// this example is just showing the usage of "CloudServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "ConstosoRG";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this CloudServiceResource
CloudServiceCollection collection = resourceGroupResource.GetCloudServices();
// invoke the operation
string cloudServiceName = "{cs-name}";
CloudServiceData data = new CloudServiceData(new AzureLocation("westus"))
{
PackageUri = new Uri("{PackageUrl}"),
Configuration = "{ServiceConfiguration}",
UpgradeMode = CloudServiceUpgradeMode.Auto,
Roles =
{
new CloudServiceRoleProfileProperties()
{
Name = "ContosoFrontend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
}
},
NetworkProfile = new CloudServiceNetworkProfile()
{
LoadBalancerConfigurations =
{
new CloudServiceLoadBalancerConfiguration("myLoadBalancer",new LoadBalancerFrontendIPConfiguration[]
{
new LoadBalancerFrontendIPConfiguration("myfe")
{
PublicIPAddressId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"),
}
})
},
},
};
ArmOperation<CloudServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cloudServiceName, data);
CloudServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CloudServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "{cs-name}",
"id": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"packageUrl": "{PackageUrl}",
"configuration": "{ServiceConfiguration}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"
}
},
"name": "myfe"
}
]
},
"name": "myLoadBalancer"
}
]
},
"provisioningState": "Updating",
"uniqueId": "14d10b45-ced7-42ef-a406-50a3df2cea7d"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
location: https://foo.com/operationstatus
{
"name": "{cs-name}",
"id": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"packageUrl": "{PackageUrl}",
"configuration": "{ServiceConfiguration}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"
}
},
"name": "myfe"
}
]
},
"name": "myLoadBalancer"
}
]
},
"provisioningState": "Creating",
"uniqueId": "14d10b45-ced7-42ef-a406-50a3df2cea7d"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
Create New Cloud Service with Single Role and Certificate from Key Vault
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}?api-version=2022-09-04
{
"location": "westus",
"properties": {
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
},
"name": "contosofe"
}
]
},
"name": "contosolb"
}
]
},
"osProfile": {
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"
},
"vaultCertificates": [
{
"certificateUrl": "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"
}
]
}
]
},
"roleProfile": {
"roles": [
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoFrontend"
}
]
},
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto"
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProfile;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProperties;
import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
import com.azure.resourcemanager.compute.models.CloudServiceOsProfile;
import com.azure.resourcemanager.compute.models.CloudServiceProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
import com.azure.resourcemanager.compute.models.CloudServiceVaultCertificate;
import com.azure.resourcemanager.compute.models.CloudServiceVaultSecretGroup;
import com.azure.resourcemanager.compute.models.Extension;
import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
import java.util.Arrays;
/**
* Samples for CloudServices CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithSingleRoleAndCertificate.json
*/
/**
* Sample code: Create New Cloud Service with Single Role and Certificate from Key Vault.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices().createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus").withProperties(new CloudServiceProperties()
.withPackageUrl("{PackageUrl}").withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(
Arrays.asList(new CloudServiceRoleProfileProperties().withName("ContosoFrontend").withSku(
new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard").withCapacity(1L)))))
.withOsProfile(new CloudServiceOsProfile().withSecrets(Arrays.asList(new CloudServiceVaultSecretGroup()
.withSourceVault(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"))
.withVaultCertificates(Arrays.asList(new CloudServiceVaultCertificate().withCertificateUrl(
"https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"))))))
.withNetworkProfile(new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithSingleRoleAndRDP.json
*/
/**
* Sample code: Create New Cloud Service with Single Role and RDP Extension.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createNewCloudServiceWithSingleRoleAndRDPExtension(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices().createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus").withProperties(new CloudServiceProperties()
.withPackageUrl("{PackageUrl}").withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(
Arrays.asList(new CloudServiceRoleProfileProperties().withName("ContosoFrontend").withSku(
new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard").withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))
.withExtensionProfile(new CloudServiceExtensionProfile().withExtensions(Arrays.asList(new Extension()
.withName("RDPExtension")
.withProperties(new CloudServiceExtensionProperties()
.withPublisher("Microsoft.Windows.Azure.Extensions").withType("RDP")
.withTypeHandlerVersion("1.2").withAutoUpgradeMinorVersion(false)
.withSettings(
"<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>")
.withProtectedSettings("<PrivateConfig><Password>{password}</Password></PrivateConfig>")))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithMultiRole.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRoles(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices()
.createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus")
.withProperties(new CloudServiceProperties().withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}").withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(Arrays.asList(
new CloudServiceRoleProfileProperties().withName("ContosoFrontend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties().withName("ContosoBackend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile().withLoadBalancerConfigurations(
Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
com.azure.core.util.Context.NONE);
}
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/
* CloudService_Create_WithMultiRole_WithZones.json
*/
/**
* Sample code: Create New Cloud Service with Multiple Roles in a specific availability zone.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(
com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getCloudServices()
.createOrUpdate("ConstosoRG", "{cs-name}",
new CloudServiceInner().withLocation("westus")
.withProperties(new CloudServiceProperties().withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}").withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(new CloudServiceRoleProfile().withRoles(Arrays.asList(
new CloudServiceRoleProfileProperties().withName("ContosoFrontend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)),
new CloudServiceRoleProfileProperties().withName("ContosoBackend")
.withSku(new CloudServiceRoleSku().withName("Standard_D1_v2").withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(new CloudServiceNetworkProfile().withLoadBalancerConfigurations(
Arrays.asList(new LoadBalancerConfiguration().withName("contosolb")
.withProperties(new LoadBalancerConfigurationProperties().withFrontendIpConfigurations(
Arrays.asList(new LoadBalancerFrontendIpConfiguration().withName("contosofe")
.withProperties(new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(new SubResource().withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))))
.withZones(Arrays.asList("1")),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json
func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{
Location: to.Ptr("westus"),
Properties: &armcompute.CloudServiceProperties{
Configuration: to.Ptr("{ServiceConfiguration}"),
NetworkProfile: &armcompute.CloudServiceNetworkProfile{
LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
{
Name: to.Ptr("contosolb"),
Properties: &armcompute.LoadBalancerConfigurationProperties{
FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
{
Name: to.Ptr("contosofe"),
Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
PublicIPAddress: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
}},
},
}},
},
OSProfile: &armcompute.CloudServiceOsProfile{
Secrets: []*armcompute.CloudServiceVaultSecretGroup{
{
SourceVault: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"),
},
VaultCertificates: []*armcompute.CloudServiceVaultCertificate{
{
CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"),
}},
}},
},
PackageURL: to.Ptr("{PackageUrl}"),
RoleProfile: &armcompute.CloudServiceRoleProfile{
Roles: []*armcompute.CloudServiceRoleProfileProperties{
{
Name: to.Ptr("ContosoFrontend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
}},
},
UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CloudService = armcompute.CloudService{
// Name: to.Ptr("{cs-name}"),
// Type: to.Ptr("Microsoft.Compute/cloudServices"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.CloudServiceProperties{
// Configuration: to.Ptr("{ServiceConfiguration}"),
// NetworkProfile: &armcompute.CloudServiceNetworkProfile{
// LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
// {
// Name: to.Ptr("contosolb"),
// Properties: &armcompute.LoadBalancerConfigurationProperties{
// FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
// {
// Name: to.Ptr("contosofe"),
// Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
// PublicIPAddress: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
// },
// },
// }},
// },
// }},
// },
// OSProfile: &armcompute.CloudServiceOsProfile{
// Secrets: []*armcompute.CloudServiceVaultSecretGroup{
// {
// SourceVault: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"),
// },
// VaultCertificates: []*armcompute.CloudServiceVaultCertificate{
// {
// CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"),
// }},
// }},
// },
// PackageURL: to.Ptr("{PackageUrl}"),
// ProvisioningState: to.Ptr("Succeeded"),
// RoleProfile: &armcompute.CloudServiceRoleProfile{
// Roles: []*armcompute.CloudServiceRoleProfileProperties{
// {
// Name: to.Ptr("ContosoFrontend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// }},
// },
// UniqueID: to.Ptr("60b6cd59-600b-4e02-b717-521b07aa94bf"),
// UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
// },
// SystemData: &armcompute.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation.
*
* @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json
*/
async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG";
const cloudServiceName = "{cs-name}";
const parameters = {
location: "westus",
properties: {
configuration: "{ServiceConfiguration}",
networkProfile: {
loadBalancerConfigurations: [
{
name: "contosolb",
properties: {
frontendIpConfigurations: [
{
name: "contosofe",
properties: {
publicIPAddress: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
],
},
},
],
},
osProfile: {
secrets: [
{
sourceVault: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}",
},
vaultCertificates: [
{
certificateUrl:
"https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}",
},
],
},
],
},
packageUrl: "{PackageUrl}",
roleProfile: {
roles: [
{
name: "ContosoFrontend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
],
},
upgradeMode: "Auto",
},
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.cloudServices.beginCreateOrUpdateAndWait(
resourceGroupName,
cloudServiceName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json
// this example is just showing the usage of "CloudServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "ConstosoRG";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this CloudServiceResource
CloudServiceCollection collection = resourceGroupResource.GetCloudServices();
// invoke the operation
string cloudServiceName = "{cs-name}";
CloudServiceData data = new CloudServiceData(new AzureLocation("westus"))
{
PackageUri = new Uri("{PackageUrl}"),
Configuration = "{ServiceConfiguration}",
UpgradeMode = CloudServiceUpgradeMode.Auto,
Roles =
{
new CloudServiceRoleProfileProperties()
{
Name = "ContosoFrontend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
}
},
OSSecrets =
{
new CloudServiceVaultSecretGroup()
{
SourceVaultId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"),
VaultCertificates =
{
new CloudServiceVaultCertificate()
{
CertificateUri = new Uri("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"),
}
},
}
},
NetworkProfile = new CloudServiceNetworkProfile()
{
LoadBalancerConfigurations =
{
new CloudServiceLoadBalancerConfiguration("contosolb",new LoadBalancerFrontendIPConfiguration[]
{
new LoadBalancerFrontendIPConfiguration("contosofe")
{
PublicIPAddressId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
}
})
},
},
};
ArmOperation<CloudServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cloudServiceName, data);
CloudServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CloudServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"
},
"vaultCertificates": [
{
"certificateUrl": "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"
}
]
}
]
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Updating",
"uniqueId": "60b6cd59-600b-4e02-b717-521b07aa94bf"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
location: https://foo.com/operationstatus
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"
},
"vaultCertificates": [
{
"certificateUrl": "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"
}
]
}
]
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"provisioningState": "Creating",
"uniqueId": "60b6cd59-600b-4e02-b717-521b07aa94bf"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
Create New Cloud Service with Single Role and RDP Extension
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}?api-version=2022-09-04
{
"properties": {
"extensionProfile": {
"extensions": [
{
"properties": {
"type": "RDP",
"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>",
"typeHandlerVersion": "1.2"
},
"name": "RDPExtension"
}
]
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"properties": {
"frontendIpConfigurations": [
{
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
},
"name": "contosofe"
}
]
},
"name": "contosolb"
}
]
},
"roleProfile": {
"roles": [
{
"sku": {
"name": "Standard_D1_v2",
"capacity": 1,
"tier": "Standard"
},
"name": "ContosoFrontend"
}
]
},
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto"
},
"location": "westus"
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProfile;
import com.azure.resourcemanager.compute.models.CloudServiceExtensionProperties;
import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
import com.azure.resourcemanager.compute.models.CloudServiceProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
import com.azure.resourcemanager.compute.models.Extension;
import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
import java.util.Arrays;
/** Samples for CloudServices CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json
*/
/**
* Sample code: Create New Cloud Service with Single Role and RDP Extension.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNewCloudServiceWithSingleRoleAndRDPExtension(
com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getCloudServices()
.createOrUpdate(
"ConstosoRG",
"{cs-name}",
new CloudServiceInner()
.withLocation("westus")
.withProperties(
new CloudServiceProperties()
.withPackageUrl("{PackageUrl}")
.withConfiguration("{ServiceConfiguration}")
.withUpgradeMode(CloudServiceUpgradeMode.AUTO)
.withRoleProfile(
new CloudServiceRoleProfile()
.withRoles(
Arrays
.asList(
new CloudServiceRoleProfileProperties()
.withName("ContosoFrontend")
.withSku(
new CloudServiceRoleSku()
.withName("Standard_D1_v2")
.withTier("Standard")
.withCapacity(1L)))))
.withNetworkProfile(
new CloudServiceNetworkProfile()
.withLoadBalancerConfigurations(
Arrays
.asList(
new LoadBalancerConfiguration()
.withName("contosolb")
.withProperties(
new LoadBalancerConfigurationProperties()
.withFrontendIpConfigurations(
Arrays
.asList(
new LoadBalancerFrontendIpConfiguration()
.withName("contosofe")
.withProperties(
new LoadBalancerFrontendIpConfigurationProperties()
.withPublicIpAddress(
new SubResource()
.withId(
"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))
.withExtensionProfile(
new CloudServiceExtensionProfile()
.withExtensions(
Arrays
.asList(
new Extension()
.withName("RDPExtension")
.withProperties(
new CloudServiceExtensionProperties()
.withPublisher("Microsoft.Windows.Azure.Extensions")
.withType("RDP")
.withTypeHandlerVersion("1.2")
.withAutoUpgradeMinorVersion(false)
.withSettings(
"<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021"
+ " 15:05:45</Expiration></PublicConfig>")
.withProtectedSettings(
"<PrivateConfig><Password>{password}</Password></PrivateConfig>")))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json
func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRoleAndRdpExtension() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{
Location: to.Ptr("westus"),
Properties: &armcompute.CloudServiceProperties{
Configuration: to.Ptr("{ServiceConfiguration}"),
ExtensionProfile: &armcompute.CloudServiceExtensionProfile{
Extensions: []*armcompute.Extension{
{
Name: to.Ptr("RDPExtension"),
Properties: &armcompute.CloudServiceExtensionProperties{
Type: to.Ptr("RDP"),
AutoUpgradeMinorVersion: to.Ptr(false),
ProtectedSettings: "<PrivateConfig><Password>{password}</Password></PrivateConfig>",
Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"),
Settings: "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>",
TypeHandlerVersion: to.Ptr("1.2"),
},
}},
},
NetworkProfile: &armcompute.CloudServiceNetworkProfile{
LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
{
Name: to.Ptr("contosolb"),
Properties: &armcompute.LoadBalancerConfigurationProperties{
FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
{
Name: to.Ptr("contosofe"),
Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
PublicIPAddress: &armcompute.SubResource{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
},
},
}},
},
}},
},
PackageURL: to.Ptr("{PackageUrl}"),
RoleProfile: &armcompute.CloudServiceRoleProfile{
Roles: []*armcompute.CloudServiceRoleProfileProperties{
{
Name: to.Ptr("ContosoFrontend"),
SKU: &armcompute.CloudServiceRoleSKU{
Name: to.Ptr("Standard_D1_v2"),
Capacity: to.Ptr[int64](1),
Tier: to.Ptr("Standard"),
},
}},
},
UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CloudService = armcompute.CloudService{
// Name: to.Ptr("{cs-name}"),
// Type: to.Ptr("Microsoft.Compute/cloudServices"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.CloudServiceProperties{
// Configuration: to.Ptr("{ServiceConfiguration}"),
// ExtensionProfile: &armcompute.CloudServiceExtensionProfile{
// Extensions: []*armcompute.Extension{
// {
// Name: to.Ptr("RDPExtension"),
// Properties: &armcompute.CloudServiceExtensionProperties{
// Type: to.Ptr("RDP"),
// AutoUpgradeMinorVersion: to.Ptr(false),
// ProvisioningState: to.Ptr("Succeeded"),
// Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"),
// RolesAppliedTo: []*string{
// to.Ptr("*")},
// Settings: "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>",
// TypeHandlerVersion: to.Ptr("1.2"),
// },
// }},
// },
// NetworkProfile: &armcompute.CloudServiceNetworkProfile{
// LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{
// {
// Name: to.Ptr("contosolb"),
// Properties: &armcompute.LoadBalancerConfigurationProperties{
// FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{
// {
// Name: to.Ptr("contosofe"),
// Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{
// PublicIPAddress: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
// },
// },
// }},
// },
// }},
// },
// OSProfile: &armcompute.CloudServiceOsProfile{
// Secrets: []*armcompute.CloudServiceVaultSecretGroup{
// },
// },
// PackageURL: to.Ptr("{PackageUrl}"),
// ProvisioningState: to.Ptr("Succeeded"),
// RoleProfile: &armcompute.CloudServiceRoleProfile{
// Roles: []*armcompute.CloudServiceRoleProfileProperties{
// {
// Name: to.Ptr("ContosoFrontend"),
// SKU: &armcompute.CloudServiceRoleSKU{
// Name: to.Ptr("Standard_D1_v2"),
// Capacity: to.Ptr[int64](1),
// Tier: to.Ptr("Standard"),
// },
// }},
// },
// UniqueID: to.Ptr("c948cccb-bbfa-4516-a250-c28abc4d0c15"),
// UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto),
// },
// SystemData: &armcompute.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation.
*
* @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json
*/
async function createNewCloudServiceWithSingleRoleAndRdpExtension() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG";
const cloudServiceName = "{cs-name}";
const parameters = {
location: "westus",
properties: {
configuration: "{ServiceConfiguration}",
extensionProfile: {
extensions: [
{
name: "RDPExtension",
properties: {
type: "RDP",
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>",
typeHandlerVersion: "1.2",
},
},
],
},
networkProfile: {
loadBalancerConfigurations: [
{
name: "contosolb",
properties: {
frontendIpConfigurations: [
{
name: "contosofe",
properties: {
publicIPAddress: {
id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
],
},
},
],
},
packageUrl: "{PackageUrl}",
roleProfile: {
roles: [
{
name: "ContosoFrontend",
sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" },
},
],
},
upgradeMode: "Auto",
},
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.cloudServices.beginCreateOrUpdateAndWait(
resourceGroupName,
cloudServiceName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json
// this example is just showing the usage of "CloudServices_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "ConstosoRG";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this CloudServiceResource
CloudServiceCollection collection = resourceGroupResource.GetCloudServices();
// invoke the operation
string cloudServiceName = "{cs-name}";
CloudServiceData data = new CloudServiceData(new AzureLocation("westus"))
{
PackageUri = new Uri("{PackageUrl}"),
Configuration = "{ServiceConfiguration}",
UpgradeMode = CloudServiceUpgradeMode.Auto,
Roles =
{
new CloudServiceRoleProfileProperties()
{
Name = "ContosoFrontend",
Sku = new CloudServiceRoleSku()
{
Name = "Standard_D1_v2",
Tier = "Standard",
Capacity = 1,
},
}
},
NetworkProfile = new CloudServiceNetworkProfile()
{
LoadBalancerConfigurations =
{
new CloudServiceLoadBalancerConfiguration("contosolb",new LoadBalancerFrontendIPConfiguration[]
{
new LoadBalancerFrontendIPConfiguration("contosofe")
{
PublicIPAddressId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"),
}
})
},
},
Extensions =
{
new CloudServiceExtension()
{
Name = "RDPExtension",
Publisher = "Microsoft.Windows.Azure.Extensions",
CloudServiceExtensionPropertiesType = "RDP",
TypeHandlerVersion = "1.2",
AutoUpgradeMinorVersion = false,
Settings = BinaryData.FromString("\"<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>\""),
ProtectedSettings = BinaryData.FromString("\"<PrivateConfig><Password>{password}</Password></PrivateConfig>\""),
}
},
};
ArmOperation<CloudServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cloudServiceName, data);
CloudServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CloudServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "RDPExtension",
"properties": {
"autoUpgradeMinorVersion": false,
"provisioningState": "Creating",
"rolesAppliedTo": [
"*"
],
"publisher": "Microsoft.Windows.Azure.Extensions",
"type": "RDP",
"typeHandlerVersion": "1.2",
"settings": "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>"
}
}
]
},
"provisioningState": "Updating",
"uniqueId": "c948cccb-bbfa-4516-a250-c28abc4d0c15"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
location: https://foo.com/operationstatus
{
"name": "{cs-name}",
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}",
"type": "Microsoft.Compute/cloudServices",
"location": "westus",
"properties": {
"configuration": "{ServiceConfiguration}",
"packageUrl": "{PackageUrl}",
"upgradeMode": "Auto",
"roleProfile": {
"roles": [
{
"name": "ContosoFrontend",
"sku": {
"name": "Standard_D1_v2",
"tier": "Standard",
"capacity": 1
}
}
]
},
"osProfile": {
"secrets": []
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"name": "contosolb",
"properties": {
"frontendIpConfigurations": [
{
"name": "contosofe",
"properties": {
"publicIPAddress": {
"id": "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"
}
}
}
]
}
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "RDPExtension",
"properties": {
"autoUpgradeMinorVersion": false,
"provisioningState": "Creating",
"rolesAppliedTo": [
"*"
],
"publisher": "Microsoft.Windows.Azure.Extensions",
"type": "RDP",
"typeHandlerVersion": "1.2",
"settings": "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>"
}
}
]
},
"provisioningState": "Creating",
"uniqueId": "c948cccb-bbfa-4516-a250-c28abc4d0c15"
},
"systemData": {
"createdAt": "2020-01-01T17:18:19.1234567Z",
"lastModifiedAt": "2020-01-01T17:18:19.1234567Z"
}
}
Definiciones
ApiError
Error de API.
Nombre |
Tipo |
Description |
code
|
string
|
Código de error.
|
details
|
ApiErrorBase[]
|
Detalles del error de api
|
innererror
|
InnerError
|
Error interno de api
|
message
|
string
|
El mensaje de error.
|
target
|
string
|
Destino del error concreto.
|
ApiErrorBase
Base de errores de API.
Nombre |
Tipo |
Description |
code
|
string
|
Código de error.
|
message
|
string
|
El mensaje de error.
|
target
|
string
|
Destino del error concreto.
|
CloudError
Respuesta de error del servicio Compute.
Nombre |
Tipo |
Description |
error
|
ApiError
|
Error de API.
|
CloudService
Describe el servicio en la nube.
Nombre |
Tipo |
Description |
id
|
string
|
Id. de recurso.
|
location
|
string
|
Ubicación del recurso
|
name
|
string
|
Nombre del recurso.
|
properties
|
CloudServiceProperties
|
Propiedades del servicio en la nube
|
systemData
|
SystemData
|
Metadatos del sistema relacionados con este recurso.
|
tags
|
object
|
Etiquetas del recurso.
|
type
|
string
|
Tipo de recurso.
|
zones
|
string[]
|
Lista de la zona de disponibilidad lógica del recurso. La lista debe contener solo 1 zona donde se debe aprovisionar el servicio en la nube. Este campo es opcional.
|
CloudServiceExtensionProfile
Describe un perfil de extensión de servicio en la nube.
Nombre |
Tipo |
Description |
extensions
|
Extension[]
|
Lista de extensiones para el servicio en la nube.
|
CloudServiceExtensionProperties
Propiedades de extensión.
Nombre |
Tipo |
Description |
autoUpgradeMinorVersion
|
boolean
|
Especifique explícitamente si la plataforma puede actualizar automáticamente typeHandlerVersion a versiones secundarias posteriores cuando estén disponibles.
|
forceUpdateTag
|
string
|
Etiqueta para forzar la aplicación de la configuración pública y protegida proporcionada.
Cambiar el valor de etiqueta permite volver a ejecutar la extensión sin cambiar ninguna de las configuraciones públicas o protegidas.
Si forceUpdateTag no cambia, el controlador seguirá aplicando las actualizaciones de la configuración pública o protegida.
Si no se cambia forceUpdateTag ni ninguna de las configuraciones públicas o protegidas, la extensión fluiría a la instancia de rol con el mismo número de secuencia y es necesario controlar la implementación de si se debe volver a ejecutar o no.
|
protectedSettings
|
object
|
Configuración protegida para la extensión que se cifra antes de enviar a la instancia de rol.
|
protectedSettingsFromKeyVault
|
CloudServiceVaultAndSecretReference
|
Configuración protegida para la extensión, a la que se hace referencia mediante KeyVault, que se cifran antes de enviarse a la instancia de rol.
|
provisioningState
|
string
|
El estado de aprovisionamiento, que solo aparece en la respuesta.
|
publisher
|
string
|
Nombre del publicador del controlador de extensiones.
|
rolesAppliedTo
|
string[]
|
Lista opcional de roles para aplicar esta extensión. Si no se especifica la propiedad o se especifica '*', la extensión se aplica a todos los roles del servicio en la nube.
|
settings
|
object
|
Configuración pública de la extensión. En el caso de las extensiones JSON, esta es la configuración json de la extensión. Para la extensión XML (como RDP), esta es la configuración XML de la extensión.
|
type
|
string
|
Especifica el tipo de la extensión.
|
typeHandlerVersion
|
string
|
Especifica la versión de la extensión. Especifica la versión de la extensión. Si no se especifica este elemento o se usa un asterisco (*) como valor, se usa la versión más reciente de la extensión. Si el valor se especifica con un número de versión principal y un asterisco como número de versión secundaria (X.), se selecciona la versión secundaria más reciente de la versión principal especificada. Si se especifica un número de versión principal y un número de versión secundaria (X.Y), se selecciona la versión de extensión específica. Si se especifica una versión, se realiza una actualización automática en la instancia de rol.
|
CloudServiceNetworkProfile
Perfil de red para el servicio en la nube.
Nombre |
Tipo |
Description |
loadBalancerConfigurations
|
LoadBalancerConfiguration[]
|
Lista de configuraciones del equilibrador de carga. El servicio en la nube puede tener hasta dos configuraciones del equilibrador de carga, correspondientes a un Load Balancer público y a un Load Balancer interno.
|
slotType
|
CloudServiceSlotType
|
Tipo de ranura para el servicio en la nube.
Los valores posibles son
Producción
Ensayo
Si no se especifica, el valor predeterminado es Production.
|
swappableCloudService
|
SubResource
|
Referencia de identificador del servicio en la nube que contiene la dirección IP de destino con la que el servicio en la nube sujeto puede realizar un intercambio. Esta propiedad no se puede actualizar una vez establecida. El servicio en la nube intercambiable al que hace referencia este identificador debe estar presente; de lo contrario, se producirá un error.
|
CloudServiceOsProfile
Describe el perfil del sistema operativo para el servicio en la nube.
Nombre |
Tipo |
Description |
secrets
|
CloudServiceVaultSecretGroup[]
|
Especifica el conjunto de certificados que se deben instalar en las instancias de rol.
|
CloudServiceProperties
Propiedades del servicio en la nube
Nombre |
Tipo |
Description |
allowModelOverride
|
boolean
|
(Opcional) Indica si las propiedades de SKU de rol (roleProfile.roles.sku) especificadas en el modelo o plantilla deben invalidar el número de instancias de rol y el tamaño de máquina virtual especificados en .cscfg y .csdef respectivamente.
El valor predeterminado es false .
|
configuration
|
string
|
Especifica la configuración del servicio XML (.cscfg) para el servicio en la nube.
|
configurationUrl
|
string
|
Especifica una dirección URL que hace referencia a la ubicación de la configuración de servicio en Blob service. La dirección URL del paquete de servicio puede ser URI de firma de acceso compartido (SAS) desde cualquier cuenta de almacenamiento.
Se trata de una propiedad de solo escritura y no se devuelve en las llamadas GET.
|
extensionProfile
|
CloudServiceExtensionProfile
|
Describe un perfil de extensión de servicio en la nube.
|
networkProfile
|
CloudServiceNetworkProfile
|
Perfil de red para el servicio en la nube.
|
osProfile
|
CloudServiceOsProfile
|
Describe el perfil del sistema operativo para el servicio en la nube.
|
packageUrl
|
string
|
Especifica una dirección URL que hace referencia a la ubicación del paquete de Blob service. La dirección URL del paquete de servicio puede ser URI de firma de acceso compartido (SAS) desde cualquier cuenta de almacenamiento.
Se trata de una propiedad de solo escritura y no se devuelve en las llamadas GET.
|
provisioningState
|
string
|
El estado de aprovisionamiento, que solo aparece en la respuesta.
|
roleProfile
|
CloudServiceRoleProfile
|
Describe el perfil de rol para el servicio en la nube.
|
startCloudService
|
boolean
|
(Opcional) Indica si se debe iniciar el servicio en la nube inmediatamente después de crearlo. El valor predeterminado es true .
Si es false, el modelo de servicio se sigue implementando, pero el código no se ejecuta inmediatamente. En su lugar, el servicio es PoweredOff hasta que se llama a Start, en cuyo momento se iniciará el servicio. Un servicio implementado sigue incurr en cargos, incluso si está apagado.
|
uniqueId
|
string
|
Identificador único del servicio en la nube.
|
upgradeMode
|
CloudServiceUpgradeMode
|
Modo de actualización para el servicio en la nube. Las instancias de rol se asigna para actualizar dominios cuando se implementa el servicio. Las actualizaciones se pueden iniciar manualmente en cada dominio de actualización o iniciar automáticamente en todos dominios de actualización.
Los valores posibles son
Automático
Manual
Simultánea
Si no se especifica, el valor predeterminado es Auto. Si se establece en Manual, se debe llamar a PUT UpdateDomain para aplicar la actualización. Si se establece en Automático, la actualización se aplica automáticamente a cada dominio de actualización en secuencia.
|
CloudServiceRoleProfile
Describe el perfil de rol para el servicio en la nube.
CloudServiceRoleProfileProperties
Describe las propiedades del rol.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre del recurso.
|
sku
|
CloudServiceRoleSku
|
Describe la SKU del rol de servicio en la nube.
|
CloudServiceRoleSku
Describe la SKU del rol de servicio en la nube.
Nombre |
Tipo |
Description |
capacity
|
integer
|
Especifica el número de instancias de rol en el servicio en la nube.
|
name
|
string
|
Nombre de la SKU. NOTA: Si la nueva SKU no se admite en el hardware en el que se encuentra actualmente el servicio en la nube, debe eliminar y volver a crear el servicio en la nube o volver a la SKU anterior.
|
tier
|
string
|
Especifica el nivel del servicio en la nube. Los valores posibles son
Estándar
Basic
|
CloudServiceSlotType
Tipo de ranura para el servicio en la nube.
Los valores posibles son
Producción
Ensayo
Si no se especifica, el valor predeterminado es Production.
Nombre |
Tipo |
Description |
Production
|
string
|
|
Staging
|
string
|
|
CloudServiceUpgradeMode
Modo de actualización para el servicio en la nube. Las instancias de rol se asigna para actualizar dominios cuando se implementa el servicio. Las actualizaciones se pueden iniciar manualmente en cada dominio de actualización o iniciar automáticamente en todos dominios de actualización.
Los valores posibles son
Automático
Manual
Simultánea
Si no se especifica, el valor predeterminado es Auto. Si se establece en Manual, se debe llamar a PUT UpdateDomain para aplicar la actualización. Si se establece en Automático, la actualización se aplica automáticamente a cada dominio de actualización en secuencia.
Nombre |
Tipo |
Description |
Auto
|
string
|
|
Manual
|
string
|
|
Simultaneous
|
string
|
|
CloudServiceVaultAndSecretReference
Configuración protegida para la extensión, a la que se hace referencia mediante KeyVault, que se cifran antes de enviarse a la instancia de rol.
Nombre |
Tipo |
Description |
secretUrl
|
string
|
Dirección URL secreta que contiene la configuración protegida de la extensión
|
sourceVault
|
SubResource
|
Identificador de recurso de ARM del Key Vault
|
CloudServiceVaultCertificate
Describe una única referencia de certificado en un Key Vault y dónde debe residir el certificado en la instancia de rol.
Nombre |
Tipo |
Description |
certificateUrl
|
string
|
Esta es la dirección URL de un certificado que se ha cargado en Key Vault como secreto.
|
CloudServiceVaultSecretGroup
Describe un conjunto de certificados que están en la misma Key Vault.
Nombre |
Tipo |
Description |
sourceVault
|
SubResource
|
Dirección URL relativa del Key Vault que contiene todos los certificados de VaultCertificates.
|
vaultCertificates
|
CloudServiceVaultCertificate[]
|
Lista de referencias del almacén de claves en SourceVault que contienen certificados.
|
Extension
Describe una extensión de servicio en la nube.
InnerError
Detalles del error interno.
Nombre |
Tipo |
Description |
errordetail
|
string
|
Mensaje de error interno o volcado de memoria de excepciones.
|
exceptiontype
|
string
|
Tipo de la excepción.
|
LoadBalancerConfiguration
Describe la configuración del equilibrador de carga.
Nombre |
Tipo |
Description |
id
|
string
|
Id. de recurso
|
name
|
string
|
Nombre del equilibrador de carga
|
properties
|
LoadBalancerConfigurationProperties
|
Propiedades de la configuración del equilibrador de carga.
|
LoadBalancerConfigurationProperties
Describe las propiedades de la configuración del equilibrador de carga.
Nombre |
Tipo |
Description |
frontendIpConfigurations
|
LoadBalancerFrontendIpConfiguration[]
|
Especifica la dirección IP de front-end que se usará para el equilibrador de carga. Solo se admite la dirección IP de front-end IPv4. Cada configuración del equilibrador de carga debe tener exactamente una configuración ip de front-end.
|
LoadBalancerFrontendIpConfiguration
Especifica la dirección IP de front-end que se usará para el equilibrador de carga. Solo se admite la dirección IP de front-end IPv4. Cada configuración del equilibrador de carga debe tener exactamente una configuración ip de front-end.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre del recurso que es único dentro del conjunto de configuraciones ip de front-end usadas por el equilibrador de carga. Este nombre se puede usar para acceder al recurso.
|
properties
|
LoadBalancerFrontendIpConfigurationProperties
|
Propiedades de la configuración ip de front-end del equilibrador de carga.
|
LoadBalancerFrontendIpConfigurationProperties
Describe una configuración de IP de servicio en la nube
Nombre |
Tipo |
Description |
privateIPAddress
|
string
|
La dirección IP privada de la red virtual de la configuración de IP.
|
publicIPAddress
|
SubResource
|
Referencia al recurso de dirección IP pública.
|
subnet
|
SubResource
|
Referencia al recurso de subred de red virtual.
|
SubResource
Nombre |
Tipo |
Description |
id
|
string
|
Id. de recurso
|
SystemData
Metadatos del sistema relacionados con este recurso.
Nombre |
Tipo |
Description |
createdAt
|
string
|
Especifica la hora utc a la que se creó el recurso de servicio en la nube (soporte extendido). Versión mínima de api: 2022-04-04.
|
lastModifiedAt
|
string
|
Especifica la hora en UTC a la que se modificó por última vez el recurso del servicio en la nube (soporte extendido). Versión mínima de api: 2022-04-04.
|