Creates or updates a Service Fabric node type.
Create or update a Service Fabric node type of a given managed cluster.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}?api-version=2024-09-01-preview
URI Parameters
Name |
In |
Required |
Type |
Description |
clusterName
|
path |
True
|
string
|
The name of the cluster resource.
|
nodeTypeName
|
path |
True
|
string
|
The name of the node type.
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group.
|
subscriptionId
|
path |
True
|
string
|
The customer subscription identifier.
|
api-version
|
query |
True
|
string
|
The version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2024-09-01-preview" for this specification.
|
Request Body
Name |
Required |
Type |
Description |
properties.isPrimary
|
True
|
boolean
|
Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created.
|
properties.vmInstanceCount
|
True
|
integer
(int32)
minimum: -1 maximum: 2147483647
|
The number of nodes in the node type.
Values: -1 - Use when auto scale rules are configured or sku.capacity is defined 0 - Not supported >0 - Use for manual scale.
|
properties.additionalDataDisks
|
|
VmssDataDisk[]
|
Additional managed data disks.
|
properties.additionalNetworkInterfaceConfigurations
|
|
AdditionalNetworkInterfaceConfiguration[]
|
Specifies the settings for any additional secondary network interfaces to attach to the node type.
|
properties.applicationPorts
|
|
EndpointRangeDescription
|
The range of ports from which cluster assigned port to Service Fabric applications.
|
properties.capacities
|
|
object
|
The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has.
|
properties.computerNamePrefix
|
|
string
|
Specifies the computer name prefix. Limited to 9 characters. If specified, allows for a longer name to be specified for the node type name.
|
properties.dataDiskLetter
|
|
string
pattern: ^[a-zA-Z]{1}$
|
Managed data disk letter. It can not use the reserved letter C or D and it can not change after created.
|
properties.dataDiskSizeGB
|
|
integer
(int32)
|
Disk size for the managed disk attached to the vms on the node type in GBs.
|
properties.dataDiskType
|
|
DiskType
|
Managed data disk type. Specifies the storage account type for the managed disk
|
properties.dscpConfigurationId
|
|
string
(arm-id)
|
Specifies the resource id of the DSCP configuration to apply to the node type network interface.
|
properties.enableAcceleratedNetworking
|
|
boolean
|
Specifies whether the network interface is accelerated networking-enabled.
|
properties.enableEncryptionAtHost
|
|
boolean
|
Enable or disable the Host Encryption for the virtual machines on the node type. This will enable the encryption for all the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property is set to true for the resource.
|
properties.enableNodePublicIP
|
|
boolean
|
Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers.
|
properties.enableNodePublicIPv6
|
|
boolean
|
Specifies whether each node is allocated its own public IPv6 address. This is only supported on secondary node types with custom Load Balancers.
|
properties.enableOverProvisioning
|
|
boolean
|
Specifies whether the node type should be overprovisioned. It is only allowed for stateless node types.
|
properties.ephemeralPorts
|
|
EndpointRangeDescription
|
The range of ephemeral ports that nodes in this node type should be configured with.
|
properties.evictionPolicy
|
|
EvictionPolicyType
|
Specifies the eviction policy for virtual machines in a SPOT node type. Default is Delete.
|
properties.frontendConfigurations
|
|
FrontendConfiguration[]
|
Indicates the node type uses its own frontend configurations instead of the default one for the cluster. This setting can only be specified for non-primary node types and can not be added or removed after the node type is created.
|
properties.hostGroupId
|
|
string
|
Specifies the full host group resource Id. This property is used for deploying on azure dedicated hosts.
|
properties.isSpotVM
|
|
boolean
|
Indicates whether the node type will be Spot Virtual Machines. Azure will allocate the VMs if there is capacity available and the VMs can be evicted at any time.
|
properties.isStateless
|
|
boolean
|
Indicates if the node type can only host Stateless workloads.
|
properties.multiplePlacementGroups
|
|
boolean
|
Indicates if scale set associated with the node type can be composed of multiple placement groups.
|
properties.natConfigurations
|
|
NodeTypeNatConfig[]
|
Specifies the NAT configuration on default public Load Balancer for the node type. This is only supported for node types use the default public Load Balancer.
|
properties.natGatewayId
|
|
string
(arm-id)
|
Specifies the resource id of a NAT Gateway to attach to the subnet of this node type. Node type must use custom load balancer.
|
properties.networkSecurityRules
|
|
NetworkSecurityRule[]
|
The Network Security Rules for this node type. This setting can only be specified for node types that are configured with frontend configurations.
|
properties.placementProperties
|
|
object
|
The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run.
|
properties.secureBootEnabled
|
|
boolean
|
Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType
|
properties.securityType
|
|
securityType
|
Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported
|
properties.serviceArtifactReferenceId
|
|
string
(arm-id)
|
Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version.
|
properties.spotRestoreTimeout
|
|
string
|
Indicates the time duration after which the platform will not try to restore the VMSS SPOT instances specified as ISO 8601.
|
properties.subnetId
|
|
string
(arm-id)
|
Indicates the resource id of the subnet for the node type.
|
properties.useDefaultPublicLoadBalancer
|
|
boolean
|
Specifies whether the use public load balancer. If not specified and the node type doesn't have its own frontend configuration, it will be attached to the default load balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is true, then the frontend has to be an Internal Load Balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is false or not set, then the custom load balancer must include a public load balancer to provide outbound connectivity.
|
properties.useEphemeralOSDisk
|
|
boolean
|
Indicates whether to use ephemeral os disk. The sku selected on the vmSize property needs to support this feature.
|
properties.useTempDataDisk
|
|
boolean
|
Specifies whether to use the temporary disk for the service fabric data root, in which case no managed data disk will be attached and the temporary disk will be used. It is only allowed for stateless node types.
|
properties.vmApplications
|
|
VmApplication[]
|
Specifies the gallery applications that should be made available to the underlying VMSS.
|
properties.vmExtensions
|
|
VMSSExtension[]
|
virtual machine extensions.
Set of extensions that should be installed onto the virtual machines.
|
properties.vmImageOffer
|
|
string
|
The offer type of the Azure Virtual Machines Marketplace image. For example, UbuntuServer or WindowsServer.
|
properties.vmImagePlan
|
|
VmImagePlan
|
Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
|
properties.vmImagePublisher
|
|
string
|
The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer.
|
properties.vmImageResourceId
|
|
string
(arm-id)
|
Indicates the resource id of the vm image. This parameter is used for custom vm image.
|
properties.vmImageSku
|
|
string
|
The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or 2012-R2-Datacenter.
|
properties.vmImageVersion
|
|
string
|
The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
|
properties.vmManagedIdentity
|
|
VmManagedIdentity
|
Identities to assign to the virtual machine scale set under the node type.
|
properties.vmSecrets
|
|
VaultSecretGroup[]
|
virtual machine secretes.
The secrets to install in the virtual machines.
|
properties.vmSetupActions
|
|
VmSetupAction[]
|
Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime.
|
properties.vmSharedGalleryImageId
|
|
string
(arm-id)
|
Indicates the resource id of the vm shared galleries image. This parameter is used for custom vm image.
|
properties.vmSize
|
|
string
|
The size of virtual machines in the pool. All virtual machines in a pool are the same size. For example, Standard_D3.
|
properties.zones
|
|
string[]
|
Specifies the availability zones where the node type would span across. If the cluster is not spanning across availability zones, initiates az migration for the cluster.
|
sku
|
|
NodeTypeSku
|
The node type sku.
|
tags
|
|
object
|
Azure resource tags.
|
Responses
Name |
Type |
Description |
200 OK
|
NodeType
|
The operation completed successfully.
|
202 Accepted
|
NodeType
|
The request was accepted and the operation will complete asynchronously.
Headers
- Azure-AsyncOperation: string
- Location: string
|
Other Status Codes
|
ErrorModel
|
The detailed error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Put a node type with auto-scale parameters
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": -1,
"isStateless": true,
"multiplePlacementGroups": true,
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
],
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"
]
}
}
}
import com.azure.core.management.SubResource;
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.DiskType;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VaultCertificate;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VaultSecretGroup;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmManagedIdentity;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmssExtension;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationAutoScale_example.json
*/
/**
* Sample code: Put a node type with auto-scale parameters.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putANodeTypeWithAutoScaleParameters(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager)
throws IOException {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(-1).withDataDiskSizeGB(200).withDataDiskType(DiskType.PREMIUM_LRS)
.withPlacementProperties(mapOf("HasSSD", "true", "NodeColor", "green", "SomeProperty", "5"))
.withCapacities(mapOf("ClientConnections", "65536")).withVmSize("Standard_DS3")
.withVmImagePublisher("MicrosoftWindowsServer").withVmImageOffer("WindowsServer")
.withVmImageSku("2016-Datacenter-Server-Core").withVmImageVersion("latest")
.withVmSecrets(Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"))
.withVaultCertificates(Arrays.asList(new VaultCertificate()
.withCertificateUrl(
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c")
.withCertificateStore("My")))))
.withVmExtensions(Arrays.asList(new VmssExtension().withName("Microsoft.Azure.Geneva.GenevaMonitoring")
.withPublisher("Microsoft.Azure.Geneva").withType("GenevaMonitoring").withTypeHandlerVersion("2.0")
.withAutoUpgradeMinorVersion(true)
.withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}",
Object.class, SerializerEncoding.JSON))))
.withVmManagedIdentity(new VmManagedIdentity().withUserAssignedIdentities(Arrays.asList(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")))
.withIsStateless(true).withMultiplePlacementGroups(true).create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_auto_scale_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"capacities": {"ClientConnections": "65536"},
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"isPrimary": False,
"isStateless": True,
"multiplePlacementGroups": True,
"placementProperties": {"HasSSD": "true", "NodeColor": "green", "SomeProperty": "5"},
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": True,
"publisher": "Microsoft.Azure.Geneva",
"settings": {},
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
},
}
],
"vmImageOffer": "WindowsServer",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": -1,
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
]
},
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
}
],
}
],
"vmSize": "Standard_DS3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithAutoScaleParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
Capacities: map[string]*string{
"ClientConnections": to.Ptr("65536"),
},
DataDiskSizeGB: to.Ptr[int32](200),
DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
IsPrimary: to.Ptr(false),
IsStateless: to.Ptr(true),
MultiplePlacementGroups: to.Ptr(true),
PlacementProperties: map[string]*string{
"HasSSD": to.Ptr("true"),
"NodeColor": to.Ptr("green"),
"SomeProperty": to.Ptr("5"),
},
VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
{
Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
Type: to.Ptr("GenevaMonitoring"),
AutoUpgradeMinorVersion: to.Ptr(true),
Publisher: to.Ptr("Microsoft.Azure.Geneva"),
Settings: map[string]any{},
TypeHandlerVersion: to.Ptr("2.0"),
},
}},
VMImageOffer: to.Ptr("WindowsServer"),
VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](-1),
VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{
UserAssignedIdentities: []*string{
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")},
},
VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{
{
SourceVault: &armservicefabricmanagedclusters.SubResource{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
},
VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{
{
CertificateStore: to.Ptr("My"),
CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),
}},
}},
VMSize: to.Ptr("Standard_DS3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// "ClientConnections": to.Ptr("65536"),
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(true),
// MultiplePlacementGroups: to.Ptr(true),
// PlacementProperties: map[string]*string{
// "HasSSD": to.Ptr("true"),
// "NodeColor": to.Ptr("green"),
// "SomeProperty": to.Ptr("5"),
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
// {
// Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
// Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
// Type: to.Ptr("GenevaMonitoring"),
// AutoUpgradeMinorVersion: to.Ptr(true),
// ForceUpdateTag: to.Ptr("v.1.0"),
// Publisher: to.Ptr("Microsoft.Azure.Geneva"),
// Settings: map[string]any{
// },
// TypeHandlerVersion: to.Ptr("2.0"),
// },
// }},
// VMImageOffer: to.Ptr("WindowsServer"),
// VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
// VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{
// UserAssignedIdentities: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")},
// },
// VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{
// {
// SourceVault: &armservicefabricmanagedclusters.SubResource{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
// },
// VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{
// {
// CertificateStore: to.Ptr("My"),
// CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),
// }},
// }},
// VMSize: to.Ptr("Standard_DS3"),
// },
// SKU: &armservicefabricmanagedclusters.NodeTypeSKU{
// Name: to.Ptr("Standard_S2"),
// Capacity: to.Ptr[int32](10),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json
*/
async function putANodeTypeWithAutoScaleParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
capacities: { clientConnections: "65536" },
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: -1,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = -1,
DataDiskSizeInGB = 200,
DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs,
PlacementProperties =
{
["HasSSD"] = "true",
["NodeColor"] = "green",
["SomeProperty"] = "5",
},
Capacities =
{
["ClientConnections"] = "65536",
},
VmSize = "Standard_DS3",
VmImagePublisher = "MicrosoftWindowsServer",
VmImageOffer = "WindowsServer",
VmImageSku = "2016-Datacenter-Server-Core",
VmImageVersion = "latest",
VmSecrets =
{
new NodeTypeVaultSecretGroup(new WritableSubResource()
{
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
},new NodeTypeVaultCertificate[]
{
new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),"My")
})
},
VmExtensions =
{
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
{
AutoUpgradeMinorVersion = true,
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
}),
}
},
UserAssignedIdentities =
{
new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")
},
IsStateless = true,
HasMultiplePlacementGroups = true,
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"sku": {
"name": "Standard_S2",
"tier": "Standard",
"capacity": 10
},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": true,
"multiplePlacementGroups": true,
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
]
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"sku": {
"name": "Standard_S2",
"tier": "Standard",
"capacity": 10
},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": true,
"multiplePlacementGroups": true,
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
],
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"
]
}
}
}
Put a node type with maximum parameters
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE-testResourceGroup-testRegion-test?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"dataDiskLetter": "S",
"computerNamePrefix": "BE",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"isSpotVM": true,
"useEphemeralOSDisk": true,
"spotRestoreTimeout": "PT30M",
"evictionPolicy": "Deallocate",
"enableOverProvisioning": false,
"multiplePlacementGroups": true,
"securityType": "TrustedLaunch",
"secureBootEnabled": true,
"enableNodePublicIP": true,
"enableNodePublicIPv6": true,
"natGatewayId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
"serviceArtifactReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
"dscpConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {},
"setupOrder": [
"BeforeSFRuntime"
]
}
}
],
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"
]
},
"additionalDataDisks": [
{
"lun": 1,
"diskType": "StandardSSD_LRS",
"diskSizeGB": 256,
"diskLetter": "F"
},
{
"lun": 2,
"diskType": "Premium_LRS",
"diskSizeGB": 150,
"diskLetter": "G"
}
],
"enableAcceleratedNetworking": true,
"frontendConfigurations": [
{
"loadBalancerBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
"loadBalancerInboundNatPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
"applicationGatewayBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"useDefaultPublicLoadBalancer": true,
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
"vmSetupActions": [
"EnableContainers",
"EnableHyperV"
],
"additionalNetworkInterfaceConfigurations": [
{
"name": "nic-1",
"enableAcceleratedNetworking": true,
"dscpConfiguration": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"
},
"ipConfigurations": [
{
"name": "ipconfig-1",
"applicationGatewayBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"loadBalancerBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"
}
],
"loadBalancerInboundNatPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"
}
],
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
},
"privateIPAddressVersion": "IPv4",
"publicIPAddressConfiguration": {
"name": "publicip-1",
"ipTags": [
{
"ipTagType": "RoutingPreference",
"tag": "Internet"
}
],
"publicIPAddressVersion": "IPv4"
}
}
]
}
],
"vmApplications": [
{
"configurationReference": "https://mystorageaccount.blob.core.windows.net/containername/blobname",
"enableAutomaticUpgrade": true,
"order": 1,
"packageReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0",
"vmGalleryTags": "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}",
"treatFailureAsDeploymentFailure": false
}
]
}
}
import com.azure.core.management.SubResource;
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.AdditionalNetworkInterfaceConfiguration;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.DiskType;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.EvictionPolicyType;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.FrontendConfiguration;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.IpConfiguration;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.IpConfigurationPublicIpAddressConfiguration;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.IpTag;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.PrivateIpAddressVersion;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.PublicIpAddressVersion;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.SecurityType;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VaultCertificate;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VaultSecretGroup;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmApplication;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmManagedIdentity;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmSetupAction;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmssDataDisk;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmssExtension;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmssExtensionSetupOrder;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperation_example_max.json
*/
/**
* Sample code: Put a node type with maximum parameters.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putANodeTypeWithMaximumParameters(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager)
throws IOException {
manager.nodeTypes().define("BE-testResourceGroup-testRegion-test")
.withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false).withVmInstanceCount(10)
.withDataDiskSizeGB(200).withDataDiskType(DiskType.PREMIUM_LRS).withDataDiskLetter("S")
.withPlacementProperties(mapOf("HasSSD", "true", "NodeColor", "green", "SomeProperty", "5"))
.withCapacities(mapOf("ClientConnections", "65536")).withVmSize("Standard_DS3")
.withVmImagePublisher("MicrosoftWindowsServer").withVmImageOffer("WindowsServer")
.withVmImageSku("2016-Datacenter-Server-Core").withVmImageVersion("latest")
.withVmSecrets(Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"))
.withVaultCertificates(Arrays.asList(new VaultCertificate()
.withCertificateUrl(
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c")
.withCertificateStore("My")))))
.withVmExtensions(Arrays.asList(new VmssExtension().withName("Microsoft.Azure.Geneva.GenevaMonitoring")
.withPublisher("Microsoft.Azure.Geneva").withType("GenevaMonitoring").withTypeHandlerVersion("2.0")
.withAutoUpgradeMinorVersion(true)
.withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}",
Object.class, SerializerEncoding.JSON))
.withForceUpdateTag("v.1.0").withEnableAutomaticUpgrade(true)
.withSetupOrder(Arrays.asList(VmssExtensionSetupOrder.BEFORE_SFRUNTIME))))
.withVmManagedIdentity(new VmManagedIdentity().withUserAssignedIdentities(Arrays.asList(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")))
.withIsStateless(true).withMultiplePlacementGroups(true)
.withFrontendConfigurations(Arrays.asList(new FrontendConfiguration().withLoadBalancerBackendAddressPoolId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool")
.withLoadBalancerInboundNatPoolId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool")
.withApplicationGatewayBackendAddressPoolId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest")))
.withAdditionalDataDisks(Arrays.asList(
new VmssDataDisk().withLun(1).withDiskSizeGB(256).withDiskType(DiskType.STANDARD_SSD_LRS)
.withDiskLetter("F"),
new VmssDataDisk().withLun(2).withDiskSizeGB(150).withDiskType(DiskType.PREMIUM_LRS)
.withDiskLetter("G")))
.withEnableEncryptionAtHost(true).withEnableAcceleratedNetworking(true)
.withUseDefaultPublicLoadBalancer(true).withEnableOverProvisioning(false).withIsSpotVM(true)
.withUseEphemeralOSDisk(true).withSpotRestoreTimeout("PT30M")
.withEvictionPolicy(EvictionPolicyType.DEALLOCATE)
.withSubnetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")
.withVmSetupActions(Arrays.asList(VmSetupAction.ENABLE_CONTAINERS, VmSetupAction.ENABLE_HYPERV))
.withSecurityType(SecurityType.TRUSTED_LAUNCH).withSecureBootEnabled(true).withEnableNodePublicIp(true)
.withEnableNodePublicIPv6(true)
.withNatGatewayId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway")
.withServiceArtifactReferenceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile")
.withDscpConfigurationId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig")
.withAdditionalNetworkInterfaceConfigurations(Arrays.asList(new AdditionalNetworkInterfaceConfiguration()
.withName("nic-1").withEnableAcceleratedNetworking(true)
.withDscpConfiguration(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"))
.withIpConfigurations(Arrays.asList(new IpConfiguration().withName("ipconfig-1")
.withApplicationGatewayBackendAddressPools(Arrays.asList(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest")))
.withLoadBalancerBackendAddressPools(Arrays.asList(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool")))
.withLoadBalancerInboundNatPools(Arrays.asList(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool")))
.withSubnet(new SubResource().withId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"))
.withPrivateIpAddressVersion(PrivateIpAddressVersion.IPV4)
.withPublicIpAddressConfiguration(new IpConfigurationPublicIpAddressConfiguration()
.withName("publicip-1")
.withIpTags(Arrays.asList(new IpTag().withIpTagType("RoutingPreference").withTag("Internet")))
.withPublicIpAddressVersion(PublicIpAddressVersion.IPV4))))))
.withComputerNamePrefix("BE")
.withVmApplications(Arrays.asList(new VmApplication()
.withConfigurationReference("https://mystorageaccount.blob.core.windows.net/containername/blobname")
.withEnableAutomaticUpgrade(true).withOrder(1)
.withPackageReferenceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0")
.withVmGalleryTags("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}")
.withTreatFailureAsDeploymentFailure(false)))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_example_max.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE-testResourceGroup-testRegion-test",
parameters={
"properties": {
"additionalDataDisks": [
{"diskLetter": "F", "diskSizeGB": 256, "diskType": "StandardSSD_LRS", "lun": 1},
{"diskLetter": "G", "diskSizeGB": 150, "diskType": "Premium_LRS", "lun": 2},
],
"additionalNetworkInterfaceConfigurations": [
{
"dscpConfiguration": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"
},
"enableAcceleratedNetworking": True,
"ipConfigurations": [
{
"applicationGatewayBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"loadBalancerBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"
}
],
"loadBalancerInboundNatPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"
}
],
"name": "ipconfig-1",
"privateIPAddressVersion": "IPv4",
"publicIPAddressConfiguration": {
"ipTags": [{"ipTagType": "RoutingPreference", "tag": "Internet"}],
"name": "publicip-1",
"publicIPAddressVersion": "IPv4",
},
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
},
}
],
"name": "nic-1",
}
],
"capacities": {"ClientConnections": "65536"},
"computerNamePrefix": "BE",
"dataDiskLetter": "S",
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"dscpConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
"enableAcceleratedNetworking": True,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"enableNodePublicIPv6": True,
"enableOverProvisioning": False,
"evictionPolicy": "Deallocate",
"frontendConfigurations": [
{
"applicationGatewayBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
"loadBalancerBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
"loadBalancerInboundNatPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
}
],
"isPrimary": False,
"isSpotVM": True,
"isStateless": True,
"multiplePlacementGroups": True,
"natGatewayId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
"placementProperties": {"HasSSD": "true", "NodeColor": "green", "SomeProperty": "5"},
"secureBootEnabled": True,
"securityType": "TrustedLaunch",
"serviceArtifactReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
"spotRestoreTimeout": "PT30M",
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
"useDefaultPublicLoadBalancer": True,
"useEphemeralOSDisk": True,
"vmApplications": [
{
"configurationReference": "https://mystorageaccount.blob.core.windows.net/containername/blobname",
"enableAutomaticUpgrade": True,
"order": 1,
"packageReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0",
"treatFailureAsDeploymentFailure": False,
"vmGalleryTags": '{"Tag1":"Value1","Tag2":"Value2"}',
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": True,
"enableAutomaticUpgrade": True,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"settings": {},
"setupOrder": ["BeforeSFRuntime"],
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
},
}
],
"vmImageOffer": "WindowsServer",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
]
},
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
}
],
}
],
"vmSetupActions": ["EnableContainers", "EnableHyperV"],
"vmSize": "Standard_DS3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE-testResourceGroup-testRegion-test", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
AdditionalDataDisks: []*armservicefabricmanagedclusters.VmssDataDisk{
{
DiskLetter: to.Ptr("F"),
DiskSizeGB: to.Ptr[int32](256),
DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
Lun: to.Ptr[int32](1),
},
{
DiskLetter: to.Ptr("G"),
DiskSizeGB: to.Ptr[int32](150),
DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
Lun: to.Ptr[int32](2),
}},
AdditionalNetworkInterfaceConfigurations: []*armservicefabricmanagedclusters.AdditionalNetworkInterfaceConfiguration{
{
Name: to.Ptr("nic-1"),
DscpConfiguration: &armservicefabricmanagedclusters.SubResource{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
},
EnableAcceleratedNetworking: to.Ptr(true),
IPConfigurations: []*armservicefabricmanagedclusters.IPConfiguration{
{
Name: to.Ptr("ipconfig-1"),
ApplicationGatewayBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{
{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
}},
LoadBalancerBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{
{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
}},
LoadBalancerInboundNatPools: []*armservicefabricmanagedclusters.SubResource{
{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
}},
PrivateIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PrivateIPAddressVersionIPv4),
PublicIPAddressConfiguration: &armservicefabricmanagedclusters.IPConfigurationPublicIPAddressConfiguration{
Name: to.Ptr("publicip-1"),
IPTags: []*armservicefabricmanagedclusters.IPTag{
{
IPTagType: to.Ptr("RoutingPreference"),
Tag: to.Ptr("Internet"),
}},
PublicIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PublicIPAddressVersionIPv4),
},
Subnet: &armservicefabricmanagedclusters.SubResource{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
},
}},
}},
Capacities: map[string]*string{
"ClientConnections": to.Ptr("65536"),
},
ComputerNamePrefix: to.Ptr("BE"),
DataDiskLetter: to.Ptr("S"),
DataDiskSizeGB: to.Ptr[int32](200),
DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
DscpConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
EnableAcceleratedNetworking: to.Ptr(true),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
EnableNodePublicIPv6: to.Ptr(true),
EnableOverProvisioning: to.Ptr(false),
EvictionPolicy: to.Ptr(armservicefabricmanagedclusters.EvictionPolicyTypeDeallocate),
FrontendConfigurations: []*armservicefabricmanagedclusters.FrontendConfiguration{
{
ApplicationGatewayBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
LoadBalancerBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
LoadBalancerInboundNatPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
}},
IsPrimary: to.Ptr(false),
IsSpotVM: to.Ptr(true),
IsStateless: to.Ptr(true),
MultiplePlacementGroups: to.Ptr(true),
NatGatewayID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"),
PlacementProperties: map[string]*string{
"HasSSD": to.Ptr("true"),
"NodeColor": to.Ptr("green"),
"SomeProperty": to.Ptr("5"),
},
SecureBootEnabled: to.Ptr(true),
SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeTrustedLaunch),
ServiceArtifactReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"),
SpotRestoreTimeout: to.Ptr("PT30M"),
SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
UseDefaultPublicLoadBalancer: to.Ptr(true),
UseEphemeralOSDisk: to.Ptr(true),
VMApplications: []*armservicefabricmanagedclusters.VMApplication{
{
ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/containername/blobname"),
EnableAutomaticUpgrade: to.Ptr(true),
Order: to.Ptr[int32](1),
PackageReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"),
TreatFailureAsDeploymentFailure: to.Ptr(false),
VMGalleryTags: to.Ptr("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}"),
}},
VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
{
Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
Type: to.Ptr("GenevaMonitoring"),
AutoUpgradeMinorVersion: to.Ptr(true),
EnableAutomaticUpgrade: to.Ptr(true),
ForceUpdateTag: to.Ptr("v.1.0"),
Publisher: to.Ptr("Microsoft.Azure.Geneva"),
Settings: map[string]any{},
SetupOrder: []*armservicefabricmanagedclusters.VmssExtensionSetupOrder{
to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime)},
TypeHandlerVersion: to.Ptr("2.0"),
},
}},
VMImageOffer: to.Ptr("WindowsServer"),
VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](10),
VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{
UserAssignedIdentities: []*string{
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")},
},
VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{
{
SourceVault: &armservicefabricmanagedclusters.SubResource{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
},
VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{
{
CertificateStore: to.Ptr("My"),
CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),
}},
}},
VMSetupActions: []*armservicefabricmanagedclusters.VMSetupAction{
to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableContainers),
to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV)},
VMSize: to.Ptr("Standard_DS3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// AdditionalDataDisks: []*armservicefabricmanagedclusters.VmssDataDisk{
// {
// DiskLetter: to.Ptr("F"),
// DiskSizeGB: to.Ptr[int32](256),
// DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// Lun: to.Ptr[int32](1),
// },
// {
// DiskLetter: to.Ptr("G"),
// DiskSizeGB: to.Ptr[int32](150),
// DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
// Lun: to.Ptr[int32](2),
// }},
// AdditionalNetworkInterfaceConfigurations: []*armservicefabricmanagedclusters.AdditionalNetworkInterfaceConfiguration{
// {
// Name: to.Ptr("nic-1"),
// DscpConfiguration: &armservicefabricmanagedclusters.SubResource{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
// },
// EnableAcceleratedNetworking: to.Ptr(true),
// IPConfigurations: []*armservicefabricmanagedclusters.IPConfiguration{
// {
// Name: to.Ptr("ipconfig-1"),
// ApplicationGatewayBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
// }},
// LoadBalancerBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
// }},
// LoadBalancerInboundNatPools: []*armservicefabricmanagedclusters.SubResource{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
// }},
// PrivateIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PrivateIPAddressVersionIPv4),
// PublicIPAddressConfiguration: &armservicefabricmanagedclusters.IPConfigurationPublicIPAddressConfiguration{
// Name: to.Ptr("publicip-1"),
// IPTags: []*armservicefabricmanagedclusters.IPTag{
// {
// IPTagType: to.Ptr("RoutingPreference"),
// Tag: to.Ptr("Internet"),
// }},
// PublicIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PublicIPAddressVersionIPv4),
// },
// Subnet: &armservicefabricmanagedclusters.SubResource{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
// },
// }},
// }},
// Capacities: map[string]*string{
// "ClientConnections": to.Ptr("65536"),
// },
// DataDiskLetter: to.Ptr("S"),
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS),
// DscpConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
// EnableAcceleratedNetworking: to.Ptr(true),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// EnableNodePublicIPv6: to.Ptr(true),
// EnableOverProvisioning: to.Ptr(false),
// EvictionPolicy: to.Ptr(armservicefabricmanagedclusters.EvictionPolicyTypeDeallocate),
// FrontendConfigurations: []*armservicefabricmanagedclusters.FrontendConfiguration{
// {
// ApplicationGatewayBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
// LoadBalancerBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
// LoadBalancerInboundNatPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
// }},
// IsPrimary: to.Ptr(false),
// IsSpotVM: to.Ptr(true),
// IsStateless: to.Ptr(true),
// MultiplePlacementGroups: to.Ptr(true),
// NatGatewayID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"),
// PlacementProperties: map[string]*string{
// "HasSSD": to.Ptr("true"),
// "NodeColor": to.Ptr("green"),
// "SomeProperty": to.Ptr("5"),
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// SecureBootEnabled: to.Ptr(true),
// SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeTrustedLaunch),
// ServiceArtifactReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"),
// SpotRestoreTimeout: to.Ptr("PT30M"),
// SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
// UseDefaultPublicLoadBalancer: to.Ptr(true),
// UseEphemeralOSDisk: to.Ptr(true),
// VMApplications: []*armservicefabricmanagedclusters.VMApplication{
// {
// ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/containername/blobname"),
// EnableAutomaticUpgrade: to.Ptr(true),
// Order: to.Ptr[int32](1),
// PackageReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"),
// TreatFailureAsDeploymentFailure: to.Ptr(false),
// VMGalleryTags: to.Ptr("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}"),
// }},
// VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
// {
// Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
// Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
// Type: to.Ptr("GenevaMonitoring"),
// AutoUpgradeMinorVersion: to.Ptr(true),
// EnableAutomaticUpgrade: to.Ptr(true),
// ForceUpdateTag: to.Ptr("v.1.0"),
// Publisher: to.Ptr("Microsoft.Azure.Geneva"),
// Settings: map[string]any{
// },
// SetupOrder: []*armservicefabricmanagedclusters.VmssExtensionSetupOrder{
// to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime)},
// TypeHandlerVersion: to.Ptr("2.0"),
// },
// }},
// VMImageOffer: to.Ptr("WindowsServer"),
// VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
// VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{
// UserAssignedIdentities: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")},
// },
// VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{
// {
// SourceVault: &armservicefabricmanagedclusters.SubResource{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
// },
// VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{
// {
// CertificateStore: to.Ptr("My"),
// CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),
// }},
// }},
// VMSetupActions: []*armservicefabricmanagedclusters.VMSetupAction{
// to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableContainers),
// to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV)},
// VMSize: to.Ptr("Standard_DS3"),
// Zones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3")},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json
*/
async function putANodeTypeWithMaximumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE-testResourceGroup-testRegion-test";
const parameters = {
additionalDataDisks: [
{ diskLetter: "F", diskSizeGB: 256, diskType: "StandardSSD_LRS", lun: 1 },
{ diskLetter: "G", diskSizeGB: 150, diskType: "Premium_LRS", lun: 2 },
],
additionalNetworkInterfaceConfigurations: [
{
name: "nic-1",
dscpConfiguration: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
},
enableAcceleratedNetworking: true,
ipConfigurations: [
{
name: "ipconfig-1",
applicationGatewayBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
},
],
loadBalancerBackendAddressPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
},
],
loadBalancerInboundNatPools: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
privateIPAddressVersion: "IPv4",
publicIPAddressConfiguration: {
name: "publicip-1",
ipTags: [{ ipTagType: "RoutingPreference", tag: "Internet" }],
publicIPAddressVersion: "IPv4",
},
subnet: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
},
},
],
},
],
capacities: { clientConnections: "65536" },
computerNamePrefix: "BE",
dataDiskLetter: "S",
dataDiskSizeGB: 200,
dataDiskType: "Premium_LRS",
dscpConfigurationId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
enableAcceleratedNetworking: true,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
enableNodePublicIPv6: true,
enableOverProvisioning: false,
evictionPolicy: "Deallocate",
frontendConfigurations: [
{
applicationGatewayBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest",
loadBalancerBackendAddressPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
loadBalancerInboundNatPoolId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
},
],
isPrimary: false,
isSpotVM: true,
isStateless: true,
multiplePlacementGroups: true,
natGatewayId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
placementProperties: {
hasSSD: "true",
nodeColor: "green",
someProperty: "5",
},
secureBootEnabled: true,
securityType: "TrustedLaunch",
serviceArtifactReferenceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
spotRestoreTimeout: "PT30M",
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
useDefaultPublicLoadBalancer: true,
useEphemeralOSDisk: true,
vmApplications: [
{
configurationReference:
"https://mystorageaccount.blob.core.windows.net/containername/blobname",
enableAutomaticUpgrade: true,
order: 1,
packageReferenceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0",
treatFailureAsDeploymentFailure: false,
vmGalleryTags: '{"Tag1":"Value1","Tag2":"Value2"}',
},
],
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
enableAutomaticUpgrade: true,
forceUpdateTag: "v.1.0",
publisher: "Microsoft.Azure.Geneva",
settings: {},
setupOrder: ["BeforeSFRuntime"],
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmManagedIdentity: {
userAssignedIdentities: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2",
],
},
vmSecrets: [
{
sourceVault: {
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault",
},
vaultCertificates: [
{
certificateStore: "My",
certificateUrl:
"https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c",
},
],
},
],
vmSetupActions: ["EnableContainers", "EnableHyperV"],
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE-testResourceGroup-testRegion-test";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs,
DataDiskLetter = "S",
PlacementProperties =
{
["HasSSD"] = "true",
["NodeColor"] = "green",
["SomeProperty"] = "5",
},
Capacities =
{
["ClientConnections"] = "65536",
},
VmSize = "Standard_DS3",
VmImagePublisher = "MicrosoftWindowsServer",
VmImageOffer = "WindowsServer",
VmImageSku = "2016-Datacenter-Server-Core",
VmImageVersion = "latest",
VmSecrets =
{
new NodeTypeVaultSecretGroup(new WritableSubResource()
{
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"),
},new NodeTypeVaultCertificate[]
{
new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"),"My")
})
},
VmExtensions =
{
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
{
AutoUpgradeMinorVersion = true,
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
}),
ForceUpdateTag = "v.1.0",
IsAutomaticUpgradeEnabled = true,
SetupOrder =
{
VmssExtensionSetupOrder.BeforeSFRuntime
},
}
},
UserAssignedIdentities =
{
new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"),new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")
},
IsStateless = true,
HasMultiplePlacementGroups = true,
FrontendConfigurations =
{
new NodeTypeFrontendConfiguration()
{
LoadBalancerBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
LoadBalancerInboundNatPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
ApplicationGatewayBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
}
},
AdditionalDataDisks =
{
new NodeTypeVmssDataDisk(1,256,ServiceFabricManagedDataDiskType.StandardSsdLrs,"F"),new NodeTypeVmssDataDisk(2,150,ServiceFabricManagedDataDiskType.PremiumLrs,"G")
},
IsEncryptionAtHostEnabled = true,
IsAcceleratedNetworkingEnabled = true,
UseDefaultPublicLoadBalancer = true,
IsOverProvisioningEnabled = false,
IsSpotVm = true,
UseEphemeralOSDisk = true,
SpotRestoreTimeout = "PT30M",
EvictionPolicy = SpotNodeVmEvictionPolicyType.Deallocate,
SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
VmSetupActions =
{
VmSetupAction.EnableContainers,VmSetupAction.EnableHyperV
},
SecurityType = ServiceFabricManagedClusterSecurityType.TrustedLaunch,
IsSecureBootEnabled = true,
IsNodePublicIPEnabled = true,
IsNodePublicIPv6Enabled = true,
NatGatewayId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"),
ServiceArtifactReferenceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"),
DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
AdditionalNetworkInterfaceConfigurations =
{
new AdditionalNetworkInterfaceConfiguration("nic-1",new ServiceFabricManagedClusterIPConfiguration[]
{
new ServiceFabricManagedClusterIPConfiguration("ipconfig-1")
{
ApplicationGatewayBackendAddressPools =
{
new WritableSubResource()
{
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"),
}
},
LoadBalancerBackendAddressPools =
{
new WritableSubResource()
{
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"),
}
},
LoadBalancerInboundNatPools =
{
new WritableSubResource()
{
Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"),
}
},
SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
PrivateIPAddressVersion = ServiceFabricManagedClusterPrivateIPAddressVersion.IPv4,
PublicIPAddressConfiguration = new ServiceFabricManagedClusterPublicIPAddressConfiguration("publicip-1")
{
IPTags =
{
new ManagedClusterIPTag("RoutingPreference","Internet")
},
PublicIPAddressVersion = ServiceFabricManagedClusterPublicIPAddressVersion.IPv4,
},
}
})
{
EnableAcceleratedNetworking = true,
DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"),
}
},
ComputerNamePrefix = "BE",
VmApplications =
{
new ServiceFabricManagedVmApplication(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"))
{
ConfigurationReference = new Uri("https://mystorageaccount.blob.core.windows.net/containername/blobname"),
EnableAutomaticUpgrade = true,
Order = 1,
VmGalleryTags = "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}",
TreatFailureAsDeploymentFailure = false,
}
},
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"dataDiskLetter": "S",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"isSpotVM": true,
"useEphemeralOSDisk": true,
"spotRestoreTimeout": "PT30M",
"evictionPolicy": "Deallocate",
"enableOverProvisioning": false,
"multiplePlacementGroups": true,
"securityType": "TrustedLaunch",
"secureBootEnabled": true,
"enableNodePublicIP": true,
"enableNodePublicIPv6": true,
"natGatewayId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
"serviceArtifactReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
"dscpConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {},
"setupOrder": [
"BeforeSFRuntime"
]
}
}
],
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"
]
},
"additionalDataDisks": [
{
"lun": 1,
"diskType": "StandardSSD_LRS",
"diskSizeGB": 256,
"diskLetter": "F"
},
{
"lun": 2,
"diskType": "Premium_LRS",
"diskSizeGB": 150,
"diskLetter": "G"
}
],
"enableAcceleratedNetworking": true,
"frontendConfigurations": [
{
"loadBalancerBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
"loadBalancerInboundNatPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
"applicationGatewayBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"useDefaultPublicLoadBalancer": true,
"zones": [
"1",
"2",
"3"
],
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
"vmSetupActions": [
"EnableContainers",
"EnableHyperV"
],
"additionalNetworkInterfaceConfigurations": [
{
"name": "nic-1",
"enableAcceleratedNetworking": true,
"dscpConfiguration": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"
},
"ipConfigurations": [
{
"name": "ipconfig-1",
"applicationGatewayBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"loadBalancerBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"
}
],
"loadBalancerInboundNatPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"
}
],
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
},
"privateIPAddressVersion": "IPv4",
"publicIPAddressConfiguration": {
"name": "publicip-1",
"ipTags": [
{
"ipTagType": "RoutingPreference",
"tag": "Internet"
}
],
"publicIPAddressVersion": "IPv4"
}
}
]
}
],
"vmApplications": [
{
"configurationReference": "https://mystorageaccount.blob.core.windows.net/containername/blobname",
"enableAutomaticUpgrade": true,
"order": 1,
"packageReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0",
"vmGalleryTags": "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}",
"treatFailureAsDeploymentFailure": false
}
]
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "Premium_LRS",
"dataDiskLetter": "S",
"placementProperties": {
"HasSSD": "true",
"NodeColor": "green",
"SomeProperty": "5"
},
"capacities": {
"ClientConnections": "65536"
},
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"isSpotVM": true,
"useEphemeralOSDisk": true,
"spotRestoreTimeout": "PT30M",
"evictionPolicy": "Deallocate",
"enableOverProvisioning": false,
"multiplePlacementGroups": true,
"securityType": "TrustedLaunch",
"secureBootEnabled": true,
"enableNodePublicIP": true,
"enableNodePublicIPv6": true,
"natGatewayId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway",
"serviceArtifactReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile",
"dscpConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig",
"vmSecrets": [
{
"sourceVault": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"
},
"vaultCertificates": [
{
"certificateStore": "My",
"certificateUrl": "https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"
}
]
}
],
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"forceUpdateTag": "v.1.0",
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {},
"setupOrder": [
"BeforeSFRuntime"
]
}
}
],
"vmManagedIdentity": {
"userAssignedIdentities": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"
]
},
"additionalDataDisks": [
{
"lun": 1,
"diskType": "StandardSSD_LRS",
"diskSizeGB": 256,
"diskLetter": "F"
},
{
"lun": 2,
"diskType": "Premium_LRS",
"diskSizeGB": 150,
"diskLetter": "G"
}
],
"enableAcceleratedNetworking": true,
"frontendConfigurations": [
{
"loadBalancerBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool",
"loadBalancerInboundNatPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool",
"applicationGatewayBackendAddressPoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"useDefaultPublicLoadBalancer": true,
"zones": [
"1",
"2",
"3"
],
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
"vmSetupActions": [
"EnableContainers",
"EnableHyperV"
],
"additionalNetworkInterfaceConfigurations": [
{
"name": "nic-1",
"enableAcceleratedNetworking": true,
"dscpConfiguration": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"
},
"ipConfigurations": [
{
"name": "ipconfig-1",
"applicationGatewayBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"
}
],
"loadBalancerBackendAddressPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"
}
],
"loadBalancerInboundNatPools": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"
}
],
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
},
"privateIPAddressVersion": "IPv4",
"publicIPAddressConfiguration": {
"name": "publicip-1",
"ipTags": [
{
"ipTagType": "RoutingPreference",
"tag": "Internet"
}
],
"publicIPAddressVersion": "IPv4"
}
}
]
}
],
"vmApplications": [
{
"configurationReference": "https://mystorageaccount.blob.core.windows.net/containername/blobname",
"enableAutomaticUpgrade": true,
"order": 1,
"packageReferenceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0",
"vmGalleryTags": "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}",
"treatFailureAsDeploymentFailure": false
}
]
}
}
Put a node type with minimum parameters
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"vmSize": "Standard_D3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10
}
}
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperation_example_min.json
*/
/**
* Sample code: Put a node type with minimum parameters.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putANodeTypeWithMinimumParameters(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager) {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withDataDiskSizeGB(200).withVmSize("Standard_D3")
.withVmImagePublisher("MicrosoftWindowsServer").withVmImageOffer("WindowsServer")
.withVmImageSku("2016-Datacenter-Server-Core").withVmImageVersion("latest").create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_example_min.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"dataDiskSizeGB": 200,
"isPrimary": False,
"vmImageOffer": "WindowsServer",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmSize": "Standard_D3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMinimumParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
DataDiskSizeGB: to.Ptr[int32](200),
IsPrimary: to.Ptr(false),
VMImageOffer: to.Ptr("WindowsServer"),
VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](10),
VMSize: to.Ptr("Standard_D3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(false),
// PlacementProperties: map[string]*string{
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMImageOffer: to.Ptr("WindowsServer"),
// VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
// VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMSize: to.Ptr("Standard_D3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json
*/
async function putANodeTypeWithMinimumParameters() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
VmSize = "Standard_D3",
VmImagePublisher = "MicrosoftWindowsServer",
VmImageOffer = "WindowsServer",
VmImageSku = "2016-Datacenter-Server-Core",
VmImageVersion = "latest",
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": false
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": false
}
}
Put an stateless node type with temporary disk for service fabric
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"useTempDataDisk": true,
"multiplePlacementGroups": true,
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
]
}
}
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmssExtension;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationStateless_example.json
*/
/**
* Sample code: Put an stateless node type with temporary disk for service fabric.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager)
throws IOException {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withVmSize("Standard_DS3").withVmImagePublisher("MicrosoftWindowsServer")
.withVmImageOffer("WindowsServer").withVmImageSku("2016-Datacenter-Server-Core")
.withVmImageVersion("latest")
.withVmExtensions(Arrays.asList(new VmssExtension().withName("Microsoft.Azure.Geneva.GenevaMonitoring")
.withPublisher("Microsoft.Azure.Geneva").withType("GenevaMonitoring").withTypeHandlerVersion("2.0")
.withAutoUpgradeMinorVersion(true)
.withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}",
Object.class, SerializerEncoding.JSON))))
.withIsStateless(true).withMultiplePlacementGroups(true).withEnableEncryptionAtHost(true)
.withUseTempDataDisk(true).create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_stateless_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"enableEncryptionAtHost": True,
"isPrimary": False,
"isStateless": True,
"multiplePlacementGroups": True,
"useTempDataDisk": True,
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": True,
"publisher": "Microsoft.Azure.Geneva",
"settings": {},
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
},
}
],
"vmImageOffer": "WindowsServer",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmSize": "Standard_DS3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
EnableEncryptionAtHost: to.Ptr(true),
IsPrimary: to.Ptr(false),
IsStateless: to.Ptr(true),
MultiplePlacementGroups: to.Ptr(true),
UseTempDataDisk: to.Ptr(true),
VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
{
Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
Type: to.Ptr("GenevaMonitoring"),
AutoUpgradeMinorVersion: to.Ptr(true),
Publisher: to.Ptr("Microsoft.Azure.Geneva"),
Settings: map[string]any{},
TypeHandlerVersion: to.Ptr("2.0"),
},
}},
VMImageOffer: to.Ptr("WindowsServer"),
VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](10),
VMSize: to.Ptr("Standard_DS3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// EnableEncryptionAtHost: to.Ptr(true),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(true),
// MultiplePlacementGroups: to.Ptr(true),
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// UseTempDataDisk: to.Ptr(true),
// VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{
// {
// Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"),
// Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{
// Type: to.Ptr("GenevaMonitoring"),
// AutoUpgradeMinorVersion: to.Ptr(true),
// Publisher: to.Ptr("Microsoft.Azure.Geneva"),
// Settings: map[string]any{
// },
// TypeHandlerVersion: to.Ptr("2.0"),
// },
// }},
// VMImageOffer: to.Ptr("WindowsServer"),
// VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
// VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMSize: to.Ptr("Standard_DS3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json
*/
async function putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
enableEncryptionAtHost: true,
isPrimary: false,
isStateless: true,
multiplePlacementGroups: true,
useTempDataDisk: true,
vmExtensions: [
{
name: "Microsoft.Azure.Geneva.GenevaMonitoring",
type: "GenevaMonitoring",
autoUpgradeMinorVersion: true,
publisher: "Microsoft.Azure.Geneva",
settings: {},
typeHandlerVersion: "2.0",
},
],
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2016-Datacenter-Server-Core",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_DS3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
VmSize = "Standard_DS3",
VmImagePublisher = "MicrosoftWindowsServer",
VmImageOffer = "WindowsServer",
VmImageSku = "2016-Datacenter-Server-Core",
VmImageVersion = "latest",
VmExtensions =
{
new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring","Microsoft.Azure.Geneva","GenevaMonitoring","2.0")
{
AutoUpgradeMinorVersion = true,
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
}),
}
},
IsStateless = true,
HasMultiplePlacementGroups = true,
IsEncryptionAtHostEnabled = true,
UseTempDataDisk = true,
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"useTempDataDisk": true,
"multiplePlacementGroups": true,
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
]
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"vmSize": "Standard_DS3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2016-Datacenter-Server-Core",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"enableEncryptionAtHost": true,
"isStateless": true,
"useTempDataDisk": true,
"multiplePlacementGroups": true,
"vmExtensions": [
{
"name": "Microsoft.Azure.Geneva.GenevaMonitoring",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.0",
"settings": {}
}
}
]
}
}
Put node type with custom vm image
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"vmSize": "Standard_D3",
"vmImageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
"vmInstanceCount": 10
}
}
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationCustomImage_example.json
*/
/**
* Sample code: Put node type with custom vm image.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putNodeTypeWithCustomVmImage(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager) {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withDataDiskSizeGB(200).withVmSize("Standard_D3")
.withVmImageResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC")
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_custom_image_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"dataDiskSizeGB": 200,
"isPrimary": False,
"vmImageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
"vmInstanceCount": 10,
"vmSize": "Standard_D3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithCustomVmImage() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
DataDiskSizeGB: to.Ptr[int32](200),
IsPrimary: to.Ptr(false),
VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"),
VMInstanceCount: to.Ptr[int32](10),
VMSize: to.Ptr("Standard_D3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(false),
// PlacementProperties: map[string]*string{
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"),
// VMInstanceCount: to.Ptr[int32](10),
// VMSize: to.Ptr("Standard_D3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json
*/
async function putNodeTypeWithCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
VmSize = "Standard_D3",
VmImageResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"),
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
"vmInstanceCount": 10,
"isStateless": false
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC",
"vmInstanceCount": 10,
"isStateless": false
}
}
Put node type with dedicated hosts
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D8s_v3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2019-Datacenter",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"zones": [
"1"
],
"hostGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"
}
}
import com.azure.resourcemanager.servicefabricmanagedclusters.models.DiskType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationDedicatedHost_example.json
*/
/**
* Sample code: Put node type with dedicated hosts.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putNodeTypeWithDedicatedHosts(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager) {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withDataDiskSizeGB(200).withDataDiskType(DiskType.STANDARD_SSD_LRS)
.withPlacementProperties(mapOf()).withCapacities(mapOf()).withVmSize("Standard_D8s_v3")
.withVmImagePublisher("MicrosoftWindowsServer").withVmImageOffer("WindowsServer")
.withVmImageSku("2019-Datacenter").withVmImageVersion("latest").withZones(Arrays.asList("1"))
.withHostGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup")
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_dedicated_host_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"capacities": {},
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"hostGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
"isPrimary": False,
"placementProperties": {},
"vmImageOffer": "WindowsServer",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageSku": "2019-Datacenter",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmSize": "Standard_D8s_v3",
"zones": ["1"],
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithDedicatedHosts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
Capacities: map[string]*string{},
DataDiskSizeGB: to.Ptr[int32](200),
DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"),
IsPrimary: to.Ptr(false),
PlacementProperties: map[string]*string{},
VMImageOffer: to.Ptr("WindowsServer"),
VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
VMImageSKU: to.Ptr("2019-Datacenter"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](10),
VMSize: to.Ptr("Standard_D8s_v3"),
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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(false),
// PlacementProperties: map[string]*string{
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMImageOffer: to.Ptr("WindowsServer"),
// VMImagePublisher: to.Ptr("MicrosoftWindowsServer"),
// VMImageSKU: to.Ptr("2019-Datacenter"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMSize: to.Ptr("Standard_D8s_v3"),
// 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 {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json
*/
async function putNodeTypeWithDedicatedHosts() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
capacities: {},
dataDiskSizeGB: 200,
dataDiskType: "StandardSSD_LRS",
hostGroupId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
isPrimary: false,
placementProperties: {},
vmImageOffer: "WindowsServer",
vmImagePublisher: "MicrosoftWindowsServer",
vmImageSku: "2019-Datacenter",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D8s_v3",
zones: ["1"],
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
DataDiskType = ServiceFabricManagedDataDiskType.StandardSsdLrs,
PlacementProperties =
{
},
Capacities =
{
},
VmSize = "Standard_D8s_v3",
VmImagePublisher = "MicrosoftWindowsServer",
VmImageOffer = "WindowsServer",
VmImageSku = "2019-Datacenter",
VmImageVersion = "latest",
Zones =
{
"1"
},
HostGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D8s_v3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2019-Datacenter",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"zones": [
"1"
],
"hostGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
"isStateless": false
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D8s_v3",
"vmImagePublisher": "MicrosoftWindowsServer",
"vmImageOffer": "WindowsServer",
"vmImageSku": "2019-Datacenter",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"zones": [
"1"
],
"hostGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup",
"isStateless": false
}
}
Put node type with shared galleries custom vm image
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"vmSize": "Standard_D3",
"vmSharedGalleryImageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
"vmInstanceCount": 10
}
}
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
*/
/**
* Sample code: Put node type with shared galleries custom vm image.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putNodeTypeWithSharedGalleriesCustomVmImage(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager) {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withDataDiskSizeGB(200).withVmSize("Standard_D3")
.withVmSharedGalleryImageId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest")
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_custom_shared_galleries_image_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"dataDiskSizeGB": 200,
"isPrimary": False,
"vmInstanceCount": 10,
"vmSharedGalleryImageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
"vmSize": "Standard_D3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithSharedGalleriesCustomVmImage() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
DataDiskSizeGB: to.Ptr[int32](200),
IsPrimary: to.Ptr(false),
VMInstanceCount: to.Ptr[int32](10),
VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"),
VMSize: to.Ptr("Standard_D3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(false),
// PlacementProperties: map[string]*string{
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMInstanceCount: to.Ptr[int32](10),
// VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"),
// VMSize: to.Ptr("Standard_D3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
*/
async function putNodeTypeWithSharedGalleriesCustomVMImage() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmInstanceCount: 10,
vmSharedGalleryImageId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
VmSize = "Standard_D3",
VmSharedGalleryImageId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"),
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmSharedGalleryImageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
"vmInstanceCount": 10,
"isStateless": false
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmSharedGalleryImageId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest",
"vmInstanceCount": 10,
"isStateless": false
}
}
Put node type with vm image plan
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE?api-version=2024-09-01-preview
{
"properties": {
"isPrimary": false,
"dataDiskSizeGB": 200,
"vmSize": "Standard_D3",
"vmImagePublisher": "testpublisher",
"vmImageOffer": "windows_2022_test",
"vmImageSku": "win_2022_test_20_10_gen2",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmImagePlan": {
"name": "win_2022_test_20_10_gen2",
"publisher": "testpublisher",
"product": "windows_2022_test"
}
}
}
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VmImagePlan;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for NodeTypes CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/
* examples/NodeTypePutOperationVmImagePlan_example.json
*/
/**
* Sample code: Put node type with vm image plan.
*
* @param manager Entry point to ServiceFabricManagedClustersManager.
*/
public static void putNodeTypeWithVmImagePlan(
com.azure.resourcemanager.servicefabricmanagedclusters.ServiceFabricManagedClustersManager manager) {
manager.nodeTypes().define("BE").withExistingManagedCluster("resRg", "myCluster").withIsPrimary(false)
.withVmInstanceCount(10).withDataDiskSizeGB(200).withVmSize("Standard_D3")
.withVmImagePublisher("testpublisher").withVmImageOffer("windows_2022_test")
.withVmImageSku("win_2022_test_20_10_gen2").withVmImageVersion("latest").withVmImagePlan(new VmImagePlan()
.withName("win_2022_test_20_10_gen2").withProduct("windows_2022_test").withPublisher("testpublisher"))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicefabricmanagedclusters
# USAGE
python node_type_put_operation_vm_image_plan_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceFabricManagedClustersManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.node_types.begin_create_or_update(
resource_group_name="resRg",
cluster_name="myCluster",
node_type_name="BE",
parameters={
"properties": {
"dataDiskSizeGB": 200,
"isPrimary": False,
"vmImageOffer": "windows_2022_test",
"vmImagePlan": {
"name": "win_2022_test_20_10_gen2",
"product": "windows_2022_test",
"publisher": "testpublisher",
},
"vmImagePublisher": "testpublisher",
"vmImageSku": "win_2022_test_20_10_gen2",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"vmSize": "Standard_D3",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json
func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithVmImagePlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{
Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
DataDiskSizeGB: to.Ptr[int32](200),
IsPrimary: to.Ptr(false),
VMImageOffer: to.Ptr("windows_2022_test"),
VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{
Name: to.Ptr("win_2022_test_20_10_gen2"),
Product: to.Ptr("windows_2022_test"),
Publisher: to.Ptr("testpublisher"),
},
VMImagePublisher: to.Ptr("testpublisher"),
VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"),
VMImageVersion: to.Ptr("latest"),
VMInstanceCount: to.Ptr[int32](10),
VMSize: to.Ptr("Standard_D3"),
},
}, 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.NodeType = armservicefabricmanagedclusters.NodeType{
// Name: to.Ptr("BE"),
// Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"),
// Tags: map[string]*string{
// },
// Properties: &armservicefabricmanagedclusters.NodeTypeProperties{
// Capacities: map[string]*string{
// },
// DataDiskSizeGB: to.Ptr[int32](200),
// DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS),
// IsPrimary: to.Ptr(false),
// IsStateless: to.Ptr(false),
// PlacementProperties: map[string]*string{
// },
// ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded),
// VMImageOffer: to.Ptr("windows_2022_test"),
// VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{
// Name: to.Ptr("win_2022_test_20_10_gen2"),
// Product: to.Ptr("windows_2022_test"),
// Publisher: to.Ptr("testpublisher"),
// },
// VMImagePublisher: to.Ptr("testpublisher"),
// VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"),
// VMImageVersion: to.Ptr("latest"),
// VMInstanceCount: to.Ptr[int32](10),
// VMSize: to.Ptr("Standard_D3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const {
ServiceFabricManagedClustersManagementClient,
} = require("@azure/arm-servicefabricmanagedclusters");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Service Fabric node type of a given managed cluster.
*
* @summary Create or update a Service Fabric node type of a given managed cluster.
* x-ms-original-file: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json
*/
async function putNodeTypeWithVMImagePlan() {
const subscriptionId =
process.env["SERVICEFABRICMANAGEDCLUSTERS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SERVICEFABRICMANAGEDCLUSTERS_RESOURCE_GROUP"] || "resRg";
const clusterName = "myCluster";
const nodeTypeName = "BE";
const parameters = {
dataDiskSizeGB: 200,
isPrimary: false,
vmImageOffer: "windows_2022_test",
vmImagePlan: {
name: "win_2022_test_20_10_gen2",
product: "windows_2022_test",
publisher: "testpublisher",
},
vmImagePublisher: "testpublisher",
vmImageSku: "win_2022_test_20_10_gen2",
vmImageVersion: "latest",
vmInstanceCount: 10,
vmSize: "Standard_D3",
};
const credential = new DefaultAzureCredential();
const client = new ServiceFabricManagedClustersManagementClient(credential, subscriptionId);
const result = await client.nodeTypes.beginCreateOrUpdateAndWait(
resourceGroupName,
clusterName,
nodeTypeName,
parameters,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters.Models;
using Azure.ResourceManager.ServiceFabricManagedClusters;
// Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json
// this example is just showing the usage of "NodeTypes_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 ServiceFabricManagedClusterResource created on azure
// for more information of creating ServiceFabricManagedClusterResource, please refer to the document of ServiceFabricManagedClusterResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "resRg";
string clusterName = "myCluster";
ResourceIdentifier serviceFabricManagedClusterResourceId = ServiceFabricManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName);
ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId);
// get the collection of this ServiceFabricManagedNodeTypeResource
ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes();
// invoke the operation
string nodeTypeName = "BE";
ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData()
{
IsPrimary = false,
VmInstanceCount = 10,
DataDiskSizeInGB = 200,
VmSize = "Standard_D3",
VmImagePublisher = "testpublisher",
VmImageOffer = "windows_2022_test",
VmImageSku = "win_2022_test_20_10_gen2",
VmImageVersion = "latest",
VmImagePlan = new VmImagePlan()
{
Name = "win_2022_test_20_10_gen2",
Product = "windows_2022_test",
Publisher = "testpublisher",
},
};
ArmOperation<ServiceFabricManagedNodeTypeResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data);
ServiceFabricManagedNodeTypeResource 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
ServiceFabricManagedNodeTypeData 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
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Updating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImagePublisher": "testpublisher",
"vmImageOffer": "windows_2022_test",
"vmImageSku": "win_2022_test_20_10_gen2",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": false,
"vmImagePlan": {
"name": "win_2022_test_20_10_gen2",
"publisher": "testpublisher",
"product": "windows_2022_test"
}
}
}
Location: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationResults/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
Azure-AsyncOperation: http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-09-01-preview
{
"type": "Microsoft.ServiceFabric/managedClusters/nodeTypes",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE",
"name": "BE",
"tags": {},
"properties": {
"provisioningState": "Creating",
"isPrimary": false,
"dataDiskSizeGB": 200,
"dataDiskType": "StandardSSD_LRS",
"placementProperties": {},
"capacities": {},
"vmSize": "Standard_D3",
"vmImagePublisher": "testpublisher",
"vmImageOffer": "windows_2022_test",
"vmImageSku": "win_2022_test_20_10_gen2",
"vmImageVersion": "latest",
"vmInstanceCount": 10,
"isStateless": false,
"vmImagePlan": {
"name": "win_2022_test_20_10_gen2",
"publisher": "testpublisher",
"product": "windows_2022_test"
}
}
}
Definitions
Name |
Description |
access
|
The network traffic is allowed or denied.
|
AdditionalNetworkInterfaceConfiguration
|
Specifies the settings for a network interface to attach to the node type.
|
direction
|
Network security rule direction.
|
DiskType
|
Managed data disk type. IOPS and throughput are given by the disk size, to see more information go to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-types.
|
EndpointRangeDescription
|
Port range details
|
ErrorModel
|
The structure of the error.
|
ErrorModelError
|
The error details.
|
EvictionPolicyType
|
Specifies the eviction policy for virtual machines in a SPOT node type.
|
FrontendConfiguration
|
Describes the frontend configurations for the node type.
|
IPAddressType
|
The IP address type.
|
IpConfiguration
|
Specifies an IP configuration of the network interface.
|
IpTag
|
The IP tag associated with the public IP address.
|
ManagedResourceProvisioningState
|
The provisioning state of the managed resource.
|
NetworkSecurityRule
|
Describes a network security rule.
|
NodeType
|
Describes a node type in the cluster, each node type represents sub set of nodes in the cluster.
|
NodeTypeNatConfig
|
Provides information about NAT configuration on the default public Load Balancer for the node type.
|
NodeTypeSku
|
Describes a node type sku.
|
nsgProtocol
|
Network protocol this rule applies to.
|
privateIPAddressVersion
|
Specifies whether the IP configuration's private IP is IPv4 or IPv6. Default is IPv4.
|
PublicIPAddressConfiguration
|
The public IP address configuration of the network interface.
|
publicIPAddressVersion
|
Specifies whether the IP configuration's public IP is IPv4 or IPv6. Default is IPv4.
|
securityType
|
Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported
|
SubResource
|
Azure resource identifier.
|
SystemData
|
Metadata pertaining to creation and last modification of the resource.
|
VaultCertificate
|
Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.
|
VaultSecretGroup
|
Specifies set of certificates that should be installed onto the virtual machines.
|
VmApplication
|
Specifies the gallery application that should be made available to the underlying VMSS.
|
VmImagePlan
|
Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
|
VmManagedIdentity
|
Identities for the virtual machine scale set under the node type.
|
VmSetupAction
|
action to be performed on the vms before bootstrapping the service fabric runtime.
|
VmssDataDisk
|
Managed data disk description.
|
VMSSExtension
|
Specifies set of extensions that should be installed onto the virtual machines.
|
VmssExtensionSetupOrder
|
Vm extension setup order.
|
access
Enumeration
The network traffic is allowed or denied.
Value |
Description |
allow
|
|
deny
|
|
AdditionalNetworkInterfaceConfiguration
Object
Specifies the settings for a network interface to attach to the node type.
Name |
Type |
Description |
dscpConfiguration
|
SubResource
|
Specifies the DSCP configuration to apply to the network interface.
|
enableAcceleratedNetworking
|
boolean
|
Specifies whether the network interface is accelerated networking-enabled.
|
ipConfigurations
|
IpConfiguration[]
|
Specifies the IP configurations of the network interface.
|
name
|
string
|
Name of the network interface.
|
direction
Enumeration
Network security rule direction.
Value |
Description |
inbound
|
|
outbound
|
|
DiskType
Enumeration
Managed data disk type. IOPS and throughput are given by the disk size, to see more information go to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-types.
Value |
Description |
Standard_LRS
|
Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access.
|
StandardSSD_LRS
|
Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test.
|
Premium_LRS
|
Premium SSD locally redundant storage. Best for production and performance sensitive workloads.
|
EndpointRangeDescription
Object
Port range details
Name |
Type |
Description |
endPort
|
integer
(int32)
|
End port of a range of ports
|
startPort
|
integer
(int32)
|
Starting port of a range of ports
|
ErrorModel
Object
The structure of the error.
ErrorModelError
Object
The error details.
Name |
Type |
Description |
code
|
string
|
The error code.
|
message
|
string
|
The error message.
|
EvictionPolicyType
Enumeration
Specifies the eviction policy for virtual machines in a SPOT node type.
Value |
Description |
Delete
|
Eviction policy will be Delete for SPOT vms.
|
Deallocate
|
Eviction policy will be Deallocate for SPOT vms.
|
FrontendConfiguration
Object
Describes the frontend configurations for the node type.
Name |
Type |
Default value |
Description |
applicationGatewayBackendAddressPoolId
|
string
(arm-id)
|
|
The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/applicationGateways/<applicationGatewayName>/backendAddressPools/<backendAddressPoolName>'.
|
ipAddressType
|
IPAddressType
|
IPv4
|
The IP address type of this frontend configuration. If omitted the default value is IPv4.
|
loadBalancerBackendAddressPoolId
|
string
(arm-id)
|
|
The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/backendAddressPools/<backendAddressPoolName>'.
|
loadBalancerInboundNatPoolId
|
string
(arm-id)
|
|
The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/inboundNatPools/<inboundNatPoolName>'.
|
IPAddressType
Enumeration
The IP address type.
Value |
Description |
IPv4
|
IPv4 address type.
|
IPv6
|
IPv6 address type.
|
IpConfiguration
Object
Specifies an IP configuration of the network interface.
Name |
Type |
Default value |
Description |
applicationGatewayBackendAddressPools
|
SubResource[]
|
|
Specifies an array of references to backend address pools of application gateways. A node type can reference backend address pools of multiple application gateways. Multiple node types cannot use the same application gateway.
|
loadBalancerBackendAddressPools
|
SubResource[]
|
|
Specifies an array of references to backend address pools of load balancers. A node type can reference backend address pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer.
|
loadBalancerInboundNatPools
|
SubResource[]
|
|
Specifies an array of references to inbound Nat pools of the load balancers. A node type can reference inbound nat pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer.
|
name
|
string
|
|
Name of the network interface.
|
privateIPAddressVersion
|
privateIPAddressVersion
|
IPv4
|
Specifies whether the IP configuration's private IP is IPv4 or IPv6. Default is IPv4.
|
publicIPAddressConfiguration
|
PublicIPAddressConfiguration
|
|
The public IP address configuration of the network interface.
|
subnet
|
SubResource
|
|
Specifies the subnet of the network interface.
|
IpTag
Object
The IP tag associated with the public IP address.
Name |
Type |
Description |
ipTagType
|
string
|
IP tag type. Example: FirstPartyUsage.
|
tag
|
string
|
IP tag associated with the public IP. Example: SQL, Storage etc.
|
ManagedResourceProvisioningState
Enumeration
The provisioning state of the managed resource.
Value |
Description |
None
|
|
Creating
|
|
Created
|
|
Updating
|
|
Succeeded
|
|
Failed
|
|
Canceled
|
|
Deleting
|
|
Deleted
|
|
Other
|
|
NetworkSecurityRule
Object
Describes a network security rule.
Name |
Type |
Description |
access
|
access
|
The network traffic is allowed or denied.
|
description
|
string
|
Network security rule description.
|
destinationAddressPrefix
|
string
|
The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
|
destinationAddressPrefixes
|
string[]
|
The destination address prefixes. CIDR or destination IP ranges.
|
destinationPortRange
|
string
|
he destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
|
destinationPortRanges
|
string[]
|
The destination port ranges.
|
direction
|
direction
|
Network security rule direction.
|
name
|
string
|
Network security rule name.
|
priority
|
integer
(int32)
minimum: 1000 maximum: 3000
|
The priority of the rule. The value can be in the range 1000 to 3000. Values outside this range are reserved for Service Fabric ManagerCluster Resource Provider. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
|
protocol
|
nsgProtocol
|
Network protocol this rule applies to.
|
sourceAddressPrefix
|
string
|
The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
|
sourceAddressPrefixes
|
string[]
|
The CIDR or source IP ranges.
|
sourcePortRange
|
string
|
The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
|
sourcePortRanges
|
string[]
|
The source port ranges.
|
NodeType
Object
Describes a node type in the cluster, each node type represents sub set of nodes in the cluster.
Name |
Type |
Default value |
Description |
id
|
string
|
|
Azure resource identifier.
|
name
|
string
|
|
Azure resource name.
|
properties.additionalDataDisks
|
VmssDataDisk[]
|
|
Additional managed data disks.
|
properties.additionalNetworkInterfaceConfigurations
|
AdditionalNetworkInterfaceConfiguration[]
|
|
Specifies the settings for any additional secondary network interfaces to attach to the node type.
|
properties.applicationPorts
|
EndpointRangeDescription
|
|
The range of ports from which cluster assigned port to Service Fabric applications.
|
properties.capacities
|
object
|
|
The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has.
|
properties.computerNamePrefix
|
string
|
|
Specifies the computer name prefix. Limited to 9 characters. If specified, allows for a longer name to be specified for the node type name.
|
properties.dataDiskLetter
|
string
pattern: ^[a-zA-Z]{1}$
|
|
Managed data disk letter. It can not use the reserved letter C or D and it can not change after created.
|
properties.dataDiskSizeGB
|
integer
(int32)
|
|
Disk size for the managed disk attached to the vms on the node type in GBs.
|
properties.dataDiskType
|
DiskType
|
StandardSSD_LRS
|
Managed data disk type. Specifies the storage account type for the managed disk
|
properties.dscpConfigurationId
|
string
(arm-id)
|
|
Specifies the resource id of the DSCP configuration to apply to the node type network interface.
|
properties.enableAcceleratedNetworking
|
boolean
|
|
Specifies whether the network interface is accelerated networking-enabled.
|
properties.enableEncryptionAtHost
|
boolean
|
False
|
Enable or disable the Host Encryption for the virtual machines on the node type. This will enable the encryption for all the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property is set to true for the resource.
|
properties.enableNodePublicIP
|
boolean
|
|
Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers.
|
properties.enableNodePublicIPv6
|
boolean
|
|
Specifies whether each node is allocated its own public IPv6 address. This is only supported on secondary node types with custom Load Balancers.
|
properties.enableOverProvisioning
|
boolean
|
|
Specifies whether the node type should be overprovisioned. It is only allowed for stateless node types.
|
properties.ephemeralPorts
|
EndpointRangeDescription
|
|
The range of ephemeral ports that nodes in this node type should be configured with.
|
properties.evictionPolicy
|
EvictionPolicyType
|
|
Specifies the eviction policy for virtual machines in a SPOT node type. Default is Delete.
|
properties.frontendConfigurations
|
FrontendConfiguration[]
|
|
Indicates the node type uses its own frontend configurations instead of the default one for the cluster. This setting can only be specified for non-primary node types and can not be added or removed after the node type is created.
|
properties.hostGroupId
|
string
|
|
Specifies the full host group resource Id. This property is used for deploying on azure dedicated hosts.
|
properties.isPrimary
|
boolean
|
|
Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created.
|
properties.isSpotVM
|
boolean
|
|
Indicates whether the node type will be Spot Virtual Machines. Azure will allocate the VMs if there is capacity available and the VMs can be evicted at any time.
|
properties.isStateless
|
boolean
|
False
|
Indicates if the node type can only host Stateless workloads.
|
properties.multiplePlacementGroups
|
boolean
|
False
|
Indicates if scale set associated with the node type can be composed of multiple placement groups.
|
properties.natConfigurations
|
NodeTypeNatConfig[]
|
|
Specifies the NAT configuration on default public Load Balancer for the node type. This is only supported for node types use the default public Load Balancer.
|
properties.natGatewayId
|
string
(arm-id)
|
|
Specifies the resource id of a NAT Gateway to attach to the subnet of this node type. Node type must use custom load balancer.
|
properties.networkSecurityRules
|
NetworkSecurityRule[]
|
|
The Network Security Rules for this node type. This setting can only be specified for node types that are configured with frontend configurations.
|
properties.placementProperties
|
object
|
|
The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run.
|
properties.provisioningState
|
ManagedResourceProvisioningState
|
|
The provisioning state of the node type resource.
|
properties.secureBootEnabled
|
boolean
|
|
Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType
|
properties.securityType
|
securityType
|
|
Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported
|
properties.serviceArtifactReferenceId
|
string
(arm-id)
|
|
Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version.
|
properties.spotRestoreTimeout
|
string
|
|
Indicates the time duration after which the platform will not try to restore the VMSS SPOT instances specified as ISO 8601.
|
properties.subnetId
|
string
(arm-id)
|
|
Indicates the resource id of the subnet for the node type.
|
properties.useDefaultPublicLoadBalancer
|
boolean
|
|
Specifies whether the use public load balancer. If not specified and the node type doesn't have its own frontend configuration, it will be attached to the default load balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is true, then the frontend has to be an Internal Load Balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is false or not set, then the custom load balancer must include a public load balancer to provide outbound connectivity.
|
properties.useEphemeralOSDisk
|
boolean
|
|
Indicates whether to use ephemeral os disk. The sku selected on the vmSize property needs to support this feature.
|
properties.useTempDataDisk
|
boolean
|
|
Specifies whether to use the temporary disk for the service fabric data root, in which case no managed data disk will be attached and the temporary disk will be used. It is only allowed for stateless node types.
|
properties.vmApplications
|
VmApplication[]
|
|
Specifies the gallery applications that should be made available to the underlying VMSS.
|
properties.vmExtensions
|
VMSSExtension[]
|
|
virtual machine extensions.
Set of extensions that should be installed onto the virtual machines.
|
properties.vmImageOffer
|
string
|
|
The offer type of the Azure Virtual Machines Marketplace image. For example, UbuntuServer or WindowsServer.
|
properties.vmImagePlan
|
VmImagePlan
|
|
Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
|
properties.vmImagePublisher
|
string
|
|
The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer.
|
properties.vmImageResourceId
|
string
(arm-id)
|
|
Indicates the resource id of the vm image. This parameter is used for custom vm image.
|
properties.vmImageSku
|
string
|
|
The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or 2012-R2-Datacenter.
|
properties.vmImageVersion
|
string
|
|
The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
|
properties.vmInstanceCount
|
integer
(int32)
minimum: -1 maximum: 2147483647
|
|
The number of nodes in the node type.
Values: -1 - Use when auto scale rules are configured or sku.capacity is defined 0 - Not supported >0 - Use for manual scale.
|
properties.vmManagedIdentity
|
VmManagedIdentity
|
|
Identities to assign to the virtual machine scale set under the node type.
|
properties.vmSecrets
|
VaultSecretGroup[]
|
|
virtual machine secretes.
The secrets to install in the virtual machines.
|
properties.vmSetupActions
|
VmSetupAction[]
|
|
Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime.
|
properties.vmSharedGalleryImageId
|
string
(arm-id)
|
|
Indicates the resource id of the vm shared galleries image. This parameter is used for custom vm image.
|
properties.vmSize
|
string
|
|
The size of virtual machines in the pool. All virtual machines in a pool are the same size. For example, Standard_D3.
|
properties.zones
|
string[]
|
|
Specifies the availability zones where the node type would span across. If the cluster is not spanning across availability zones, initiates az migration for the cluster.
|
sku
|
NodeTypeSku
|
|
The node type sku.
|
systemData
|
SystemData
|
|
Metadata pertaining to creation and last modification of the resource.
|
tags
|
object
|
|
Azure resource tags.
|
type
|
string
|
|
Azure resource type.
|
NodeTypeNatConfig
Object
Provides information about NAT configuration on the default public Load Balancer for the node type.
Name |
Type |
Description |
backendPort
|
integer
(int32)
minimum: 1 maximum: 65535
|
The internal port for the NAT configuration.
|
frontendPortRangeEnd
|
integer
(int32)
minimum: 1 maximum: 65534
|
The port range end for the external endpoint.
|
frontendPortRangeStart
|
integer
(int32)
minimum: 1 maximum: 65534
|
The port range start for the external endpoint.
|
NodeTypeSku
Object
Describes a node type sku.
Name |
Type |
Description |
capacity
|
integer
(int32)
minimum: 1 maximum: 2147483647
|
The number of nodes in the node type.
If present in request it will override properties.vmInstanceCount.
|
name
|
string
|
The sku name.
Name is internally generated and is used in auto-scale scenarios. Property does not allow to be changed to other values than generated. To avoid deployment errors please omit the property.
|
tier
|
string
|
Specifies the tier of the node type.
Possible Values: Standard
|
nsgProtocol
Enumeration
Network protocol this rule applies to.
Value |
Description |
http
|
|
https
|
|
tcp
|
|
udp
|
|
icmp
|
|
ah
|
|
esp
|
|
privateIPAddressVersion
Enumeration
Specifies whether the IP configuration's private IP is IPv4 or IPv6. Default is IPv4.
Value |
Description |
IPv4
|
|
IPv6
|
|
PublicIPAddressConfiguration
Object
The public IP address configuration of the network interface.
Name |
Type |
Default value |
Description |
ipTags
|
IpTag[]
|
|
Specifies the list of IP tags associated with the public IP address.
|
name
|
string
|
|
Name of the network interface.
|
publicIPAddressVersion
|
publicIPAddressVersion
|
IPv4
|
Specifies whether the IP configuration's public IP is IPv4 or IPv6. Default is IPv4.
|
publicIPAddressVersion
Enumeration
Specifies whether the IP configuration's public IP is IPv4 or IPv6. Default is IPv4.
Value |
Description |
IPv4
|
|
IPv6
|
|
securityType
Enumeration
Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported
Value |
Description |
TrustedLaunch
|
Trusted Launch is a security type that secures generation 2 virtual machines.
|
Standard
|
Standard is the default security type for all machines.
|
SubResource
Object
Azure resource identifier.
Name |
Type |
Description |
id
|
string
|
Azure resource identifier.
|
SystemData
Object
Metadata pertaining to creation and last modification of the resource.
Name |
Type |
Description |
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
createdBy
|
string
|
The identity that created the resource.
|
createdByType
|
string
|
The type of identity that created the resource.
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC).
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
lastModifiedByType
|
string
|
The type of identity that last modified the resource.
|
VaultCertificate
Object
Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.
Name |
Type |
Description |
certificateStore
|
string
|
For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.
For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted.
|
certificateUrl
|
string
|
This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see Add a key or secret to the key vault.
|
VaultSecretGroup
Object
Specifies set of certificates that should be installed onto the virtual machines.
Name |
Type |
Description |
sourceVault
|
SubResource
|
The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
|
vaultCertificates
|
VaultCertificate[]
|
The list of key vault references in SourceVault which contain certificates.
|
VmApplication
Object
Specifies the gallery application that should be made available to the underlying VMSS.
Name |
Type |
Description |
configurationReference
|
string
(uri)
|
Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided.
|
enableAutomaticUpgrade
|
boolean
|
If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the underlying VMSS.
|
order
|
integer
(int32)
|
Optional, Specifies the order in which the packages have to be installed.
|
packageReferenceId
|
string
(arm-id)
|
Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}.
|
treatFailureAsDeploymentFailure
|
boolean
|
Optional, If true, any failure for any operation in the VmApplication will fail the deployment.
|
vmGalleryTags
|
string
|
Optional, Specifies a passthrough value for more generic context. Accepts a JSON-formatted string e.g. '{"Tag1":"Value1","Tag2":"Value2"}'.
|
VmImagePlan
Object
Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
Name |
Type |
Description |
name
|
string
|
The plan ID.
|
product
|
string
|
Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
|
promotionCode
|
string
|
The promotion code.
|
publisher
|
string
|
The publisher ID.
|
VmManagedIdentity
Object
Identities for the virtual machine scale set under the node type.
Name |
Type |
Description |
userAssignedIdentities
|
string[]
|
The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
VmSetupAction
Enumeration
action to be performed on the vms before bootstrapping the service fabric runtime.
Value |
Description |
EnableContainers
|
Enable windows containers feature.
|
EnableHyperV
|
Enables windows HyperV feature.
|
VmssDataDisk
Object
Managed data disk description.
Name |
Type |
Default value |
Description |
diskLetter
|
string
pattern: ^[a-zA-Z]{1}$
|
|
Managed data disk letter. It can not use the reserved letter C or D and it can not change after created.
|
diskSizeGB
|
integer
(int32)
|
|
Disk size for each vm in the node type in GBs.
|
diskType
|
DiskType
|
StandardSSD_LRS
|
Managed data disk type. Specifies the storage account type for the managed disk
|
lun
|
integer
(int32)
minimum: 1
|
|
Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. Lun 0 is reserved for the service fabric data disk.
|
VMSSExtension
Object
Specifies set of extensions that should be installed onto the virtual machines.
Name |
Type |
Description |
name
|
string
|
The name of the extension.
|
properties.autoUpgradeMinorVersion
|
boolean
|
Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
|
properties.enableAutomaticUpgrade
|
boolean
|
Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
|
properties.forceUpdateTag
|
string
|
If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.
|
properties.protectedSettings
|
object
|
The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
|
properties.provisionAfterExtensions
|
string[]
|
Collection of extension names after which this extension needs to be provisioned.
|
properties.provisioningState
|
string
|
The provisioning state, which only appears in the response.
|
properties.publisher
|
string
|
The name of the extension handler publisher.
|
properties.settings
|
object
|
Json formatted public settings for the extension.
|
properties.setupOrder
|
VmssExtensionSetupOrder[]
|
Indicates the setup order for the extension.
|
properties.type
|
string
|
Specifies the type of the extension; an example is "CustomScriptExtension".
|
properties.typeHandlerVersion
|
string
|
Specifies the version of the script handler.
|
VmssExtensionSetupOrder
Enumeration
Vm extension setup order.
Value |
Description |
BeforeSFRuntime
|
Indicates that the vm extension should run before the service fabric runtime starts.
|