Cree o actualice grupos de contenedores con configuraciones especificadas.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}?api-version=2023-05-01
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
containerGroupName
|
path |
True
|
string
|
Nombre del grupo de contenedores.
|
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos.
|
subscriptionId
|
path |
True
|
string
|
Credenciales de suscripción que identifican de forma única la suscripción de Microsoft Azure. El identificador de suscripción forma parte del URI de cada llamada de servicio.
|
api-version
|
query |
True
|
string
|
Versión de la API de cliente
|
Cuerpo de la solicitud
Nombre |
Requerido |
Tipo |
Description |
properties.containers
|
True
|
Container[]
|
Contenedores dentro del grupo de contenedores.
|
properties.osType
|
True
|
OperatingSystemTypes
|
Tipo de sistema operativo requerido por los contenedores del grupo de contenedores.
|
identity
|
|
ContainerGroupIdentity
|
Identidad del grupo de contenedores, si está configurada.
|
location
|
|
string
|
Ubicación del recurso.
|
properties.confidentialComputeProperties
|
|
ConfidentialComputeProperties
|
Propiedades del grupo de contenedores confidenciales
|
properties.diagnostics
|
|
ContainerGroupDiagnostics
|
Información de diagnóstico de un grupo de contenedores.
|
properties.dnsConfig
|
|
DnsConfiguration
|
Información de configuración de DNS para un grupo de contenedores.
|
properties.encryptionProperties
|
|
EncryptionProperties
|
Propiedades de cifrado de un grupo de contenedores.
|
properties.extensions
|
|
DeploymentExtensionSpec[]
|
extensiones usadas por kubelet virtual
|
properties.imageRegistryCredentials
|
|
ImageRegistryCredential[]
|
Credenciales del Registro de imágenes a partir de las cuales se crea el grupo de contenedores.
|
properties.initContainers
|
|
InitContainerDefinition[]
|
Contenedores de inicialización de un grupo de contenedores.
|
properties.ipAddress
|
|
IpAddress
|
Tipo de dirección IP del grupo de contenedores.
|
properties.priority
|
|
ContainerGroupPriority
|
Prioridad del grupo de contenedores.
|
properties.restartPolicy
|
|
ContainerGroupRestartPolicy
|
Reinicie la directiva para todos los contenedores del grupo de contenedores.
- reinicio siempre de
Always
-
OnFailure Reiniciar en caso de error
-
Never no reiniciar nunca
|
properties.sku
|
|
ContainerGroupSku
|
SKU de un grupo de contenedores.
|
properties.subnetIds
|
|
ContainerGroupSubnetId[]
|
Identificadores de recursos de subred para un grupo de contenedores.
|
properties.volumes
|
|
Volume[]
|
Lista de volúmenes que pueden montar los contenedores de este grupo de contenedores.
|
tags
|
|
object
|
Etiquetas de recursos.
|
zones
|
|
string[]
|
Zonas para el grupo de contenedores.
|
Respuestas
Nombre |
Tipo |
Description |
200 OK
|
ContainerGroup
|
De acuerdo
|
201 Created
|
ContainerGroup
|
Creado: se crea el grupo de contenedores.
|
Other Status Codes
|
CloudError
|
Respuesta de error que describe por qué se produjo un error en la operación.
|
Seguridad
azure_auth
Flujo de OAuth2 de Azure Active Directory
Tipo:
oauth2
Flujo:
implicit
Dirección URL de autorización:
https://login.microsoftonline.com/common/oauth2/authorize
Ámbitos
Nombre |
Description |
user_impersonation
|
Suplantar la cuenta de usuario
|
Ejemplos
ConfidentialContainerGroup
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1?api-version=2023-05-01
{
"location": "westeurope",
"properties": {
"containers": [
{
"name": "accdemo",
"properties": {
"command": [],
"environmentVariables": [],
"image": "confiimage",
"ports": [
{
"port": 8000
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5
}
},
"securityContext": {
"privileged": false,
"capabilities": {
"add": [
"CAP_NET_ADMIN"
]
}
}
}
}
],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 8000
}
],
"type": "Public"
},
"osType": "Linux",
"sku": "Confidential",
"confidentialComputeProperties": {
"ccePolicy": "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"
}
}
}
import com.azure.resourcemanager.containerinstance.fluent.models.ContainerGroupInner;
import com.azure.resourcemanager.containerinstance.models.ConfidentialComputeProperties;
import com.azure.resourcemanager.containerinstance.models.Container;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIpAddressType;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupNetworkProtocol;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupSku;
import com.azure.resourcemanager.containerinstance.models.ContainerPort;
import com.azure.resourcemanager.containerinstance.models.IpAddress;
import com.azure.resourcemanager.containerinstance.models.OperatingSystemTypes;
import com.azure.resourcemanager.containerinstance.models.Port;
import com.azure.resourcemanager.containerinstance.models.ResourceRequests;
import com.azure.resourcemanager.containerinstance.models.ResourceRequirements;
import com.azure.resourcemanager.containerinstance.models.SecurityContextCapabilitiesDefinition;
import com.azure.resourcemanager.containerinstance.models.SecurityContextDefinition;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/
* ContainerGroupCreateConfidential.json
*/
/**
* Sample code: ConfidentialContainerGroup.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void confidentialContainerGroup(com.azure.resourcemanager.AzureResourceManager azure) {
azure.containerGroups().manager().serviceClient().getContainerGroups().createOrUpdate("demo", "demo1",
new ContainerGroupInner().withLocation("westeurope")
.withContainers(Arrays.asList(new Container().withName("accdemo").withImage("confiimage")
.withCommand(Arrays.asList()).withPorts(Arrays.asList(new ContainerPort().withPort(8000)))
.withEnvironmentVariables(Arrays.asList())
.withResources(new ResourceRequirements()
.withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0)))
.withSecurityContext(new SecurityContextDefinition().withPrivileged(false).withCapabilities(
new SecurityContextCapabilitiesDefinition().withAdd(Arrays.asList("CAP_NET_ADMIN"))))))
.withImageRegistryCredentials(Arrays.asList())
.withIpAddress(new IpAddress()
.withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(8000)))
.withType(ContainerGroupIpAddressType.PUBLIC))
.withOsType(OperatingSystemTypes.LINUX).withSku(ContainerGroupSku.CONFIDENTIAL)
.withConfidentialComputeProperties(new ConfidentialComputeProperties().withCcePolicy(
"eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")),
com.azure.core.util.Context.NONE);
}
// 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.containerinstance import ContainerInstanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerinstance
# USAGE
python container_group_create_confidential.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 = ContainerInstanceManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.container_groups.begin_create_or_update(
resource_group_name="demo",
container_group_name="demo1",
container_group={
"location": "westeurope",
"properties": {
"confidentialComputeProperties": {
"ccePolicy": "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"
},
"containers": [
{
"name": "accdemo",
"properties": {
"command": [],
"environmentVariables": [],
"image": "confiimage",
"ports": [{"port": 8000}],
"resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
"securityContext": {"capabilities": {"add": ["CAP_NET_ADMIN"]}, "privileged": False},
},
}
],
"imageRegistryCredentials": [],
"ipAddress": {"ports": [{"port": 8000, "protocol": "TCP"}], "type": "Public"},
"osType": "Linux",
"sku": "Confidential",
},
},
).result()
print(response)
# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupCreateConfidential.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 armcontainerinstance_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/containerinstance/armcontainerinstance/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupCreateConfidential.json
func ExampleContainerGroupsClient_BeginCreateOrUpdate_confidentialContainerGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{
Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
ConfidentialComputeProperties: &armcontainerinstance.ConfidentialComputeProperties{
CcePolicy: to.Ptr("eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"),
},
Containers: []*armcontainerinstance.Container{
{
Name: to.Ptr("accdemo"),
Properties: &armcontainerinstance.ContainerProperties{
Command: []*string{},
EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{},
Image: to.Ptr("confiimage"),
Ports: []*armcontainerinstance.ContainerPort{
{
Port: to.Ptr[int32](8000),
}},
Resources: &armcontainerinstance.ResourceRequirements{
Requests: &armcontainerinstance.ResourceRequests{
CPU: to.Ptr[float64](1),
MemoryInGB: to.Ptr[float64](1.5),
},
},
SecurityContext: &armcontainerinstance.SecurityContextDefinition{
Capabilities: &armcontainerinstance.SecurityContextCapabilitiesDefinition{
Add: []*string{
to.Ptr("CAP_NET_ADMIN")},
},
Privileged: to.Ptr(false),
},
},
}},
ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{},
IPAddress: &armcontainerinstance.IPAddress{
Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
Ports: []*armcontainerinstance.Port{
{
Port: to.Ptr[int32](8000),
Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
}},
},
OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUConfidential),
},
Location: to.Ptr("westeurope"),
}, 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.ContainerGroup = armcontainerinstance.ContainerGroup{
// Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
// ConfidentialComputeProperties: &armcontainerinstance.ConfidentialComputeProperties{
// CcePolicy: to.Ptr("eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"),
// },
// Containers: []*armcontainerinstance.Container{
// {
// Name: to.Ptr("accdemo"),
// Properties: &armcontainerinstance.ContainerProperties{
// Command: []*string{
// },
// EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
// },
// Image: to.Ptr("confiimage"),
// Ports: []*armcontainerinstance.ContainerPort{
// {
// Port: to.Ptr[int32](8000),
// }},
// Resources: &armcontainerinstance.ResourceRequirements{
// Requests: &armcontainerinstance.ResourceRequests{
// CPU: to.Ptr[float64](1),
// MemoryInGB: to.Ptr[float64](1.5),
// },
// },
// SecurityContext: &armcontainerinstance.SecurityContextDefinition{
// Capabilities: &armcontainerinstance.SecurityContextCapabilitiesDefinition{
// Add: []*string{
// to.Ptr("CAP_NET_ADMIN")},
// },
// Privileged: to.Ptr(false),
// },
// },
// }},
// ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
// },
// InitContainers: []*armcontainerinstance.InitContainerDefinition{
// },
// InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{
// Events: []*armcontainerinstance.Event{
// },
// State: to.Ptr("Running"),
// },
// IPAddress: &armcontainerinstance.IPAddress{
// Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
// Ports: []*armcontainerinstance.Port{
// {
// Port: to.Ptr[int32](8000),
// Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
// }},
// },
// OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUConfidential),
// },
// Name: to.Ptr("demo1"),
// Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"),
// Location: to.Ptr("westeurope"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update container groups with specified configurations.
*
* @summary Create or update container groups with specified configurations.
* x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupCreateConfidential.json
*/
async function confidentialContainerGroup() {
const subscriptionId = process.env["CONTAINERINSTANCE_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["CONTAINERINSTANCE_RESOURCE_GROUP"] || "demo";
const containerGroupName = "demo1";
const containerGroup = {
confidentialComputeProperties: {
ccePolicy:
"eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19",
},
containers: [
{
name: "accdemo",
command: [],
environmentVariables: [],
image: "confiimage",
ports: [{ port: 8000 }],
resources: { requests: { cpu: 1, memoryInGB: 1.5 } },
securityContext: {
capabilities: { add: ["CAP_NET_ADMIN"] },
privileged: false,
},
},
],
imageRegistryCredentials: [],
ipAddress: { type: "Public", ports: [{ port: 8000, protocol: "TCP" }] },
location: "westeurope",
osType: "Linux",
sku: "Confidential",
};
const credential = new DefaultAzureCredential();
const client = new ContainerInstanceManagementClient(credential, subscriptionId);
const result = await client.containerGroups.beginCreateOrUpdateAndWait(
resourceGroupName,
containerGroupName,
containerGroup
);
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.ContainerInstance.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ContainerInstance;
// Generated from example definition: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupCreateConfidential.json
// this example is just showing the usage of "ContainerGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "demo";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ContainerGroupResource
ContainerGroupCollection collection = resourceGroupResource.GetContainerGroups();
// invoke the operation
string containerGroupName = "demo1";
ContainerGroupData data = new ContainerGroupData(new AzureLocation("westeurope"), new ContainerInstanceContainer[]
{
new ContainerInstanceContainer("accdemo","confiimage",new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))
{
Command =
{
},
Ports =
{
new ContainerPort(8000)
},
EnvironmentVariables =
{
},
SecurityContext = new ContainerSecurityContextDefinition()
{
IsPrivileged = false,
Capabilities = new ContainerSecurityContextCapabilitiesDefinition()
{
Add =
{
"CAP_NET_ADMIN"
},
},
},
}
}, ContainerInstanceOperatingSystemType.Linux)
{
ImageRegistryCredentials =
{
},
IPAddress = new ContainerGroupIPAddress(new ContainerGroupPort[]
{
new ContainerGroupPort(8000)
{
Protocol = ContainerGroupNetworkProtocol.Tcp,
}
}, ContainerGroupIPAddressType.Public),
Sku = ContainerGroupSku.Confidential,
ConfidentialComputeCcePolicy = "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19",
};
ArmOperation<ContainerGroupResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerGroupName, data);
ContainerGroupResource 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
ContainerGroupData 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
Respuesta de muestra
{
"properties": {
"sku": "Confidential",
"provisioningState": "Succeeded",
"containers": [
{
"name": "accdemo",
"properties": {
"image": "confiimage",
"command": [],
"ports": [
{
"port": 8000
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
},
"securityContext": {
"privileged": false,
"capabilities": {
"add": [
"CAP_NET_ADMIN"
]
}
}
}
}
],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 8000
}
],
"type": "Public"
},
"initContainers": [],
"imageRegistryCredentials": [],
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Running"
},
"confidentialComputeProperties": {
"ccePolicy": "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"
}
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "westeurope"
}
{
"properties": {
"sku": "Confidential",
"provisioningState": "Succeeded",
"containers": [
{
"name": "accdemo",
"properties": {
"image": "confiimage",
"command": [],
"ports": [
{
"port": 8000
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
},
"securityContext": {
"privileged": false,
"capabilities": {
"add": [
"CAP_NET_ADMIN"
]
}
}
}
}
],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 8000
}
],
"type": "Public"
},
"initContainers": [],
"imageRegistryCredentials": [],
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Running"
},
"confidentialComputeProperties": {
"ccePolicy": "eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"
}
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "westeurope"
}
ContainerGroupCreateWithExtensions
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1?api-version=2023-05-01
{
"location": "eastus2",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5
}
}
}
}
],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Private"
},
"osType": "Linux",
"subnetIds": [
{
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"
}
],
"extensions": [
{
"name": "kube-proxy",
"properties": {
"extensionType": "kube-proxy",
"version": "1.0",
"settings": {
"clusterCidr": "10.240.0.0/16",
"kubeVersion": "v1.9.10"
},
"protectedSettings": {
"kubeConfig": "<kubeconfig encoded string>"
}
}
},
{
"name": "vk-realtime-metrics",
"properties": {
"extensionType": "realtime-metrics",
"version": "1.0"
}
}
]
}
}
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.containerinstance.fluent.models.ContainerGroupInner;
import com.azure.resourcemanager.containerinstance.models.Container;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIpAddressType;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupNetworkProtocol;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupSubnetId;
import com.azure.resourcemanager.containerinstance.models.ContainerPort;
import com.azure.resourcemanager.containerinstance.models.DeploymentExtensionSpec;
import com.azure.resourcemanager.containerinstance.models.IpAddress;
import com.azure.resourcemanager.containerinstance.models.OperatingSystemTypes;
import com.azure.resourcemanager.containerinstance.models.Port;
import com.azure.resourcemanager.containerinstance.models.ResourceRequests;
import com.azure.resourcemanager.containerinstance.models.ResourceRequirements;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/
* ContainerGroupExtensions.json
*/
/**
* Sample code: ContainerGroupCreateWithExtensions.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void containerGroupCreateWithExtensions(com.azure.resourcemanager.AzureResourceManager azure)
throws IOException {
azure.containerGroups().manager().serviceClient().getContainerGroups().createOrUpdate("demo", "demo1",
new ContainerGroupInner().withLocation("eastus2")
.withContainers(Arrays.asList(new Container().withName("demo1").withImage("nginx")
.withCommand(Arrays.asList()).withPorts(Arrays.asList(new ContainerPort().withPort(80)))
.withEnvironmentVariables(Arrays.asList())
.withResources(new ResourceRequirements()
.withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0)))))
.withImageRegistryCredentials(Arrays.asList())
.withIpAddress(new IpAddress()
.withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80)))
.withType(ContainerGroupIpAddressType.PRIVATE))
.withOsType(OperatingSystemTypes.LINUX)
.withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId(
"/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet")))
.withExtensions(Arrays.asList(
new DeploymentExtensionSpec().withName("kube-proxy").withExtensionType("kube-proxy")
.withVersion("1.0")
.withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize(
"{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", Object.class,
SerializerEncoding.JSON))
.withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize(
"{\"kubeConfig\":\"<kubeconfig encoded string>\"}", Object.class, SerializerEncoding.JSON)),
new DeploymentExtensionSpec().withName("vk-realtime-metrics").withExtensionType("realtime-metrics")
.withVersion("1.0"))),
com.azure.core.util.Context.NONE);
}
// 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.containerinstance import ContainerInstanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerinstance
# USAGE
python container_group_extensions.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 = ContainerInstanceManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.container_groups.begin_create_or_update(
resource_group_name="demo",
container_group_name="demo1",
container_group={
"location": "eastus2",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [{"port": 80}],
"resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
},
}
],
"extensions": [
{
"name": "kube-proxy",
"properties": {
"extensionType": "kube-proxy",
"protectedSettings": {"kubeConfig": "<kubeconfig encoded string>"},
"settings": {"clusterCidr": "10.240.0.0/16", "kubeVersion": "v1.9.10"},
"version": "1.0",
},
},
{
"name": "vk-realtime-metrics",
"properties": {"extensionType": "realtime-metrics", "version": "1.0"},
},
],
"imageRegistryCredentials": [],
"ipAddress": {"ports": [{"port": 80, "protocol": "TCP"}], "type": "Private"},
"osType": "Linux",
"subnetIds": [
{
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"
}
],
},
},
).result()
print(response)
# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupExtensions.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 armcontainerinstance_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/containerinstance/armcontainerinstance/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupExtensions.json
func ExampleContainerGroupsClient_BeginCreateOrUpdate_containerGroupCreateWithExtensions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{
Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
Containers: []*armcontainerinstance.Container{
{
Name: to.Ptr("demo1"),
Properties: &armcontainerinstance.ContainerProperties{
Command: []*string{},
EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{},
Image: to.Ptr("nginx"),
Ports: []*armcontainerinstance.ContainerPort{
{
Port: to.Ptr[int32](80),
}},
Resources: &armcontainerinstance.ResourceRequirements{
Requests: &armcontainerinstance.ResourceRequests{
CPU: to.Ptr[float64](1),
MemoryInGB: to.Ptr[float64](1.5),
},
},
},
}},
ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{},
IPAddress: &armcontainerinstance.IPAddress{
Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePrivate),
Ports: []*armcontainerinstance.Port{
{
Port: to.Ptr[int32](80),
Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
}},
},
OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{
{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"),
}},
Extensions: []*armcontainerinstance.DeploymentExtensionSpec{
{
Name: to.Ptr("kube-proxy"),
Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{
ExtensionType: to.Ptr("kube-proxy"),
ProtectedSettings: map[string]any{
"kubeConfig": "<kubeconfig encoded string>",
},
Settings: map[string]any{
"clusterCidr": "10.240.0.0/16",
"kubeVersion": "v1.9.10",
},
Version: to.Ptr("1.0"),
},
},
{
Name: to.Ptr("vk-realtime-metrics"),
Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{
ExtensionType: to.Ptr("realtime-metrics"),
Version: to.Ptr("1.0"),
},
}},
},
Location: to.Ptr("eastus2"),
}, 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.ContainerGroup = armcontainerinstance.ContainerGroup{
// Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
// Containers: []*armcontainerinstance.Container{
// {
// Name: to.Ptr("demo1"),
// Properties: &armcontainerinstance.ContainerProperties{
// Command: []*string{
// },
// EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
// },
// Image: to.Ptr("nginx"),
// Ports: []*armcontainerinstance.ContainerPort{
// {
// Port: to.Ptr[int32](80),
// }},
// Resources: &armcontainerinstance.ResourceRequirements{
// Requests: &armcontainerinstance.ResourceRequests{
// CPU: to.Ptr[float64](1),
// MemoryInGB: to.Ptr[float64](1.5),
// },
// },
// },
// }},
// ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
// },
// InitContainers: []*armcontainerinstance.InitContainerDefinition{
// },
// InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{
// Events: []*armcontainerinstance.Event{
// },
// State: to.Ptr("Pending"),
// },
// OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
// SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"),
// }},
// Extensions: []*armcontainerinstance.DeploymentExtensionSpec{
// {
// Name: to.Ptr("kube-proxy"),
// Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{
// ExtensionType: to.Ptr("kube-proxy"),
// Settings: map[string]any{
// "clusterCidr": "10.240.0.0/16",
// "kubeVersion": "v1.9.10",
// },
// Version: to.Ptr("1.0"),
// },
// },
// {
// Name: to.Ptr("vk-realtime-metrics"),
// Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{
// ExtensionType: to.Ptr("realtime-metrics"),
// Version: to.Ptr("1.0"),
// },
// }},
// },
// Name: to.Ptr("demo1"),
// Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"),
// Location: to.Ptr("eastus2"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update container groups with specified configurations.
*
* @summary Create or update container groups with specified configurations.
* x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupExtensions.json
*/
async function containerGroupCreateWithExtensions() {
const subscriptionId = process.env["CONTAINERINSTANCE_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["CONTAINERINSTANCE_RESOURCE_GROUP"] || "demo";
const containerGroupName = "demo1";
const containerGroup = {
containers: [
{
name: "demo1",
command: [],
environmentVariables: [],
image: "nginx",
ports: [{ port: 80 }],
resources: { requests: { cpu: 1, memoryInGB: 1.5 } },
},
],
imageRegistryCredentials: [],
ipAddress: { type: "Private", ports: [{ port: 80, protocol: "TCP" }] },
location: "eastus2",
osType: "Linux",
subnetIds: [
{
id: "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet",
},
],
extensions: [
{
name: "kube-proxy",
extensionType: "kube-proxy",
protectedSettings: { kubeConfig: "<kubeconfig encoded string>" },
settings: { clusterCidr: "10.240.0.0/16", kubeVersion: "v1.9.10" },
version: "1.0",
},
{
name: "vk-realtime-metrics",
extensionType: "realtime-metrics",
version: "1.0",
},
],
};
const credential = new DefaultAzureCredential();
const client = new ContainerInstanceManagementClient(credential, subscriptionId);
const result = await client.containerGroups.beginCreateOrUpdateAndWait(
resourceGroupName,
containerGroupName,
containerGroup
);
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.ContainerInstance.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ContainerInstance;
// Generated from example definition: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupExtensions.json
// this example is just showing the usage of "ContainerGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "demo";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ContainerGroupResource
ContainerGroupCollection collection = resourceGroupResource.GetContainerGroups();
// invoke the operation
string containerGroupName = "demo1";
ContainerGroupData data = new ContainerGroupData(new AzureLocation("eastus2"), new ContainerInstanceContainer[]
{
new ContainerInstanceContainer("demo1","nginx",new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))
{
Command =
{
},
Ports =
{
new ContainerPort(80)
},
EnvironmentVariables =
{
},
}
}, ContainerInstanceOperatingSystemType.Linux)
{
ImageRegistryCredentials =
{
},
IPAddress = new ContainerGroupIPAddress(new ContainerGroupPort[]
{
new ContainerGroupPort(80)
{
Protocol = ContainerGroupNetworkProtocol.Tcp,
}
}, ContainerGroupIPAddressType.Private),
SubnetIds =
{
new ContainerGroupSubnetId(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"))
},
Extensions =
{
new DeploymentExtensionSpec("kube-proxy")
{
ExtensionType = "kube-proxy",
Version = "1.0",
Settings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
["clusterCidr"] = "10.240.0.0/16",
["kubeVersion"] = "v1.9.10"}),
ProtectedSettings = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
["kubeConfig"] = "<kubeconfig encoded string>"}),
},new DeploymentExtensionSpec("vk-realtime-metrics")
{
ExtensionType = "realtime-metrics",
Version = "1.0",
}
},
};
ArmOperation<ContainerGroupResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerGroupName, data);
ContainerGroupResource 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
ContainerGroupData 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
Respuesta de muestra
{
"properties": {
"sku": "Standard",
"provisioningState": "Pending",
"containers": [
{
"name": "demo1",
"properties": {
"image": "nginx",
"command": [],
"ports": [
{
"port": 80
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"extensions": [
{
"name": "kube-proxy",
"properties": {
"extensionType": "kube-proxy",
"version": "1.0",
"settings": {
"clusterCidr": "10.240.0.0/16",
"kubeVersion": "v1.9.10"
}
}
},
{
"name": "vk-realtime-metrics",
"properties": {
"extensionType": "realtime-metrics",
"version": "1.0"
}
}
],
"imageRegistryCredentials": [],
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Pending"
},
"subnetIds": [
{
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"
}
]
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus2"
}
{
"properties": {
"sku": "Standard",
"provisioningState": "Pending",
"containers": [
{
"name": "demo1",
"properties": {
"image": "nginx",
"command": [],
"ports": [
{
"port": 80
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"extensions": [
{
"name": "kube-proxy",
"properties": {
"extensionType": "kube-proxy",
"version": "1.0",
"settings": {
"clusterCidr": "10.240.0.0/16",
"kubeVersion": "v1.9.10"
}
}
},
{
"name": "vk-realtime-metrics",
"properties": {
"extensionType": "realtime-metrics",
"version": "1.0"
}
}
],
"imageRegistryCredentials": [],
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Running"
},
"subnetIds": [
{
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"
}
]
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus2"
}
ContainerGroupsCreateOrUpdate
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1?api-version=2023-05-01
{
"location": "west us",
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {}
}
},
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5,
"gpu": {
"count": 1,
"sku": "K80"
}
}
},
"volumeMounts": [
{
"name": "volume1",
"mountPath": "/mnt/volume1",
"readOnly": false
},
{
"name": "volume2",
"mountPath": "/mnt/volume2",
"readOnly": false
},
{
"name": "volume3",
"mountPath": "/mnt/volume3",
"readOnly": true
}
]
}
}
],
"diagnostics": {
"logAnalytics": {
"workspaceId": "workspaceid",
"workspaceKey": "workspaceKey",
"logType": "ContainerInsights",
"metadata": {
"test-key": "test-metadata-value"
},
"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"
}
},
"subnetIds": [
{
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
}
],
"dnsConfig": {
"nameServers": [
"1.1.1.1"
],
"searchDomains": "cluster.local svc.cluster.local",
"options": "ndots:2"
},
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public",
"dnsNameLabel": "dnsnamelabel1",
"autoGeneratedDomainNameLabelScope": "Unsecure"
},
"osType": "Linux",
"volumes": [
{
"name": "volume1",
"azureFile": {
"shareName": "shareName",
"storageAccountName": "accountName",
"storageAccountKey": "accountKey"
}
},
{
"name": "volume2",
"emptyDir": {}
},
{
"name": "volume3",
"secret": {
"secretKey1": "SecretValue1InBase64",
"secretKey2": "SecretValue2InBase64"
}
}
]
}
}
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.containerinstance.fluent.models.ContainerGroupInner;
import com.azure.resourcemanager.containerinstance.models.AzureFileVolume;
import com.azure.resourcemanager.containerinstance.models.Container;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupDiagnostics;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIdentity;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIdentityUserAssignedIdentities;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIpAddressType;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupNetworkProtocol;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupSubnetId;
import com.azure.resourcemanager.containerinstance.models.ContainerPort;
import com.azure.resourcemanager.containerinstance.models.DnsConfiguration;
import com.azure.resourcemanager.containerinstance.models.DnsNameLabelReusePolicy;
import com.azure.resourcemanager.containerinstance.models.GpuResource;
import com.azure.resourcemanager.containerinstance.models.GpuSku;
import com.azure.resourcemanager.containerinstance.models.IpAddress;
import com.azure.resourcemanager.containerinstance.models.LogAnalytics;
import com.azure.resourcemanager.containerinstance.models.LogAnalyticsLogType;
import com.azure.resourcemanager.containerinstance.models.OperatingSystemTypes;
import com.azure.resourcemanager.containerinstance.models.Port;
import com.azure.resourcemanager.containerinstance.models.ResourceIdentityType;
import com.azure.resourcemanager.containerinstance.models.ResourceRequests;
import com.azure.resourcemanager.containerinstance.models.ResourceRequirements;
import com.azure.resourcemanager.containerinstance.models.Volume;
import com.azure.resourcemanager.containerinstance.models.VolumeMount;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/
* ContainerGroupsCreateOrUpdate.json
*/
/**
* Sample code: ContainerGroupsCreateOrUpdate.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void containerGroupsCreateOrUpdate(com.azure.resourcemanager.AzureResourceManager azure)
throws IOException {
azure.containerGroups().manager().serviceClient().getContainerGroups().createOrUpdate("demo", "demo1",
new ContainerGroupInner().withLocation("west us").withIdentity(new ContainerGroupIdentity()
.withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name",
new ContainerGroupIdentityUserAssignedIdentities())))
.withContainers(Arrays.asList(new Container().withName("demo1").withImage("nginx")
.withCommand(Arrays.asList()).withPorts(Arrays.asList(new ContainerPort().withPort(80)))
.withEnvironmentVariables(Arrays.asList())
.withResources(new ResourceRequirements().withRequests(new ResourceRequests().withMemoryInGB(1.5)
.withCpu(1.0).withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80))))
.withVolumeMounts(Arrays.asList(
new VolumeMount().withName("volume1").withMountPath("/mnt/volume1").withReadOnly(false),
new VolumeMount().withName("volume2").withMountPath("/mnt/volume2").withReadOnly(false),
new VolumeMount().withName("volume3").withMountPath("/mnt/volume3").withReadOnly(true)))))
.withImageRegistryCredentials(Arrays.asList())
.withIpAddress(new IpAddress()
.withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80)))
.withType(ContainerGroupIpAddressType.PUBLIC).withDnsNameLabel("dnsnamelabel1")
.withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE))
.withOsType(OperatingSystemTypes.LINUX)
.withVolumes(Arrays.asList(
new Volume().withName("volume1")
.withAzureFile(new AzureFileVolume().withShareName("shareName")
.withStorageAccountName("accountName").withStorageAccountKey("fakeTokenPlaceholder")),
new Volume().withName("volume2")
.withEmptyDir(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}",
Object.class, SerializerEncoding.JSON)),
new Volume().withName("volume3")
.withSecret(mapOf("secretKey1", "fakeTokenPlaceholder", "secretKey2", "fakeTokenPlaceholder"))))
.withDiagnostics(new ContainerGroupDiagnostics().withLogAnalytics(new LogAnalytics()
.withWorkspaceId("workspaceid").withWorkspaceKey("fakeTokenPlaceholder")
.withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS)
.withMetadata(mapOf("test-key", "fakeTokenPlaceholder")).withWorkspaceResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace")))
.withSubnetIds(Arrays.asList(new ContainerGroupSubnetId().withId(
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]")))
.withDnsConfig(new DnsConfiguration().withNameServers(Arrays.asList("1.1.1.1"))
.withSearchDomains("cluster.local svc.cluster.local").withOptions("ndots:2")),
com.azure.core.util.Context.NONE);
}
// 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.containerinstance import ContainerInstanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerinstance
# USAGE
python container_groups_create_or_update.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 = ContainerInstanceManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.container_groups.begin_create_or_update(
resource_group_name="demo",
container_group_name="demo1",
container_group={
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {}
},
},
"location": "west us",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [{"port": 80}],
"resources": {"requests": {"cpu": 1, "gpu": {"count": 1, "sku": "K80"}, "memoryInGB": 1.5}},
"volumeMounts": [
{"mountPath": "/mnt/volume1", "name": "volume1", "readOnly": False},
{"mountPath": "/mnt/volume2", "name": "volume2", "readOnly": False},
{"mountPath": "/mnt/volume3", "name": "volume3", "readOnly": True},
],
},
}
],
"diagnostics": {
"logAnalytics": {
"logType": "ContainerInsights",
"metadata": {"test-key": "test-metadata-value"},
"workspaceId": "workspaceid",
"workspaceKey": "workspaceKey",
"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace",
}
},
"dnsConfig": {
"nameServers": ["1.1.1.1"],
"options": "ndots:2",
"searchDomains": "cluster.local svc.cluster.local",
},
"imageRegistryCredentials": [],
"ipAddress": {
"autoGeneratedDomainNameLabelScope": "Unsecure",
"dnsNameLabel": "dnsnamelabel1",
"ports": [{"port": 80, "protocol": "TCP"}],
"type": "Public",
},
"osType": "Linux",
"subnetIds": [
{
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
}
],
"volumes": [
{
"azureFile": {
"shareName": "shareName",
"storageAccountKey": "accountKey",
"storageAccountName": "accountName",
},
"name": "volume1",
},
{"emptyDir": {}, "name": "volume2"},
{
"name": "volume3",
"secret": {"secretKey1": "SecretValue1InBase64", "secretKey2": "SecretValue2InBase64"},
},
],
},
},
).result()
print(response)
# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreateOrUpdate.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 armcontainerinstance_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/containerinstance/armcontainerinstance/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreateOrUpdate.json
func ExampleContainerGroupsClient_BeginCreateOrUpdate_containerGroupsCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{
Identity: &armcontainerinstance.ContainerGroupIdentity{
Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {},
},
},
Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
Containers: []*armcontainerinstance.Container{
{
Name: to.Ptr("demo1"),
Properties: &armcontainerinstance.ContainerProperties{
Command: []*string{},
EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{},
Image: to.Ptr("nginx"),
Ports: []*armcontainerinstance.ContainerPort{
{
Port: to.Ptr[int32](80),
}},
Resources: &armcontainerinstance.ResourceRequirements{
Requests: &armcontainerinstance.ResourceRequests{
CPU: to.Ptr[float64](1),
Gpu: &armcontainerinstance.GpuResource{
Count: to.Ptr[int32](1),
SKU: to.Ptr(armcontainerinstance.GpuSKUK80),
},
MemoryInGB: to.Ptr[float64](1.5),
},
},
VolumeMounts: []*armcontainerinstance.VolumeMount{
{
Name: to.Ptr("volume1"),
MountPath: to.Ptr("/mnt/volume1"),
ReadOnly: to.Ptr(false),
},
{
Name: to.Ptr("volume2"),
MountPath: to.Ptr("/mnt/volume2"),
ReadOnly: to.Ptr(false),
},
{
Name: to.Ptr("volume3"),
MountPath: to.Ptr("/mnt/volume3"),
ReadOnly: to.Ptr(true),
}},
},
}},
Diagnostics: &armcontainerinstance.ContainerGroupDiagnostics{
LogAnalytics: &armcontainerinstance.LogAnalytics{
LogType: to.Ptr(armcontainerinstance.LogAnalyticsLogTypeContainerInsights),
Metadata: map[string]*string{
"test-key": to.Ptr("test-metadata-value"),
},
WorkspaceID: to.Ptr("workspaceid"),
WorkspaceKey: to.Ptr("workspaceKey"),
WorkspaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"),
},
},
DNSConfig: &armcontainerinstance.DNSConfiguration{
NameServers: []*string{
to.Ptr("1.1.1.1")},
Options: to.Ptr("ndots:2"),
SearchDomains: to.Ptr("cluster.local svc.cluster.local"),
},
ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{},
IPAddress: &armcontainerinstance.IPAddress{
Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerinstance.DNSNameLabelReusePolicyUnsecure),
DNSNameLabel: to.Ptr("dnsnamelabel1"),
Ports: []*armcontainerinstance.Port{
{
Port: to.Ptr[int32](80),
Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
}},
},
OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{
{
ID: to.Ptr("[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"),
}},
Volumes: []*armcontainerinstance.Volume{
{
Name: to.Ptr("volume1"),
AzureFile: &armcontainerinstance.AzureFileVolume{
ShareName: to.Ptr("shareName"),
StorageAccountKey: to.Ptr("accountKey"),
StorageAccountName: to.Ptr("accountName"),
},
},
{
Name: to.Ptr("volume2"),
EmptyDir: map[string]any{},
},
{
Name: to.Ptr("volume3"),
Secret: map[string]*string{
"secretKey1": to.Ptr("SecretValue1InBase64"),
"secretKey2": to.Ptr("SecretValue2InBase64"),
},
}},
},
Location: to.Ptr("west us"),
}, 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.ContainerGroup = armcontainerinstance.ContainerGroup{
// Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
// Containers: []*armcontainerinstance.Container{
// {
// Name: to.Ptr("demo1"),
// Properties: &armcontainerinstance.ContainerProperties{
// Command: []*string{
// },
// EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
// },
// Image: to.Ptr("nginx"),
// Ports: []*armcontainerinstance.ContainerPort{
// {
// Port: to.Ptr[int32](80),
// }},
// Resources: &armcontainerinstance.ResourceRequirements{
// Requests: &armcontainerinstance.ResourceRequests{
// CPU: to.Ptr[float64](1),
// Gpu: &armcontainerinstance.GpuResource{
// Count: to.Ptr[int32](1),
// SKU: to.Ptr(armcontainerinstance.GpuSKUK80),
// },
// MemoryInGB: to.Ptr[float64](1.5),
// },
// },
// VolumeMounts: []*armcontainerinstance.VolumeMount{
// {
// Name: to.Ptr("volume1"),
// MountPath: to.Ptr("/mnt/volume1"),
// ReadOnly: to.Ptr(false),
// },
// {
// Name: to.Ptr("volume2"),
// MountPath: to.Ptr("/mnt/volume2"),
// ReadOnly: to.Ptr(false),
// },
// {
// Name: to.Ptr("volume3"),
// MountPath: to.Ptr("/mnt/volume3"),
// ReadOnly: to.Ptr(true),
// }},
// },
// }},
// Diagnostics: &armcontainerinstance.ContainerGroupDiagnostics{
// LogAnalytics: &armcontainerinstance.LogAnalytics{
// WorkspaceID: to.Ptr("workspaceid"),
// },
// },
// DNSConfig: &armcontainerinstance.DNSConfiguration{
// NameServers: []*string{
// to.Ptr("1.1.1.1")},
// Options: to.Ptr("ndots:2"),
// SearchDomains: to.Ptr("cluster.local svc.cluster.local"),
// },
// ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
// },
// IPAddress: &armcontainerinstance.IPAddress{
// Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerinstance.DNSNameLabelReusePolicyUnsecure),
// DNSNameLabel: to.Ptr("dnsnamelabel1"),
// Fqdn: to.Ptr("dnsnamelabel1.azure-container.io"),
// IP: to.Ptr("10.0.0.1"),
// Ports: []*armcontainerinstance.Port{
// {
// Port: to.Ptr[int32](80),
// Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
// }},
// },
// OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// Volumes: []*armcontainerinstance.Volume{
// {
// Name: to.Ptr("volume1"),
// AzureFile: &armcontainerinstance.AzureFileVolume{
// ShareName: to.Ptr("shareName"),
// StorageAccountName: to.Ptr("accountName"),
// },
// },
// {
// Name: to.Ptr("volume2"),
// EmptyDir: map[string]any{
// },
// },
// {
// Name: to.Ptr("volume3"),
// Secret: map[string]*string{
// },
// }},
// },
// Name: to.Ptr("demo1"),
// Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"),
// Location: to.Ptr("WestUs"),
// 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 { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update container groups with specified configurations.
*
* @summary Create or update container groups with specified configurations.
* x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreateOrUpdate.json
*/
async function containerGroupsCreateOrUpdate() {
const subscriptionId = process.env["CONTAINERINSTANCE_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["CONTAINERINSTANCE_RESOURCE_GROUP"] || "demo";
const containerGroupName = "demo1";
const containerGroup = {
containers: [
{
name: "demo1",
command: [],
environmentVariables: [],
image: "nginx",
ports: [{ port: 80 }],
resources: {
requests: { cpu: 1, gpu: { count: 1, sku: "K80" }, memoryInGB: 1.5 },
},
volumeMounts: [
{ name: "volume1", mountPath: "/mnt/volume1", readOnly: false },
{ name: "volume2", mountPath: "/mnt/volume2", readOnly: false },
{ name: "volume3", mountPath: "/mnt/volume3", readOnly: true },
],
},
],
diagnostics: {
logAnalytics: {
logType: "ContainerInsights",
metadata: { testKey: "test-metadata-value" },
workspaceId: "workspaceid",
workspaceKey: "workspaceKey",
workspaceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace",
},
},
dnsConfig: {
nameServers: ["1.1.1.1"],
options: "ndots:2",
searchDomains: "cluster.local svc.cluster.local",
},
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identityName":
{},
},
},
imageRegistryCredentials: [],
ipAddress: {
type: "Public",
autoGeneratedDomainNameLabelScope: "Unsecure",
dnsNameLabel: "dnsnamelabel1",
ports: [{ port: 80, protocol: "TCP" }],
},
location: "west us",
osType: "Linux",
subnetIds: [
{
id: "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]",
},
],
volumes: [
{
name: "volume1",
azureFile: {
shareName: "shareName",
storageAccountKey: "accountKey",
storageAccountName: "accountName",
},
},
{ name: "volume2", emptyDir: {} },
{
name: "volume3",
secret: {
secretKey1: "SecretValue1InBase64",
secretKey2: "SecretValue2InBase64",
},
},
],
};
const credential = new DefaultAzureCredential();
const client = new ContainerInstanceManagementClient(credential, subscriptionId);
const result = await client.containerGroups.beginCreateOrUpdateAndWait(
resourceGroupName,
containerGroupName,
containerGroup
);
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.ContainerInstance.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ContainerInstance;
// Generated from example definition: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreateOrUpdate.json
// this example is just showing the usage of "ContainerGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "demo";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ContainerGroupResource
ContainerGroupCollection collection = resourceGroupResource.GetContainerGroups();
// invoke the operation
string containerGroupName = "demo1";
ContainerGroupData data = new ContainerGroupData(new AzureLocation("west us"), new ContainerInstanceContainer[]
{
new ContainerInstanceContainer("demo1","nginx",new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)
{
Gpu = new ContainerGpuResourceInfo(1,ContainerGpuSku.K80),
}))
{
Command =
{
},
Ports =
{
new ContainerPort(80)
},
EnvironmentVariables =
{
},
VolumeMounts =
{
new ContainerVolumeMount("volume1","/mnt/volume1")
{
IsReadOnly = false,
},new ContainerVolumeMount("volume2","/mnt/volume2")
{
IsReadOnly = false,
},new ContainerVolumeMount("volume3","/mnt/volume3")
{
IsReadOnly = true,
}
},
}
}, ContainerInstanceOperatingSystemType.Linux)
{
Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name")] = new UserAssignedIdentity(),
},
},
ImageRegistryCredentials =
{
},
IPAddress = new ContainerGroupIPAddress(new ContainerGroupPort[]
{
new ContainerGroupPort(80)
{
Protocol = ContainerGroupNetworkProtocol.Tcp,
}
}, ContainerGroupIPAddressType.Public)
{
DnsNameLabel = "dnsnamelabel1",
AutoGeneratedDomainNameLabelScope = DnsNameLabelReusePolicy.Unsecure,
},
Volumes =
{
new ContainerVolume("volume1")
{
AzureFile = new ContainerInstanceAzureFileVolume("shareName","accountName")
{
StorageAccountKey = "accountKey",
},
},new ContainerVolume("volume2")
{
EmptyDir = BinaryData.FromObjectAsJson(new Dictionary<string, object>()
{
}),
},new ContainerVolume("volume3")
{
Secret =
{
["secretKey1"] = "SecretValue1InBase64",
["secretKey2"] = "SecretValue2InBase64",
},
}
},
DiagnosticsLogAnalytics = new ContainerGroupLogAnalytics("workspaceid", "workspaceKey")
{
LogType = ContainerGroupLogAnalyticsLogType.ContainerInsights,
Metadata =
{
["test-key"] = "test-metadata-value",
},
WorkspaceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"),
},
SubnetIds =
{
new ContainerGroupSubnetId(new ResourceIdentifier("[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"))
},
DnsConfig = new ContainerGroupDnsConfiguration(new string[]
{
"1.1.1.1"
})
{
SearchDomains = "cluster.local svc.cluster.local",
Options = "ndots:2",
},
};
ArmOperation<ContainerGroupResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerGroupName, data);
ContainerGroupResource 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
ContainerGroupData 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
Respuesta de muestra
{
"id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"location": "WestUs",
"zones": [
"1"
],
"name": "demo1",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5,
"gpu": {
"count": 1,
"sku": "K80"
}
}
},
"volumeMounts": [
{
"name": "volume1",
"mountPath": "/mnt/volume1",
"readOnly": false
},
{
"name": "volume2",
"mountPath": "/mnt/volume2",
"readOnly": false
},
{
"name": "volume3",
"mountPath": "/mnt/volume3",
"readOnly": true
}
]
}
}
],
"diagnostics": {
"logAnalytics": {
"workspaceId": "workspaceid"
}
},
"dnsConfig": {
"nameServers": [
"1.1.1.1"
],
"searchDomains": "cluster.local svc.cluster.local",
"options": "ndots:2"
},
"imageRegistryCredentials": [],
"ipAddress": {
"ip": "10.0.0.1",
"ports": [
{
"port": 80,
"protocol": "TCP"
}
],
"type": "Public",
"dnsNameLabel": "dnsnamelabel1",
"autoGeneratedDomainNameLabelScope": "Unsecure",
"fqdn": "dnsnamelabel1.azure-container.io"
},
"osType": "Linux",
"provisioningState": "Succeeded",
"volumes": [
{
"name": "volume1",
"azureFile": {
"shareName": "shareName",
"storageAccountName": "accountName"
}
},
{
"name": "volume2",
"emptyDir": {}
},
{
"name": "volume3",
"secret": {}
}
]
},
"type": "Microsoft.ContainerInstance/containerGroups"
}
{
"id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"location": "WestUs",
"zones": [
"1"
],
"name": "demo1",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5,
"gpu": {
"count": 1,
"sku": "K80"
}
}
},
"volumeMounts": [
{
"name": "volume1",
"mountPath": "/mnt/volume1",
"readOnly": false
},
{
"name": "volume2",
"mountPath": "/mnt/volume2",
"readOnly": false
},
{
"name": "volume3",
"mountPath": "/mnt/volume3",
"readOnly": true
}
]
}
}
],
"dnsConfig": {
"nameServers": [
"1.1.1.1"
]
},
"imageRegistryCredentials": [],
"ipAddress": {
"ip": "10.0.0.1",
"ports": [
{
"port": 80,
"protocol": "TCP"
}
],
"type": "Public",
"dnsNameLabel": "dnsnamelabel1",
"autoGeneratedDomainNameLabelScope": "Unsecure",
"fqdn": "dnsnamelabel1.azure-container.io"
},
"osType": "Linux",
"provisioningState": "Succeeded",
"volumes": [
{
"name": "volume1",
"azureFile": {
"shareName": "shareName",
"storageAccountName": "accountName"
}
},
{
"name": "volume2",
"emptyDir": {}
},
{
"name": "volume3",
"secret": {}
}
]
},
"type": "Microsoft.ContainerInstance/containerGroups"
}
ContainerGroupsCreateWithPriority
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1?api-version=2023-05-01
{
"properties": {
"sku": "Standard",
"containers": [
{
"name": "test-container-001",
"properties": {
"image": "alpine:latest",
"command": [
"/bin/sh",
"-c",
"sleep 10"
],
"resources": {
"requests": {
"memoryInGB": 1,
"cpu": 1
}
}
}
}
],
"restartPolicy": "Never",
"osType": "Linux",
"priority": "Spot"
},
"location": "eastus"
}
import com.azure.resourcemanager.containerinstance.fluent.models.ContainerGroupInner;
import com.azure.resourcemanager.containerinstance.models.Container;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupPriority;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupRestartPolicy;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupSku;
import com.azure.resourcemanager.containerinstance.models.OperatingSystemTypes;
import com.azure.resourcemanager.containerinstance.models.ResourceRequests;
import com.azure.resourcemanager.containerinstance.models.ResourceRequirements;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/
* ContainerGroupsCreatePriority.json
*/
/**
* Sample code: ContainerGroupsCreateWithPriority.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void containerGroupsCreateWithPriority(com.azure.resourcemanager.AzureResourceManager azure) {
azure.containerGroups().manager().serviceClient().getContainerGroups().createOrUpdate("demo", "demo1",
new ContainerGroupInner().withLocation("eastus")
.withContainers(Arrays.asList(new Container().withName("test-container-001").withImage("alpine:latest")
.withCommand(Arrays.asList("/bin/sh", "-c", "sleep 10"))
.withResources(new ResourceRequirements()
.withRequests(new ResourceRequests().withMemoryInGB(1.0).withCpu(1.0)))))
.withRestartPolicy(ContainerGroupRestartPolicy.NEVER).withOsType(OperatingSystemTypes.LINUX)
.withSku(ContainerGroupSku.STANDARD).withPriority(ContainerGroupPriority.SPOT),
com.azure.core.util.Context.NONE);
}
// 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.containerinstance import ContainerInstanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerinstance
# USAGE
python container_groups_create_priority.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 = ContainerInstanceManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.container_groups.begin_create_or_update(
resource_group_name="demo",
container_group_name="demo1",
container_group={
"location": "eastus",
"properties": {
"containers": [
{
"name": "test-container-001",
"properties": {
"command": ["/bin/sh", "-c", "sleep 10"],
"image": "alpine:latest",
"resources": {"requests": {"cpu": 1, "memoryInGB": 1}},
},
}
],
"osType": "Linux",
"priority": "Spot",
"restartPolicy": "Never",
"sku": "Standard",
},
},
).result()
print(response)
# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreatePriority.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 armcontainerinstance_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/containerinstance/armcontainerinstance/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreatePriority.json
func ExampleContainerGroupsClient_BeginCreateOrUpdate_containerGroupsCreateWithPriority() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{
Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
Containers: []*armcontainerinstance.Container{
{
Name: to.Ptr("test-container-001"),
Properties: &armcontainerinstance.ContainerProperties{
Command: []*string{
to.Ptr("/bin/sh"),
to.Ptr("-c"),
to.Ptr("sleep 10")},
Image: to.Ptr("alpine:latest"),
Resources: &armcontainerinstance.ResourceRequirements{
Requests: &armcontainerinstance.ResourceRequests{
CPU: to.Ptr[float64](1),
MemoryInGB: to.Ptr[float64](1),
},
},
},
}},
OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
Priority: to.Ptr(armcontainerinstance.ContainerGroupPrioritySpot),
RestartPolicy: to.Ptr(armcontainerinstance.ContainerGroupRestartPolicyNever),
SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
},
Location: to.Ptr("eastus"),
}, 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.ContainerGroup = armcontainerinstance.ContainerGroup{
// Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
// Containers: []*armcontainerinstance.Container{
// {
// Name: to.Ptr("test-container-001"),
// Properties: &armcontainerinstance.ContainerProperties{
// Command: []*string{
// to.Ptr("/bin/sh"),
// to.Ptr("-c"),
// to.Ptr("sleep 10")},
// EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
// },
// Image: to.Ptr("alpine:latest"),
// Ports: []*armcontainerinstance.ContainerPort{
// },
// Resources: &armcontainerinstance.ResourceRequirements{
// Requests: &armcontainerinstance.ResourceRequests{
// CPU: to.Ptr[float64](1),
// MemoryInGB: to.Ptr[float64](1),
// },
// },
// },
// }},
// InitContainers: []*armcontainerinstance.InitContainerDefinition{
// },
// InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{
// Events: []*armcontainerinstance.Event{
// },
// State: to.Ptr("Succeeded"),
// },
// OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
// Priority: to.Ptr(armcontainerinstance.ContainerGroupPrioritySpot),
// ProvisioningState: to.Ptr("Succeeded"),
// RestartPolicy: to.Ptr(armcontainerinstance.ContainerGroupRestartPolicyNever),
// SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
// },
// Name: to.Ptr("demo1"),
// Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"),
// ID: to.Ptr("/subscriptions/subId/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"),
// Location: to.Ptr("eastus"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update container groups with specified configurations.
*
* @summary Create or update container groups with specified configurations.
* x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreatePriority.json
*/
async function containerGroupsCreateWithPriority() {
const subscriptionId = process.env["CONTAINERINSTANCE_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["CONTAINERINSTANCE_RESOURCE_GROUP"] || "demo";
const containerGroupName = "demo1";
const containerGroup = {
containers: [
{
name: "test-container-001",
command: ["/bin/sh", "-c", "sleep 10"],
image: "alpine:latest",
resources: { requests: { cpu: 1, memoryInGB: 1 } },
},
],
location: "eastus",
osType: "Linux",
priority: "Spot",
restartPolicy: "Never",
sku: "Standard",
};
const credential = new DefaultAzureCredential();
const client = new ContainerInstanceManagementClient(credential, subscriptionId);
const result = await client.containerGroups.beginCreateOrUpdateAndWait(
resourceGroupName,
containerGroupName,
containerGroup
);
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.ContainerInstance.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ContainerInstance;
// Generated from example definition: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreatePriority.json
// this example is just showing the usage of "ContainerGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "demo";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ContainerGroupResource
ContainerGroupCollection collection = resourceGroupResource.GetContainerGroups();
// invoke the operation
string containerGroupName = "demo1";
ContainerGroupData data = new ContainerGroupData(new AzureLocation("eastus"), new ContainerInstanceContainer[]
{
new ContainerInstanceContainer("test-container-001","alpine:latest",new ContainerResourceRequirements(new ContainerResourceRequestsContent(1,1)))
{
Command =
{
"/bin/sh","-c","sleep 10"
},
}
}, ContainerInstanceOperatingSystemType.Linux)
{
RestartPolicy = ContainerGroupRestartPolicy.Never,
Sku = ContainerGroupSku.Standard,
Priority = ContainerGroupPriority.Spot,
};
ArmOperation<ContainerGroupResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerGroupName, data);
ContainerGroupResource 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
ContainerGroupData 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
Respuesta de muestra
{
"properties": {
"sku": "Standard",
"provisioningState": "Succeeded",
"containers": [
{
"name": "test-container-001",
"properties": {
"image": "alpine:latest",
"command": [
"/bin/sh",
"-c",
"sleep 10"
],
"ports": [],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"restartPolicy": "Never",
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Succeeded"
},
"priority": "Spot"
},
"id": "/subscriptions/subId/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus"
}
{
"properties": {
"sku": "Standard",
"provisioningState": "Created",
"containers": [
{
"name": "test-container-001",
"properties": {
"image": "alpine:latest",
"command": [
"/bin/sh",
"-c",
"sleep 10"
],
"ports": [],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"restartPolicy": "Never",
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Created"
},
"priority": "Spot"
},
"id": "/subscriptions/subId/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus"
}
ContainerGroupWithEncryptionProperties
Solicitud de ejemplo
PUT https://management.azure.com/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1?api-version=2023-05-01
{
"location": "eastus2",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {}
}
},
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1,
"memoryInGB": 1.5
}
}
}
}
],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public"
},
"osType": "Linux",
"encryptionProperties": {
"vaultBaseUrl": "https://testkeyvault.vault.azure.net",
"keyName": "test-key",
"keyVersion": "<key version>",
"identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"
}
}
}
import com.azure.resourcemanager.containerinstance.fluent.models.ContainerGroupInner;
import com.azure.resourcemanager.containerinstance.models.Container;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIdentity;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIdentityUserAssignedIdentities;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupIpAddressType;
import com.azure.resourcemanager.containerinstance.models.ContainerGroupNetworkProtocol;
import com.azure.resourcemanager.containerinstance.models.ContainerPort;
import com.azure.resourcemanager.containerinstance.models.EncryptionProperties;
import com.azure.resourcemanager.containerinstance.models.IpAddress;
import com.azure.resourcemanager.containerinstance.models.OperatingSystemTypes;
import com.azure.resourcemanager.containerinstance.models.Port;
import com.azure.resourcemanager.containerinstance.models.ResourceIdentityType;
import com.azure.resourcemanager.containerinstance.models.ResourceRequests;
import com.azure.resourcemanager.containerinstance.models.ResourceRequirements;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ContainerGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/
* ContainerGroupEncryptionProperties.json
*/
/**
* Sample code: ContainerGroupWithEncryptionProperties.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void containerGroupWithEncryptionProperties(com.azure.resourcemanager.AzureResourceManager azure) {
azure.containerGroups().manager().serviceClient().getContainerGroups().createOrUpdate("demo", "demo1",
new ContainerGroupInner().withLocation("eastus2").withIdentity(new ContainerGroupIdentity()
.withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity",
new ContainerGroupIdentityUserAssignedIdentities())))
.withContainers(Arrays.asList(new Container().withName("demo1").withImage("nginx")
.withCommand(Arrays.asList()).withPorts(Arrays.asList(new ContainerPort().withPort(80)))
.withEnvironmentVariables(Arrays.asList())
.withResources(new ResourceRequirements()
.withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0)))))
.withImageRegistryCredentials(Arrays.asList())
.withIpAddress(new IpAddress()
.withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80)))
.withType(ContainerGroupIpAddressType.PUBLIC))
.withOsType(OperatingSystemTypes.LINUX)
.withEncryptionProperties(new EncryptionProperties()
.withVaultBaseUrl("https://testkeyvault.vault.azure.net").withKeyName("fakeTokenPlaceholder")
.withKeyVersion("fakeTokenPlaceholder").withIdentity(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")),
com.azure.core.util.Context.NONE);
}
// 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.containerinstance import ContainerInstanceManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerinstance
# USAGE
python container_group_encryption_properties.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 = ContainerInstanceManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.container_groups.begin_create_or_update(
resource_group_name="demo",
container_group_name="demo1",
container_group={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {}
},
},
"location": "eastus2",
"properties": {
"containers": [
{
"name": "demo1",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [{"port": 80}],
"resources": {"requests": {"cpu": 1, "memoryInGB": 1.5}},
},
}
],
"encryptionProperties": {
"identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity",
"keyName": "test-key",
"keyVersion": "<key version>",
"vaultBaseUrl": "https://testkeyvault.vault.azure.net",
},
"imageRegistryCredentials": [],
"ipAddress": {"ports": [{"port": 80, "protocol": "TCP"}], "type": "Public"},
"osType": "Linux",
},
},
).result()
print(response)
# x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupEncryptionProperties.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 armcontainerinstance_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/containerinstance/armcontainerinstance/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupEncryptionProperties.json
func ExampleContainerGroupsClient_BeginCreateOrUpdate_containerGroupWithEncryptionProperties() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{
Identity: &armcontainerinstance.ContainerGroupIdentity{
Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {},
},
},
Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
Containers: []*armcontainerinstance.Container{
{
Name: to.Ptr("demo1"),
Properties: &armcontainerinstance.ContainerProperties{
Command: []*string{},
EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{},
Image: to.Ptr("nginx"),
Ports: []*armcontainerinstance.ContainerPort{
{
Port: to.Ptr[int32](80),
}},
Resources: &armcontainerinstance.ResourceRequirements{
Requests: &armcontainerinstance.ResourceRequests{
CPU: to.Ptr[float64](1),
MemoryInGB: to.Ptr[float64](1.5),
},
},
},
}},
EncryptionProperties: &armcontainerinstance.EncryptionProperties{
Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"),
KeyName: to.Ptr("test-key"),
KeyVersion: to.Ptr("<key version>"),
VaultBaseURL: to.Ptr("https://testkeyvault.vault.azure.net"),
},
ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{},
IPAddress: &armcontainerinstance.IPAddress{
Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
Ports: []*armcontainerinstance.Port{
{
Port: to.Ptr[int32](80),
Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
}},
},
OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
},
Location: to.Ptr("eastus2"),
}, 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.ContainerGroup = armcontainerinstance.ContainerGroup{
// Identity: &armcontainerinstance.ContainerGroupIdentity{
// Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeUserAssigned),
// TenantID: to.Ptr("<tenant id>"),
// UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": &armcontainerinstance.UserAssignedIdentities{
// ClientID: to.Ptr("<client id>"),
// PrincipalID: to.Ptr("<principal id>"),
// },
// },
// },
// Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{
// Containers: []*armcontainerinstance.Container{
// {
// Name: to.Ptr("demo1"),
// Properties: &armcontainerinstance.ContainerProperties{
// Command: []*string{
// },
// EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
// },
// Image: to.Ptr("nginx"),
// Ports: []*armcontainerinstance.ContainerPort{
// {
// Port: to.Ptr[int32](80),
// }},
// Resources: &armcontainerinstance.ResourceRequirements{
// Requests: &armcontainerinstance.ResourceRequests{
// CPU: to.Ptr[float64](1),
// MemoryInGB: to.Ptr[float64](1.5),
// },
// },
// },
// }},
// EncryptionProperties: &armcontainerinstance.EncryptionProperties{
// Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"),
// KeyName: to.Ptr("test-key"),
// KeyVersion: to.Ptr("<key version>"),
// VaultBaseURL: to.Ptr("https://testkeyvault.vault.azure.net/"),
// },
// ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
// },
// InitContainers: []*armcontainerinstance.InitContainerDefinition{
// },
// InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{
// Events: []*armcontainerinstance.Event{
// },
// State: to.Ptr("Pending"),
// },
// IPAddress: &armcontainerinstance.IPAddress{
// Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
// Ports: []*armcontainerinstance.Port{
// {
// Port: to.Ptr[int32](80),
// Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
// }},
// },
// OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
// },
// Name: to.Ptr("demo1"),
// Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"),
// Location: to.Ptr("eastus2"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update container groups with specified configurations.
*
* @summary Create or update container groups with specified configurations.
* x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupEncryptionProperties.json
*/
async function containerGroupWithEncryptionProperties() {
const subscriptionId = process.env["CONTAINERINSTANCE_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["CONTAINERINSTANCE_RESOURCE_GROUP"] || "demo";
const containerGroupName = "demo1";
const containerGroup = {
containers: [
{
name: "demo1",
command: [],
environmentVariables: [],
image: "nginx",
ports: [{ port: 80 }],
resources: { requests: { cpu: 1, memoryInGB: 1.5 } },
},
],
encryptionProperties: {
identity:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity",
keyName: "test-key",
keyVersion: "<key version>",
vaultBaseUrl: "https://testkeyvault.vault.azure.net",
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000000000000000000000000000/resourcegroups/testRg/providers/MicrosoftManagedIdentity/userAssignedIdentities/containerGroupIdentity":
{},
},
},
imageRegistryCredentials: [],
ipAddress: { type: "Public", ports: [{ port: 80, protocol: "TCP" }] },
location: "eastus2",
osType: "Linux",
};
const credential = new DefaultAzureCredential();
const client = new ContainerInstanceManagementClient(credential, subscriptionId);
const result = await client.containerGroups.beginCreateOrUpdateAndWait(
resourceGroupName,
containerGroupName,
containerGroup
);
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.ContainerInstance.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ContainerInstance;
// Generated from example definition: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupEncryptionProperties.json
// this example is just showing the usage of "ContainerGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "demo";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ContainerGroupResource
ContainerGroupCollection collection = resourceGroupResource.GetContainerGroups();
// invoke the operation
string containerGroupName = "demo1";
ContainerGroupData data = new ContainerGroupData(new AzureLocation("eastus2"), new ContainerInstanceContainer[]
{
new ContainerInstanceContainer("demo1","nginx",new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))
{
Command =
{
},
Ports =
{
new ContainerPort(80)
},
EnvironmentVariables =
{
},
}
}, ContainerInstanceOperatingSystemType.Linux)
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")] = new UserAssignedIdentity(),
},
},
ImageRegistryCredentials =
{
},
IPAddress = new ContainerGroupIPAddress(new ContainerGroupPort[]
{
new ContainerGroupPort(80)
{
Protocol = ContainerGroupNetworkProtocol.Tcp,
}
}, ContainerGroupIPAddressType.Public),
EncryptionProperties = new ContainerGroupEncryptionProperties(new Uri("https://testkeyvault.vault.azure.net"), "test-key", "<key version>")
{
Identity = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity",
},
};
ArmOperation<ContainerGroupResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerGroupName, data);
ContainerGroupResource 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
ContainerGroupData 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
Respuesta de muestra
{
"properties": {
"sku": "Standard",
"encryptionProperties": {
"vaultBaseUrl": "https://testkeyvault.vault.azure.net/",
"keyName": "test-key",
"keyVersion": "<key version>",
"identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"
},
"provisioningState": "Pending",
"containers": [
{
"name": "demo1",
"properties": {
"image": "nginx",
"command": [],
"ports": [
{
"port": 80
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public"
},
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Pending"
}
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {
"principalId": "<principal id>",
"clientId": "<client id>"
}
},
"tenantId": "<tenant id>",
"type": "UserAssigned"
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus2"
}
{
"properties": {
"sku": "Standard",
"encryptionProperties": {
"vaultBaseUrl": "https://testkeyvault.vault.azure.net/",
"keyName": "test-key",
"keyVersion": "key version",
"identity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"
},
"provisioningState": "Running",
"containers": [
{
"name": "demo1",
"properties": {
"image": "nginx",
"command": [],
"ports": [
{
"port": 80
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public"
},
"osType": "Linux",
"instanceView": {
"events": [],
"state": "Pending"
}
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {
"principalId": "<principal id>",
"clientId": "<client id>"
}
},
"tenantId": "<tenant id>",
"type": "UserAssigned"
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1",
"name": "demo1",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "eastus2"
}
Definiciones
Nombre |
Description |
AzureFileVolume
|
Las propiedades del volumen azure File. Los recursos compartidos de archivos de Azure se montan como volúmenes.
|
CloudError
|
Respuesta de error del servicio Container Instance.
|
CloudErrorBody
|
Respuesta de error del servicio Container Instance.
|
ConfidentialComputeProperties
|
Propiedades del grupo de contenedores confidenciales
|
Container
|
Una instancia de contenedor.
|
ContainerExec
|
El comando de ejecución del contenedor, para el sondeo de ejecución o preparación
|
ContainerGroup
|
Un grupo de contenedores.
|
ContainerGroupDiagnostics
|
Información de diagnóstico del grupo de contenedores.
|
ContainerGroupIdentity
|
Identidad del grupo de contenedores.
|
ContainerGroupIpAddressType
|
Especifica si la dirección IP se expone a la red virtual pública de Internet o privada.
|
ContainerGroupNetworkProtocol
|
Protocolo asociado al puerto.
|
ContainerGroupPriority
|
Prioridad del grupo de contenedores.
|
ContainerGroupProperties.properties.InstanceView
|
Vista de instancia del grupo de contenedores. Solo es válido en respuesta.
|
ContainerGroupRestartPolicy
|
Reinicie la directiva para todos los contenedores del grupo de contenedores.
- reinicio siempre de
Always
-
OnFailure Reiniciar en caso de error
-
Never no reiniciar nunca
|
ContainerGroupSku
|
SKU del grupo de contenedores.
|
ContainerGroupSubnetId
|
Información de subred del grupo de contenedores.
|
ContainerHttpGet
|
La configuración http Get del contenedor, para el sondeo de ejecución o preparación
|
ContainerNetworkProtocol
|
Protocolo asociado al puerto.
|
ContainerPort
|
Puerto expuesto en la instancia del contenedor.
|
ContainerProbe
|
El sondeo de contenedor, para la ejecución o la preparación
|
ContainerState
|
Estado de la instancia del contenedor.
|
DeploymentExtensionSpec
|
Sidecars de extensión que se van a agregar a la implementación.
|
DnsConfiguration
|
Configuración de DNS para el grupo de contenedores.
|
dnsNameLabelReusePolicy
|
Valor que representa la enumeración de seguridad. El valor "No seguro" es el valor predeterminado si no está seleccionado y significa que la etiqueta de nombre de dominio del objeto no está protegida con la adquisición del subdominio. El valor "TenantReuse" es el valor predeterminado si está seleccionado y significa que la etiqueta de nombre de dominio del objeto se puede reutilizar en el mismo inquilino. El valor "SubscriptionReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro de la misma suscripción. El valor "ResourceGroupReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro del mismo grupo de recursos. El valor "NoReuse" significa que la etiqueta de nombre de dominio del objeto no se puede reutilizar dentro del mismo grupo de recursos, suscripción o inquilino.
|
EmptyDirVolume
|
Volumen de directorio vacío.
|
EncryptionProperties
|
Propiedades de cifrado del grupo de contenedores.
|
EnvironmentVariable
|
Variable de entorno que se va a establecer dentro de la instancia del contenedor.
|
Event
|
Un evento de instancia de contenedor o grupo de contenedores.
|
GitRepoVolume
|
Representa un volumen que se rellena con el contenido de un repositorio de Git.
|
GpuResource
|
El recurso de GPU.
|
GpuSku
|
SKU del recurso de GPU.
|
HttpHeader
|
Encabezado HTTP.
|
ImageRegistryCredential
|
Credencial del Registro de imágenes.
|
InitContainerDefinition
|
Definición del contenedor de inicialización.
|
InitContainerPropertiesDefinition.InstanceView
|
Vista de instancia del contenedor de inicialización. Solo es válido en respuesta.
|
InstanceView
|
Vista de instancia de la instancia de contenedor. Solo es válido en respuesta.
|
IpAddress
|
Dirección IP del grupo de contenedores.
|
LogAnalytics
|
Información de log analytics del grupo de contenedores.
|
LogAnalyticsLogType
|
Tipo de registro que se va a usar.
|
OperatingSystemTypes
|
Tipo de sistema operativo requerido por los contenedores del grupo de contenedores.
|
Port
|
Puerto expuesto en el grupo de contenedores.
|
ResourceIdentityType
|
Tipo de identidad que se usa para el grupo de contenedores. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del grupo de contenedores.
|
ResourceLimits
|
Límites de recursos.
|
ResourceRequests
|
Solicitudes de recursos.
|
ResourceRequirements
|
Requisitos de recursos.
|
Scheme
|
El esquema.
|
SecurityContextCapabilitiesDefinition
|
Funcionalidades que se van a agregar o quitar de un contenedor.
|
SecurityContextDefinition
|
Contexto de seguridad del contenedor.
|
UserAssignedIdentities
|
Lista de identidades de usuario asociadas al grupo de contenedores. Las referencias de clave de diccionario de identidad de usuario serán identificadores de recursos de ARM con el formato: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
Volume
|
Propiedades del volumen.
|
VolumeMount
|
Propiedades del montaje del volumen.
|
AzureFileVolume
Object
Las propiedades del volumen azure File. Los recursos compartidos de archivos de Azure se montan como volúmenes.
Nombre |
Tipo |
Description |
readOnly
|
boolean
|
Marca que indica si el recurso compartido de Azure File montado como volumen es de solo lectura.
|
shareName
|
string
|
Nombre del recurso compartido de archivos de Azure que se va a montar como un volumen.
|
storageAccountKey
|
string
|
La clave de acceso de la cuenta de almacenamiento que se usa para acceder al recurso compartido de archivos de Azure.
|
storageAccountName
|
string
|
Nombre de la cuenta de almacenamiento que contiene el recurso compartido de archivos de Azure.
|
CloudError
Object
Respuesta de error del servicio Container Instance.
Nombre |
Tipo |
Description |
error
|
CloudErrorBody
|
Respuesta de error del servicio Container Instance.
|
CloudErrorBody
Object
Respuesta de error del servicio Container Instance.
Nombre |
Tipo |
Description |
code
|
string
|
Identificador del error. Los códigos son invariables y están diseñados para consumirse mediante programación.
|
details
|
CloudErrorBody[]
|
Lista de detalles adicionales sobre el error.
|
message
|
string
|
Mensaje que describe el error, diseñado para ser adecuado para mostrarse en una interfaz de usuario.
|
target
|
string
|
Destino del error concreto. Por ejemplo, el nombre de la propiedad en error.
|
ConfidentialComputeProperties
Object
Propiedades del grupo de contenedores confidenciales
Nombre |
Tipo |
Description |
ccePolicy
|
string
|
Directiva de cumplimiento de proceso confidencial codificada en Base64
|
Container
Object
Una instancia de contenedor.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre proporcionado por el usuario de la instancia de contenedor.
|
properties.command
|
string[]
|
Los comandos que se van a ejecutar dentro de la instancia de contenedor en formato exec.
|
properties.environmentVariables
|
EnvironmentVariable[]
|
Variables de entorno que se van a establecer en la instancia de contenedor.
|
properties.image
|
string
|
Nombre de la imagen utilizada para crear la instancia del contenedor.
|
properties.instanceView
|
InstanceView
|
Vista de instancia de la instancia de contenedor. Solo es válido en respuesta.
|
properties.livenessProbe
|
ContainerProbe
|
Sondeo de ejecución.
|
properties.ports
|
ContainerPort[]
|
Puertos expuestos en la instancia de contenedor.
|
properties.readinessProbe
|
ContainerProbe
|
Sondeo de preparación.
|
properties.resources
|
ResourceRequirements
|
Requisitos de recursos de la instancia de contenedor.
|
properties.securityContext
|
SecurityContextDefinition
|
Propiedades de seguridad del contenedor.
|
properties.volumeMounts
|
VolumeMount[]
|
El volumen monta los montajes disponibles para la instancia de contenedor.
|
ContainerExec
Object
El comando de ejecución del contenedor, para el sondeo de ejecución o preparación
Nombre |
Tipo |
Description |
command
|
string[]
|
Comandos que se van a ejecutar en el contenedor.
|
ContainerGroup
Object
Un grupo de contenedores.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador del recurso.
|
identity
|
ContainerGroupIdentity
|
Identidad del grupo de contenedores, si está configurada.
|
location
|
string
|
Ubicación del recurso.
|
name
|
string
|
Nombre del recurso.
|
properties.confidentialComputeProperties
|
ConfidentialComputeProperties
|
Propiedades del grupo de contenedores confidenciales
|
properties.containers
|
Container[]
|
Contenedores dentro del grupo de contenedores.
|
properties.diagnostics
|
ContainerGroupDiagnostics
|
Información de diagnóstico de un grupo de contenedores.
|
properties.dnsConfig
|
DnsConfiguration
|
Información de configuración de DNS para un grupo de contenedores.
|
properties.encryptionProperties
|
EncryptionProperties
|
Propiedades de cifrado de un grupo de contenedores.
|
properties.extensions
|
DeploymentExtensionSpec[]
|
extensiones usadas por kubelet virtual
|
properties.imageRegistryCredentials
|
ImageRegistryCredential[]
|
Credenciales del Registro de imágenes a partir de las cuales se crea el grupo de contenedores.
|
properties.initContainers
|
InitContainerDefinition[]
|
Contenedores de inicialización de un grupo de contenedores.
|
properties.instanceView
|
ContainerGroupProperties.properties.InstanceView
|
Vista de instancia del grupo de contenedores. Solo es válido en respuesta.
|
properties.ipAddress
|
IpAddress
|
Tipo de dirección IP del grupo de contenedores.
|
properties.osType
|
OperatingSystemTypes
|
Tipo de sistema operativo requerido por los contenedores del grupo de contenedores.
|
properties.priority
|
ContainerGroupPriority
|
Prioridad del grupo de contenedores.
|
properties.provisioningState
|
string
|
Estado de aprovisionamiento del grupo de contenedores. Esto solo aparece en la respuesta.
|
properties.restartPolicy
|
ContainerGroupRestartPolicy
|
Reinicie la directiva para todos los contenedores del grupo de contenedores.
- reinicio siempre de
Always
-
OnFailure Reiniciar en caso de error
-
Never no reiniciar nunca
|
properties.sku
|
ContainerGroupSku
|
SKU de un grupo de contenedores.
|
properties.subnetIds
|
ContainerGroupSubnetId[]
|
Identificadores de recursos de subred para un grupo de contenedores.
|
properties.volumes
|
Volume[]
|
Lista de volúmenes que pueden montar los contenedores de este grupo de contenedores.
|
tags
|
object
|
Etiquetas de recursos.
|
type
|
string
|
Tipo de recurso.
|
zones
|
string[]
|
Zonas para el grupo de contenedores.
|
ContainerGroupDiagnostics
Object
Información de diagnóstico del grupo de contenedores.
Nombre |
Tipo |
Description |
logAnalytics
|
LogAnalytics
|
Información de log analytics del grupo de contenedores.
|
ContainerGroupIdentity
Object
Identidad del grupo de contenedores.
Nombre |
Tipo |
Description |
principalId
|
string
|
Identificador de entidad de seguridad de la identidad del grupo de contenedores. Esta propiedad solo se proporcionará para una identidad asignada por el sistema.
|
tenantId
|
string
|
Identificador de inquilino asociado al grupo de contenedores. Esta propiedad solo se proporcionará para una identidad asignada por el sistema.
|
type
|
ResourceIdentityType
|
Tipo de identidad que se usa para el grupo de contenedores. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del grupo de contenedores.
|
userAssignedIdentities
|
<string,
UserAssignedIdentities>
|
Lista de identidades de usuario asociadas al grupo de contenedores.
|
ContainerGroupIpAddressType
Enumeración
Especifica si la dirección IP se expone a la red virtual pública de Internet o privada.
Valor |
Description |
Private
|
|
Public
|
|
ContainerGroupNetworkProtocol
Enumeración
Protocolo asociado al puerto.
Valor |
Description |
TCP
|
|
UDP
|
|
ContainerGroupPriority
Enumeración
Prioridad del grupo de contenedores.
Valor |
Description |
Regular
|
|
Spot
|
|
ContainerGroupProperties.properties.InstanceView
Object
Vista de instancia del grupo de contenedores. Solo es válido en respuesta.
Nombre |
Tipo |
Description |
events
|
Event[]
|
Eventos de este grupo de contenedores.
|
state
|
string
|
Estado del grupo de contenedores. Solo es válido en respuesta.
|
ContainerGroupRestartPolicy
Enumeración
Reinicie la directiva para todos los contenedores del grupo de contenedores.
- reinicio siempre de
Always
-
OnFailure
Reiniciar en caso de error
-
Never
no reiniciar nunca
Valor |
Description |
Always
|
|
Never
|
|
OnFailure
|
|
ContainerGroupSku
Enumeración
SKU del grupo de contenedores.
Valor |
Description |
Confidential
|
|
Dedicated
|
|
Standard
|
|
ContainerGroupSubnetId
Object
Información de subred del grupo de contenedores.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso de la red virtual y la subred.
|
name
|
string
|
Nombre descriptivo de la subred.
|
ContainerHttpGet
Object
La configuración http Get del contenedor, para el sondeo de ejecución o preparación
Nombre |
Tipo |
Description |
httpHeaders
|
HttpHeader[]
|
Encabezados HTTP.
|
path
|
string
|
Ruta de acceso al sondeo.
|
port
|
integer
(int32)
|
Número de puerto que se va a sondear.
|
scheme
|
Scheme
|
El esquema.
|
ContainerNetworkProtocol
Enumeración
Protocolo asociado al puerto.
Valor |
Description |
TCP
|
|
UDP
|
|
ContainerPort
Object
Puerto expuesto en la instancia del contenedor.
Nombre |
Tipo |
Description |
port
|
integer
(int32)
|
Número de puerto expuesto en el grupo de contenedores.
|
protocol
|
ContainerNetworkProtocol
|
Protocolo asociado al puerto.
|
ContainerProbe
Object
El sondeo de contenedor, para la ejecución o la preparación
Nombre |
Tipo |
Description |
exec
|
ContainerExec
|
Comando de ejecución que se va a sondear
|
failureThreshold
|
integer
(int32)
|
Umbral de error.
|
httpGet
|
ContainerHttpGet
|
Configuración de Http Get que se va a sondear
|
initialDelaySeconds
|
integer
(int32)
|
Segundos de retraso inicial.
|
periodSeconds
|
integer
(int32)
|
Segundos de período.
|
successThreshold
|
integer
(int32)
|
Umbral de éxito.
|
timeoutSeconds
|
integer
(int32)
|
Los segundos de tiempo de espera.
|
ContainerState
Object
Estado de la instancia del contenedor.
Nombre |
Tipo |
Description |
detailStatus
|
string
|
Estado legible de la instancia del contenedor.
|
exitCode
|
integer
(int32)
|
Los códigos de salida de la instancia de contenedor corresponden a los del comando docker run .
|
finishTime
|
string
(date-time)
|
Fecha y hora en que finalizó el estado de la instancia del contenedor.
|
startTime
|
string
(date-time)
|
Fecha y hora en que se inició el estado de la instancia del contenedor.
|
state
|
string
|
Estado de la instancia del contenedor.
|
DeploymentExtensionSpec
Object
Sidecars de extensión que se van a agregar a la implementación.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre de la extensión.
|
properties.extensionType
|
string
|
Tipo de extensión que se va a agregar.
|
properties.protectedSettings
|
object
|
Configuración protegida para la extensión.
|
properties.settings
|
object
|
Configuración de la extensión.
|
properties.version
|
string
|
Versión de la extensión que se está usando.
|
DnsConfiguration
Object
Configuración de DNS para el grupo de contenedores.
Nombre |
Tipo |
Description |
nameServers
|
string[]
|
Los servidores DNS para el grupo de contenedores.
|
options
|
string
|
Opciones de DNS para el grupo de contenedores.
|
searchDomains
|
string
|
Dominios de búsqueda DNS para la búsqueda de nombres de host en el grupo de contenedores.
|
dnsNameLabelReusePolicy
Enumeración
Valor que representa la enumeración de seguridad. El valor "No seguro" es el valor predeterminado si no está seleccionado y significa que la etiqueta de nombre de dominio del objeto no está protegida con la adquisición del subdominio. El valor "TenantReuse" es el valor predeterminado si está seleccionado y significa que la etiqueta de nombre de dominio del objeto se puede reutilizar en el mismo inquilino. El valor "SubscriptionReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro de la misma suscripción. El valor "ResourceGroupReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro del mismo grupo de recursos. El valor "NoReuse" significa que la etiqueta de nombre de dominio del objeto no se puede reutilizar dentro del mismo grupo de recursos, suscripción o inquilino.
Valor |
Description |
Noreuse
|
|
ResourceGroupReuse
|
|
SubscriptionReuse
|
|
TenantReuse
|
|
Unsecure
|
|
EmptyDirVolume
Object
Volumen de directorio vacío.
EncryptionProperties
Object
Propiedades de cifrado del grupo de contenedores.
Nombre |
Tipo |
Description |
identity
|
string
|
Identidad administrada de keyvault.
|
keyName
|
string
|
Nombre de clave de cifrado.
|
keyVersion
|
string
|
Versión de la clave de cifrado.
|
vaultBaseUrl
|
string
|
Dirección URL base de keyvault.
|
EnvironmentVariable
Object
Variable de entorno que se va a establecer dentro de la instancia del contenedor.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre de la variable de entorno.
|
secureValue
|
string
|
Valor de la variable de entorno segura.
|
value
|
string
|
Valor de la variable de entorno.
|
Event
Object
Un evento de instancia de contenedor o grupo de contenedores.
Nombre |
Tipo |
Description |
count
|
integer
(int32)
|
Recuento del evento.
|
firstTimestamp
|
string
(date-time)
|
Fecha y hora del evento registrado más antiguo.
|
lastTimestamp
|
string
(date-time)
|
Fecha y hora del evento registrado más reciente.
|
message
|
string
|
Mensaje de evento.
|
name
|
string
|
Nombre del evento.
|
type
|
string
|
El tipo de evento.
|
GitRepoVolume
Object
Representa un volumen que se rellena con el contenido de un repositorio de Git.
Nombre |
Tipo |
Description |
directory
|
string
|
Nombre del directorio de destino. No debe contener ni comenzar con '..'. Si se proporciona '.', el directorio de volúmenes será el repositorio git. De lo contrario, si se especifica, el volumen contendrá el repositorio git en el subdirectorio con el nombre especificado.
|
repository
|
string
|
Dirección URL del repositorio
|
revision
|
string
|
Hash de confirmación para la revisión especificada.
|
GpuResource
Object
El recurso de GPU.
Nombre |
Tipo |
Description |
count
|
integer
(int32)
|
Recuento del recurso de GPU.
|
sku
|
GpuSku
|
SKU del recurso de GPU.
|
GpuSku
Enumeración
SKU del recurso de GPU.
Valor |
Description |
K80
|
|
P100
|
|
V100
|
|
Object
Encabezado HTTP.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre del encabezado.
|
value
|
string
|
Valor de encabezado.
|
ImageRegistryCredential
Object
Credencial del Registro de imágenes.
Nombre |
Tipo |
Description |
identity
|
string
|
Identidad del registro privado.
|
identityUrl
|
string
|
Dirección URL de identidad del registro privado.
|
password
|
string
|
Contraseña del registro privado.
|
server
|
string
|
El servidor del Registro de imágenes de Docker sin un protocolo como "http" y "https".
|
username
|
string
|
Nombre de usuario del registro privado.
|
InitContainerDefinition
Object
Definición del contenedor de inicialización.
Nombre |
Tipo |
Description |
name
|
string
|
Nombre del contenedor de inicialización.
|
properties.command
|
string[]
|
Comando que se va a ejecutar en el contenedor de inicialización en formato exec.
|
properties.environmentVariables
|
EnvironmentVariable[]
|
Variables de entorno que se van a establecer en el contenedor de inicialización.
|
properties.image
|
string
|
Imagen del contenedor de inicialización.
|
properties.instanceView
|
InitContainerPropertiesDefinition.InstanceView
|
Vista de instancia del contenedor de inicialización. Solo es válido en respuesta.
|
properties.securityContext
|
SecurityContextDefinition
|
Propiedades de seguridad del contenedor.
|
properties.volumeMounts
|
VolumeMount[]
|
El volumen monta los montajes disponibles para el contenedor de inicialización.
|
InitContainerPropertiesDefinition.InstanceView
Object
Vista de instancia del contenedor de inicialización. Solo es válido en respuesta.
Nombre |
Tipo |
Description |
currentState
|
ContainerState
|
Estado actual del contenedor de inicialización.
|
events
|
Event[]
|
Eventos del contenedor de inicialización.
|
previousState
|
ContainerState
|
Estado anterior del contenedor de inicialización.
|
restartCount
|
integer
(int32)
|
Número de veces que se ha reiniciado el contenedor de inicialización.
|
InstanceView
Object
Vista de instancia de la instancia de contenedor. Solo es válido en respuesta.
Nombre |
Tipo |
Description |
currentState
|
ContainerState
|
Estado actual de la instancia del contenedor.
|
events
|
Event[]
|
Eventos de la instancia de contenedor.
|
previousState
|
ContainerState
|
Estado anterior de la instancia del contenedor.
|
restartCount
|
integer
(int32)
|
Número de veces que se ha reiniciado la instancia del contenedor.
|
IpAddress
Object
Dirección IP del grupo de contenedores.
Nombre |
Tipo |
Valor predeterminado |
Description |
autoGeneratedDomainNameLabelScope
|
dnsNameLabelReusePolicy
|
Unsecure
|
Valor que representa la enumeración de seguridad. El valor "No seguro" es el valor predeterminado si no está seleccionado y significa que la etiqueta de nombre de dominio del objeto no está protegida con la adquisición del subdominio. El valor "TenantReuse" es el valor predeterminado si está seleccionado y significa que la etiqueta de nombre de dominio del objeto se puede reutilizar en el mismo inquilino. El valor "SubscriptionReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro de la misma suscripción. El valor "ResourceGroupReuse" significa que la etiqueta de nombre de dominio del objeto se puede reutilizar dentro del mismo grupo de recursos. El valor "NoReuse" significa que la etiqueta de nombre de dominio del objeto no se puede reutilizar dentro del mismo grupo de recursos, suscripción o inquilino.
|
dnsNameLabel
|
string
|
|
Etiqueta de nombre DNS para la dirección IP.
|
fqdn
|
string
|
|
FQDN para la dirección IP.
|
ip
|
string
|
|
Dirección IP expuesta a la red pública de Internet.
|
ports
|
Port[]
|
|
Lista de puertos expuestos en el grupo de contenedores.
|
type
|
ContainerGroupIpAddressType
|
|
Especifica si la dirección IP se expone a la red virtual pública de Internet o privada.
|
LogAnalytics
Object
Información de log analytics del grupo de contenedores.
Nombre |
Tipo |
Description |
logType
|
LogAnalyticsLogType
|
Tipo de registro que se va a usar.
|
metadata
|
object
|
Metadatos de Log Analytics.
|
workspaceId
|
string
|
Identificador del área de trabajo para Log Analytics
|
workspaceKey
|
string
|
La clave del área de trabajo para Log Analytics
|
workspaceResourceId
|
string
|
Identificador de recurso del área de trabajo para Log Analytics
|
LogAnalyticsLogType
Enumeración
Tipo de registro que se va a usar.
Valor |
Description |
ContainerInsights
|
|
ContainerInstanceLogs
|
|
OperatingSystemTypes
Enumeración
Tipo de sistema operativo requerido por los contenedores del grupo de contenedores.
Valor |
Description |
Linux
|
|
Windows
|
|
Port
Object
Puerto expuesto en el grupo de contenedores.
ResourceIdentityType
Enumeración
Tipo de identidad que se usa para el grupo de contenedores. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del grupo de contenedores.
Valor |
Description |
None
|
|
SystemAssigned
|
|
SystemAssigned, UserAssigned
|
|
UserAssigned
|
|
ResourceLimits
Object
Límites de recursos.
Nombre |
Tipo |
Description |
cpu
|
number
(double)
|
Límite de CPU de esta instancia de contenedor.
|
gpu
|
GpuResource
|
Límite de GPU de esta instancia de contenedor.
|
memoryInGB
|
number
(double)
|
Límite de memoria en GB de esta instancia de contenedor.
|
ResourceRequests
Object
Solicitudes de recursos.
Nombre |
Tipo |
Description |
cpu
|
number
(double)
|
Solicitud de CPU de esta instancia de contenedor.
|
gpu
|
GpuResource
|
Solicitud de GPU de esta instancia de contenedor.
|
memoryInGB
|
number
(double)
|
Solicitud de memoria en GB de esta instancia de contenedor.
|
ResourceRequirements
Object
Requisitos de recursos.
Nombre |
Tipo |
Description |
limits
|
ResourceLimits
|
Límites de recursos de esta instancia de contenedor.
|
requests
|
ResourceRequests
|
Solicitudes de recursos de esta instancia de contenedor.
|
Scheme
Enumeración
El esquema.
Valor |
Description |
http
|
|
https
|
|
SecurityContextCapabilitiesDefinition
Object
Funcionalidades que se van a agregar o quitar de un contenedor.
Nombre |
Tipo |
Description |
add
|
string[]
|
Funcionalidades que se van a agregar al contenedor.
|
drop
|
string[]
|
Funcionalidades que se van a quitar del contenedor.
|
SecurityContextDefinition
Object
Contexto de seguridad del contenedor.
Nombre |
Tipo |
Description |
allowPrivilegeEscalation
|
boolean
|
Valor booleano que indica si el proceso de inicialización puede elevar sus privilegios
|
capabilities
|
SecurityContextCapabilitiesDefinition
|
Funcionalidades que se van a agregar o quitar de un contenedor.
|
privileged
|
boolean
|
Marca para determinar si los permisos de contenedor se elevan a Privileged.
|
runAsGroup
|
integer
(int32)
|
Establece el GID de usuario para el contenedor.
|
runAsUser
|
integer
(int32)
|
Establece el UID de usuario del contenedor.
|
seccompProfile
|
string
|
una cadena codificada en base64 que contiene el contenido del JSON en el perfil de seccomp
|
UserAssignedIdentities
Object
Lista de identidades de usuario asociadas al grupo de contenedores. Las referencias de clave de diccionario de identidad de usuario serán identificadores de recursos de ARM con el formato: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
Nombre |
Tipo |
Description |
clientId
|
string
|
Identificador de cliente de la identidad asignada por el usuario.
|
principalId
|
string
|
Identificador principal de la identidad asignada por el usuario.
|
Volume
Object
Propiedades del volumen.
Nombre |
Tipo |
Description |
azureFile
|
AzureFileVolume
|
El volumen de Azure File.
|
emptyDir
|
EmptyDirVolume
|
Volumen de directorio vacío.
|
gitRepo
|
GitRepoVolume
|
El volumen del repositorio de Git.
|
name
|
string
|
Nombre del volumen.
|
secret
|
object
|
Volumen secreto.
|
VolumeMount
Object
Propiedades del montaje del volumen.
Nombre |
Tipo |
Description |
mountPath
|
string
|
Ruta de acceso dentro del contenedor donde se debe montar el volumen. No debe contener dos puntos (:).
|
name
|
string
|
Nombre del montaje del volumen.
|
readOnly
|
boolean
|
Marca que indica si el montaje del volumen es de solo lectura.
|