Vytvořte nebo aktualizujte skupiny kontejnerů se zadanými konfiguracemi.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}?api-version=2023-05-01
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
containerGroupName
|
path |
True
|
string
|
Název skupiny kontejnerů.
|
resourceGroupName
|
path |
True
|
string
|
Název skupiny prostředků.
|
subscriptionId
|
path |
True
|
string
|
Přihlašovací údaje předplatného, které jednoznačně identifikují předplatné Microsoft Azure. ID předplatného tvoří součást identifikátoru URI pro každé volání služby.
|
api-version
|
query |
True
|
string
|
Verze klientského rozhraní API
|
Text požadavku
Name |
Vyžadováno |
Typ |
Description |
properties.containers
|
True
|
Container[]
|
Kontejnery ve skupině kontejnerů.
|
properties.osType
|
True
|
OperatingSystemTypes
|
Typ operačního systému vyžadovaný kontejnery ve skupině kontejnerů.
|
identity
|
|
ContainerGroupIdentity
|
Identita skupiny kontejnerů, pokud je nakonfigurovaná.
|
location
|
|
string
|
Umístění prostředku.
|
properties.confidentialComputeProperties
|
|
ConfidentialComputeProperties
|
Vlastnosti pro důvěrnou skupinu kontejnerů
|
properties.diagnostics
|
|
ContainerGroupDiagnostics
|
Diagnostické informace pro skupinu kontejnerů.
|
properties.dnsConfig
|
|
DnsConfiguration
|
Informace o konfiguraci DNS pro skupinu kontejnerů.
|
properties.encryptionProperties
|
|
EncryptionProperties
|
Vlastnosti šifrování pro skupinu kontejnerů.
|
properties.extensions
|
|
DeploymentExtensionSpec[]
|
rozšíření používaná virtuálním kubeletem
|
properties.imageRegistryCredentials
|
|
ImageRegistryCredential[]
|
Přihlašovací údaje registru image, ze kterých je skupina kontejnerů vytvořena.
|
properties.initContainers
|
|
InitContainerDefinition[]
|
Inicializační kontejnery pro skupinu kontejnerů.
|
properties.ipAddress
|
|
IpAddress
|
Typ IP adresy skupiny kontejnerů.
|
properties.priority
|
|
ContainerGroupPriority
|
Priorita skupiny kontejnerů
|
properties.restartPolicy
|
|
ContainerGroupRestartPolicy
|
Restartujte zásadu pro všechny kontejnery ve skupině kontejnerů.
-
Always Vždy restartovat
-
OnFailure Restartování při selhání
-
Never Nikdy nerestartovat
|
properties.sku
|
|
ContainerGroupSku
|
Skladová položka pro skupinu kontejnerů.
|
properties.subnetIds
|
|
ContainerGroupSubnetId[]
|
ID prostředků podsítě pro skupinu kontejnerů.
|
properties.volumes
|
|
Volume[]
|
Seznam svazků, které lze připojit kontejnery v této skupině kontejnerů.
|
tags
|
|
object
|
Značky prostředků.
|
zones
|
|
string[]
|
Zóny pro skupinu kontejnerů.
|
Odpovědi
Name |
Typ |
Description |
200 OK
|
ContainerGroup
|
OK
|
201 Created
|
ContainerGroup
|
Vytvořeno – vytvoří se skupina kontejnerů.
|
Other Status Codes
|
CloudError
|
Chybová odpověď popisující, proč operace selhala.
|
Zabezpečení
azure_auth
Azure Active Directory OAuth2 Flow
Typ:
oauth2
Tok:
implicit
URL autorizace:
https://login.microsoftonline.com/common/oauth2/authorize
Rozsahy
Name |
Description |
user_impersonation
|
Zosobnění uživatelského účtu
|
Příklady
ConfidentialContainerGroup
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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
Ukázkový požadavek
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
Ukázková odpověď
{
"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"
}
Definice
Name |
Description |
AzureFileVolume
|
Vlastnosti svazku Azure File. Sdílené složky Azure se připojují jako svazky.
|
CloudError
|
Odpověď na chybu ze služby Instance kontejneru
|
CloudErrorBody
|
Odpověď na chybu ze služby Instance kontejneru
|
ConfidentialComputeProperties
|
Vlastnosti pro důvěrnou skupinu kontejnerů
|
Container
|
Instance kontejneru.
|
ContainerExec
|
Příkaz pro spuštění kontejneru pro sondu aktivity nebo připravenosti
|
ContainerGroup
|
Skupina kontejnerů.
|
ContainerGroupDiagnostics
|
Diagnostické informace o skupině kontejnerů
|
ContainerGroupIdentity
|
Identita pro skupinu kontejnerů
|
ContainerGroupIpAddressType
|
Určuje, jestli je IP adresa zpřístupněná veřejnému internetu nebo privátní virtuální síti.
|
ContainerGroupNetworkProtocol
|
Protokol přidružený k portu.
|
ContainerGroupPriority
|
Priorita skupiny kontejnerů
|
ContainerGroupProperties.properties.InstanceView
|
Zobrazení instance skupiny kontejnerů. Platné pouze v odpovědi.
|
ContainerGroupRestartPolicy
|
Restartujte zásadu pro všechny kontejnery ve skupině kontejnerů.
-
Always Vždy restartovat
-
OnFailure Restartování při selhání
-
Never Nikdy nerestartovat
|
ContainerGroupSku
|
Skladová položka skupiny kontejnerů.
|
ContainerGroupSubnetId
|
Informace o podsíti skupiny kontejnerů
|
ContainerHttpGet
|
Nastavení http get kontejneru pro sondu aktivity nebo připravenosti
|
ContainerNetworkProtocol
|
Protokol přidružený k portu.
|
ContainerPort
|
Port vystavený v instanci kontejneru.
|
ContainerProbe
|
Sonda kontejneru pro aktivní nebo připravenost
|
ContainerState
|
Stav instance kontejneru.
|
DeploymentExtensionSpec
|
Do nasazení se přidají sajdkárna rozšíření.
|
DnsConfiguration
|
Konfigurace DNS pro skupinu kontejnerů
|
dnsNameLabelReusePolicy
|
Hodnota představující výčt zabezpečení. Hodnota Unsecure je výchozí hodnota, pokud není vybraná a znamená, že popisek názvu domény objektu není zabezpečený proti převzetí subdomény. Hodnota TenantReuse je výchozí hodnota, pokud je vybraná, a znamená to, že popisek názvu domény objektu lze znovu použít ve stejném tenantovi. Hodnota SubscriptionReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejném předplatném. Hodnota ResourceGroupReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejné skupině prostředků. Hodnota NoReuse znamená, že popisek názvu domény objektu nelze znovu použít ve stejné skupině prostředků, předplatném nebo tenantovi.
|
EmptyDirVolume
|
Prázdný svazek adresáře.
|
EncryptionProperties
|
Vlastnosti šifrování skupiny kontejnerů.
|
EnvironmentVariable
|
Proměnná prostředí, která se má nastavit v rámci instance kontejneru.
|
Event
|
Skupina kontejnerů nebo událost instance kontejneru.
|
GitRepoVolume
|
Představuje svazek naplněný obsahem úložiště Git.
|
GpuResource
|
Prostředek GPU.
|
GpuSku
|
Skladová položka prostředku GPU.
|
HttpHeader
|
Hlavička HTTP.
|
ImageRegistryCredential
|
Přihlašovací údaje registru image.
|
InitContainerDefinition
|
Definice inicializačního kontejneru.
|
InitContainerPropertiesDefinition.InstanceView
|
Zobrazení instance inicializačního kontejneru. Platné pouze v odpovědi.
|
InstanceView
|
Zobrazení instance instance instance. Platné pouze v odpovědi.
|
IpAddress
|
IP adresa pro skupinu kontejnerů.
|
LogAnalytics
|
Informace o analýze protokolů skupin kontejnerů
|
LogAnalyticsLogType
|
Typ protokolu, který se má použít.
|
OperatingSystemTypes
|
Typ operačního systému vyžadovaný kontejnery ve skupině kontejnerů.
|
Port
|
Port vystavený ve skupině kontejnerů.
|
ResourceIdentityType
|
Typ identity, který se používá pro skupinu kontejnerů. Typ SystemAssigned, UserAssigned zahrnuje implicitně vytvořenou identitu i sadu identit přiřazených uživatelem. Typ None odebere všechny identity ze skupiny kontejnerů.
|
ResourceLimits
|
Limity prostředků.
|
ResourceRequests
|
Požadavky na prostředky.
|
ResourceRequirements
|
Požadavky na prostředky.
|
Scheme
|
Schéma.
|
SecurityContextCapabilitiesDefinition
|
Možnosti přidání nebo vyřazení z kontejneru
|
SecurityContextDefinition
|
Kontext zabezpečení kontejneru.
|
UserAssignedIdentities
|
Seznam identit uživatelů přidružených ke skupině kontejnerů. Odkazy na klíč slovníku identit uživatele budou ID prostředků ARM ve formátu: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
|
Volume
|
Vlastnosti svazku.
|
VolumeMount
|
Vlastnosti připojení svazku.
|
AzureFileVolume
Objekt
Vlastnosti svazku Azure File. Sdílené složky Azure se připojují jako svazky.
Name |
Typ |
Description |
readOnly
|
boolean
|
Příznak označující, jestli je sdílený soubor Azure připojený jako svazek jen pro čtení.
|
shareName
|
string
|
Název sdílené složky Azure, která se má připojit jako svazek.
|
storageAccountKey
|
string
|
Přístupový klíč účtu úložiště, který se používá pro přístup ke sdílené složce Azure.
|
storageAccountName
|
string
|
Název účtu úložiště, který obsahuje sdílenou složku Azure.
|
CloudError
Objekt
Odpověď na chybu ze služby Instance kontejneru
Name |
Typ |
Description |
error
|
CloudErrorBody
|
Odpověď na chybu ze služby Instance kontejneru
|
CloudErrorBody
Objekt
Odpověď na chybu ze služby Instance kontejneru
Name |
Typ |
Description |
code
|
string
|
Identifikátor chyby. Kódy jsou invariantní a mají být využity programově.
|
details
|
CloudErrorBody[]
|
Seznam dalších podrobností o chybě
|
message
|
string
|
Zpráva popisující chybu, která má být vhodná pro zobrazení v uživatelském rozhraní.
|
target
|
string
|
Cíl konkrétní chyby. Například název vlastnosti v chybě.
|
ConfidentialComputeProperties
Objekt
Vlastnosti pro důvěrnou skupinu kontejnerů
Name |
Typ |
Description |
ccePolicy
|
string
|
Zásada vynucení důvěrných výpočetních prostředků zakódovaná v kódování Base64
|
Container
Objekt
Instance kontejneru.
Name |
Typ |
Description |
name
|
string
|
Uživatelem zadaný název instance kontejneru.
|
properties.command
|
string[]
|
Příkazy, které se mají spustit v instanci kontejneru ve formuláři exec.
|
properties.environmentVariables
|
EnvironmentVariable[]
|
Proměnné prostředí, které se mají nastavit v instanci kontejneru.
|
properties.image
|
string
|
Název image použité k vytvoření instance kontejneru.
|
properties.instanceView
|
InstanceView
|
Zobrazení instance instance instance. Platné pouze v odpovědi.
|
properties.livenessProbe
|
ContainerProbe
|
Sonda aktivity.
|
properties.ports
|
ContainerPort[]
|
Vystavené porty v instanci kontejneru.
|
properties.readinessProbe
|
ContainerProbe
|
Sonda připravenosti.
|
properties.resources
|
ResourceRequirements
|
Požadavky na prostředky instance kontejneru.
|
properties.securityContext
|
SecurityContextDefinition
|
Vlastnosti zabezpečení kontejneru.
|
properties.volumeMounts
|
VolumeMount[]
|
Svazek se připojí k instanci kontejneru.
|
ContainerExec
Objekt
Příkaz pro spuštění kontejneru pro sondu aktivity nebo připravenosti
Name |
Typ |
Description |
command
|
string[]
|
Příkazy, které se mají spustit v rámci kontejneru.
|
ContainerGroup
Objekt
Skupina kontejnerů.
Name |
Typ |
Description |
id
|
string
|
ID prostředku.
|
identity
|
ContainerGroupIdentity
|
Identita skupiny kontejnerů, pokud je nakonfigurovaná.
|
location
|
string
|
Umístění prostředku.
|
name
|
string
|
Název prostředku.
|
properties.confidentialComputeProperties
|
ConfidentialComputeProperties
|
Vlastnosti pro důvěrnou skupinu kontejnerů
|
properties.containers
|
Container[]
|
Kontejnery ve skupině kontejnerů.
|
properties.diagnostics
|
ContainerGroupDiagnostics
|
Diagnostické informace pro skupinu kontejnerů.
|
properties.dnsConfig
|
DnsConfiguration
|
Informace o konfiguraci DNS pro skupinu kontejnerů.
|
properties.encryptionProperties
|
EncryptionProperties
|
Vlastnosti šifrování pro skupinu kontejnerů.
|
properties.extensions
|
DeploymentExtensionSpec[]
|
rozšíření používaná virtuálním kubeletem
|
properties.imageRegistryCredentials
|
ImageRegistryCredential[]
|
Přihlašovací údaje registru image, ze kterých je skupina kontejnerů vytvořena.
|
properties.initContainers
|
InitContainerDefinition[]
|
Inicializační kontejnery pro skupinu kontejnerů.
|
properties.instanceView
|
ContainerGroupProperties.properties.InstanceView
|
Zobrazení instance skupiny kontejnerů. Platné pouze v odpovědi.
|
properties.ipAddress
|
IpAddress
|
Typ IP adresy skupiny kontejnerů.
|
properties.osType
|
OperatingSystemTypes
|
Typ operačního systému vyžadovaný kontejnery ve skupině kontejnerů.
|
properties.priority
|
ContainerGroupPriority
|
Priorita skupiny kontejnerů
|
properties.provisioningState
|
string
|
Stav zřizování skupiny kontejnerů. Tato možnost se zobrazí pouze v odpovědi.
|
properties.restartPolicy
|
ContainerGroupRestartPolicy
|
Restartujte zásadu pro všechny kontejnery ve skupině kontejnerů.
-
Always Vždy restartovat
-
OnFailure Restartování při selhání
-
Never Nikdy nerestartovat
|
properties.sku
|
ContainerGroupSku
|
Skladová položka pro skupinu kontejnerů.
|
properties.subnetIds
|
ContainerGroupSubnetId[]
|
ID prostředků podsítě pro skupinu kontejnerů.
|
properties.volumes
|
Volume[]
|
Seznam svazků, které lze připojit kontejnery v této skupině kontejnerů.
|
tags
|
object
|
Značky prostředků.
|
type
|
string
|
Typ prostředku.
|
zones
|
string[]
|
Zóny pro skupinu kontejnerů.
|
ContainerGroupDiagnostics
Objekt
Diagnostické informace o skupině kontejnerů
Name |
Typ |
Description |
logAnalytics
|
LogAnalytics
|
Informace o analýze protokolů skupin kontejnerů
|
ContainerGroupIdentity
Objekt
Identita pro skupinu kontejnerů
Name |
Typ |
Description |
principalId
|
string
|
ID objektu zabezpečení identity skupiny kontejnerů. Tato vlastnost bude poskytována pouze pro identitu přiřazenou systémem.
|
tenantId
|
string
|
ID tenanta přidružené ke skupině kontejnerů. Tato vlastnost bude poskytována pouze pro identitu přiřazenou systémem.
|
type
|
ResourceIdentityType
|
Typ identity, který se používá pro skupinu kontejnerů. Typ SystemAssigned, UserAssigned zahrnuje implicitně vytvořenou identitu i sadu identit přiřazených uživatelem. Typ None odebere všechny identity ze skupiny kontejnerů.
|
userAssignedIdentities
|
<string,
UserAssignedIdentities>
|
Seznam identit uživatelů přidružených ke skupině kontejnerů.
|
ContainerGroupIpAddressType
Výčet
Určuje, jestli je IP adresa zpřístupněná veřejnému internetu nebo privátní virtuální síti.
Hodnota |
Description |
Private
|
|
Public
|
|
ContainerGroupNetworkProtocol
Výčet
Protokol přidružený k portu.
Hodnota |
Description |
TCP
|
|
UDP
|
|
ContainerGroupPriority
Výčet
Priorita skupiny kontejnerů
Hodnota |
Description |
Regular
|
|
Spot
|
|
ContainerGroupProperties.properties.InstanceView
Objekt
Zobrazení instance skupiny kontejnerů. Platné pouze v odpovědi.
Name |
Typ |
Description |
events
|
Event[]
|
Události této skupiny kontejnerů.
|
state
|
string
|
Stav skupiny kontejnerů. Platné pouze v odpovědi.
|
ContainerGroupRestartPolicy
Výčet
Restartujte zásadu pro všechny kontejnery ve skupině kontejnerů.
-
Always
Vždy restartovat
-
OnFailure
Restartování při selhání
-
Never
Nikdy nerestartovat
Hodnota |
Description |
Always
|
|
Never
|
|
OnFailure
|
|
ContainerGroupSku
Výčet
Skladová položka skupiny kontejnerů.
Hodnota |
Description |
Confidential
|
|
Dedicated
|
|
Standard
|
|
ContainerGroupSubnetId
Objekt
Informace o podsíti skupiny kontejnerů
Name |
Typ |
Description |
id
|
string
|
ID prostředku virtuální sítě a podsítě
|
name
|
string
|
Popisný název podsítě
|
ContainerHttpGet
Objekt
Nastavení http get kontejneru pro sondu aktivity nebo připravenosti
Name |
Typ |
Description |
httpHeaders
|
HttpHeader[]
|
Hlavičky HTTP.
|
path
|
string
|
Cesta k sondě.
|
port
|
integer
(int32)
|
Číslo portu, které se má testovat.
|
scheme
|
Scheme
|
Schéma.
|
ContainerNetworkProtocol
Výčet
Protokol přidružený k portu.
Hodnota |
Description |
TCP
|
|
UDP
|
|
ContainerPort
Objekt
Port vystavený v instanci kontejneru.
Name |
Typ |
Description |
port
|
integer
(int32)
|
Číslo portu vystavené ve skupině kontejnerů.
|
protocol
|
ContainerNetworkProtocol
|
Protokol přidružený k portu.
|
ContainerProbe
Objekt
Sonda kontejneru pro aktivní nebo připravenost
Name |
Typ |
Description |
exec
|
ContainerExec
|
Spouštěcí příkaz pro sondu
|
failureThreshold
|
integer
(int32)
|
Prahová hodnota selhání.
|
httpGet
|
ContainerHttpGet
|
Nastavení Http Get pro sondu
|
initialDelaySeconds
|
integer
(int32)
|
Počáteční prodleva sekund.
|
periodSeconds
|
integer
(int32)
|
Interval sekund.
|
successThreshold
|
integer
(int32)
|
Prahová hodnota úspěchu.
|
timeoutSeconds
|
integer
(int32)
|
Sekundy časového limitu.
|
ContainerState
Objekt
Stav instance kontejneru.
Name |
Typ |
Description |
detailStatus
|
string
|
Stav instance kontejneru čitelný pro člověka.
|
exitCode
|
integer
(int32)
|
Ukončovací kódy instance kontejneru odpovídají kódům z příkazu docker run .
|
finishTime
|
string
(date-time)
|
Datum a čas dokončení stavu instance kontejneru.
|
startTime
|
string
(date-time)
|
Datum a čas, kdy se spustil stav instance kontejneru.
|
state
|
string
|
Stav instance kontejneru.
|
DeploymentExtensionSpec
Objekt
Do nasazení se přidají sajdkárna rozšíření.
Name |
Typ |
Description |
name
|
string
|
Název rozšíření.
|
properties.extensionType
|
string
|
Typ rozšíření, které se má přidat.
|
properties.protectedSettings
|
object
|
Chráněná nastavení rozšíření.
|
properties.settings
|
object
|
Nastavení rozšíření
|
properties.version
|
string
|
Verze použitého rozšíření
|
DnsConfiguration
Objekt
Konfigurace DNS pro skupinu kontejnerů
Name |
Typ |
Description |
nameServers
|
string[]
|
Servery DNS pro skupinu kontejnerů.
|
options
|
string
|
Možnosti DNS pro skupinu kontejnerů.
|
searchDomains
|
string
|
Domény hledání DNS pro vyhledávání názvů hostitelů ve skupině kontejnerů.
|
dnsNameLabelReusePolicy
Výčet
Hodnota představující výčt zabezpečení. Hodnota Unsecure je výchozí hodnota, pokud není vybraná a znamená, že popisek názvu domény objektu není zabezpečený proti převzetí subdomény. Hodnota TenantReuse je výchozí hodnota, pokud je vybraná, a znamená to, že popisek názvu domény objektu lze znovu použít ve stejném tenantovi. Hodnota SubscriptionReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejném předplatném. Hodnota ResourceGroupReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejné skupině prostředků. Hodnota NoReuse znamená, že popisek názvu domény objektu nelze znovu použít ve stejné skupině prostředků, předplatném nebo tenantovi.
Hodnota |
Description |
Noreuse
|
|
ResourceGroupReuse
|
|
SubscriptionReuse
|
|
TenantReuse
|
|
Unsecure
|
|
EmptyDirVolume
Objekt
Prázdný svazek adresáře.
EncryptionProperties
Objekt
Vlastnosti šifrování skupiny kontejnerů.
Name |
Typ |
Description |
identity
|
string
|
Spravovaná identita služby Keyvault.
|
keyName
|
string
|
Název šifrovacího klíče.
|
keyVersion
|
string
|
Verze šifrovacího klíče.
|
vaultBaseUrl
|
string
|
Základní adresa URL služby keyvault.
|
EnvironmentVariable
Objekt
Proměnná prostředí, která se má nastavit v rámci instance kontejneru.
Name |
Typ |
Description |
name
|
string
|
Název proměnné prostředí.
|
secureValue
|
string
|
Hodnota zabezpečené proměnné prostředí.
|
value
|
string
|
Hodnota proměnné prostředí.
|
Event
Objekt
Skupina kontejnerů nebo událost instance kontejneru.
Name |
Typ |
Description |
count
|
integer
(int32)
|
Počet událostí.
|
firstTimestamp
|
string
(date-time)
|
Datum a čas nejstarší protokolované události.
|
lastTimestamp
|
string
(date-time)
|
Datum a čas poslední protokolované události.
|
message
|
string
|
Zpráva události.
|
name
|
string
|
Název události.
|
type
|
string
|
Typ události.
|
GitRepoVolume
Objekt
Představuje svazek naplněný obsahem úložiště Git.
Name |
Typ |
Description |
directory
|
string
|
Název cílového adresáře. Nesmí obsahovat ani začínat na ".". Pokud se zadá ".", adresář svazku bude úložištěm Git. V opačném případě bude svazek obsahovat úložiště Git v podadresáři s daným názvem.
|
repository
|
string
|
Adresa URL úložiště
|
revision
|
string
|
Potvrďte hodnotu hash pro zadanou revizi.
|
GpuResource
Objekt
Prostředek GPU.
Name |
Typ |
Description |
count
|
integer
(int32)
|
Počet prostředků GPU.
|
sku
|
GpuSku
|
Skladová položka prostředku GPU.
|
GpuSku
Výčet
Skladová položka prostředku GPU.
Hodnota |
Description |
K80
|
|
P100
|
|
V100
|
|
Objekt
Hlavička HTTP.
Name |
Typ |
Description |
name
|
string
|
Název záhlaví.
|
value
|
string
|
Hodnota záhlaví.
|
ImageRegistryCredential
Objekt
Přihlašovací údaje registru image.
Name |
Typ |
Description |
identity
|
string
|
Identita privátního registru.
|
identityUrl
|
string
|
Adresa URL identity privátního registru.
|
password
|
string
|
Heslo privátního registru.
|
server
|
string
|
Server registru imagí Dockeru bez protokolu, jako je http a https.
|
username
|
string
|
Uživatelské jméno pro privátní registr.
|
InitContainerDefinition
Objekt
Definice inicializačního kontejneru.
Name |
Typ |
Description |
name
|
string
|
Název inicializačního kontejneru.
|
properties.command
|
string[]
|
Příkaz, který se má provést v kontejneru inicializačních souborů ve formuláři exec.
|
properties.environmentVariables
|
EnvironmentVariable[]
|
Proměnné prostředí, které se mají nastavit v inicializačním kontejneru.
|
properties.image
|
string
|
Obrázek inicializačního kontejneru
|
properties.instanceView
|
InitContainerPropertiesDefinition.InstanceView
|
Zobrazení instance inicializačního kontejneru. Platné pouze v odpovědi.
|
properties.securityContext
|
SecurityContextDefinition
|
Vlastnosti zabezpečení kontejneru.
|
properties.volumeMounts
|
VolumeMount[]
|
Svazek se připojí k inicializačnímu kontejneru.
|
InitContainerPropertiesDefinition.InstanceView
Objekt
Zobrazení instance inicializačního kontejneru. Platné pouze v odpovědi.
Name |
Typ |
Description |
currentState
|
ContainerState
|
Aktuální stav inicializačního kontejneru.
|
events
|
Event[]
|
Události inicializačního kontejneru.
|
previousState
|
ContainerState
|
Předchozí stav inicializačního kontejneru.
|
restartCount
|
integer
(int32)
|
Počet restartování inicializačního kontejneru
|
InstanceView
Objekt
Zobrazení instance instance instance. Platné pouze v odpovědi.
Name |
Typ |
Description |
currentState
|
ContainerState
|
Aktuální stav instance kontejneru
|
events
|
Event[]
|
Události instance kontejneru.
|
previousState
|
ContainerState
|
Předchozí stav instance kontejneru
|
restartCount
|
integer
(int32)
|
Počet restartování instance kontejneru
|
IpAddress
Objekt
IP adresa pro skupinu kontejnerů.
Name |
Typ |
Default value |
Description |
autoGeneratedDomainNameLabelScope
|
dnsNameLabelReusePolicy
|
Unsecure
|
Hodnota představující výčt zabezpečení. Hodnota Unsecure je výchozí hodnota, pokud není vybraná a znamená, že popisek názvu domény objektu není zabezpečený proti převzetí subdomény. Hodnota TenantReuse je výchozí hodnota, pokud je vybraná, a znamená to, že popisek názvu domény objektu lze znovu použít ve stejném tenantovi. Hodnota SubscriptionReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejném předplatném. Hodnota ResourceGroupReuse znamená, že popisek názvu domény objektu lze znovu použít ve stejné skupině prostředků. Hodnota NoReuse znamená, že popisek názvu domény objektu nelze znovu použít ve stejné skupině prostředků, předplatném nebo tenantovi.
|
dnsNameLabel
|
string
|
|
Popisek názvu DNS pro IP adresu.
|
fqdn
|
string
|
|
Plně kvalifikovaný název domény pro IP adresu.
|
ip
|
string
|
|
IP adresa vystavená veřejnému internetu.
|
ports
|
Port[]
|
|
Seznam portů vystavených ve skupině kontejnerů.
|
type
|
ContainerGroupIpAddressType
|
|
Určuje, jestli je IP adresa zpřístupněná veřejnému internetu nebo privátní virtuální síti.
|
LogAnalytics
Objekt
Informace o analýze protokolů skupin kontejnerů
Name |
Typ |
Description |
logType
|
LogAnalyticsLogType
|
Typ protokolu, který se má použít.
|
metadata
|
object
|
Metadata pro log analytics
|
workspaceId
|
string
|
ID pracovního prostoru pro Log Analytics
|
workspaceKey
|
string
|
Klíč pracovního prostoru pro Log Analytics
|
workspaceResourceId
|
string
|
ID prostředku pracovního prostoru pro Log Analytics
|
LogAnalyticsLogType
Výčet
Typ protokolu, který se má použít.
Hodnota |
Description |
ContainerInsights
|
|
ContainerInstanceLogs
|
|
OperatingSystemTypes
Výčet
Typ operačního systému vyžadovaný kontejnery ve skupině kontejnerů.
Hodnota |
Description |
Linux
|
|
Windows
|
|
Port
Objekt
Port vystavený ve skupině kontejnerů.
ResourceIdentityType
Výčet
Typ identity, který se používá pro skupinu kontejnerů. Typ SystemAssigned, UserAssigned zahrnuje implicitně vytvořenou identitu i sadu identit přiřazených uživatelem. Typ None odebere všechny identity ze skupiny kontejnerů.
Hodnota |
Description |
None
|
|
SystemAssigned
|
|
SystemAssigned, UserAssigned
|
|
UserAssigned
|
|
ResourceLimits
Objekt
Limity prostředků.
Name |
Typ |
Description |
cpu
|
number
(double)
|
Omezení procesoru této instance kontejneru.
|
gpu
|
GpuResource
|
Limit GPU této instance kontejneru.
|
memoryInGB
|
number
(double)
|
Limit paměti v GB této instance kontejneru.
|
ResourceRequests
Objekt
Požadavky na prostředky.
Name |
Typ |
Description |
cpu
|
number
(double)
|
Požadavek na procesor této instance kontejneru.
|
gpu
|
GpuResource
|
Požadavek GPU této instance kontejneru.
|
memoryInGB
|
number
(double)
|
Požadavek na paměť v GB této instance kontejneru.
|
ResourceRequirements
Objekt
Požadavky na prostředky.
Name |
Typ |
Description |
limits
|
ResourceLimits
|
Omezení prostředků této instance kontejneru.
|
requests
|
ResourceRequests
|
Požadavky na prostředky této instance kontejneru.
|
Scheme
Výčet
Schéma.
Hodnota |
Description |
http
|
|
https
|
|
SecurityContextCapabilitiesDefinition
Objekt
Možnosti přidání nebo vyřazení z kontejneru
Name |
Typ |
Description |
add
|
string[]
|
Možnosti pro přidání do kontejneru.
|
drop
|
string[]
|
Možnosti pro vyřazení z kontejneru.
|
SecurityContextDefinition
Objekt
Kontext zabezpečení kontejneru.
Name |
Typ |
Description |
allowPrivilegeEscalation
|
boolean
|
Logická hodnota označující, jestli může inicializační proces zvýšit svá oprávnění
|
capabilities
|
SecurityContextCapabilitiesDefinition
|
Možnosti přidání nebo vyřazení z kontejneru
|
privileged
|
boolean
|
Příznak, který určuje, jestli jsou oprávnění kontejneru zvýšená na úroveň Privileged.
|
runAsGroup
|
integer
(int32)
|
Nastaví identifikátor GID uživatele pro kontejner.
|
runAsUser
|
integer
(int32)
|
Nastaví UID uživatele pro kontejner.
|
seccompProfile
|
string
|
kódovaný řetězec base64 obsahující obsah KÓDU JSON v profilu seccomp
|
UserAssignedIdentities
Objekt
Seznam identit uživatelů přidružených ke skupině kontejnerů. Odkazy na klíč slovníku identit uživatele budou ID prostředků ARM ve formátu: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
Name |
Typ |
Description |
clientId
|
string
|
ID klienta identity přiřazené uživatelem.
|
principalId
|
string
|
ID objektu zabezpečení identity přiřazené uživatelem.
|
Volume
Objekt
Vlastnosti svazku.
Name |
Typ |
Description |
azureFile
|
AzureFileVolume
|
Svazek Azure File.
|
emptyDir
|
EmptyDirVolume
|
Prázdný svazek adresáře.
|
gitRepo
|
GitRepoVolume
|
Svazek úložiště Git.
|
name
|
string
|
Název svazku.
|
secret
|
object
|
Tajný svazek.
|
VolumeMount
Objekt
Vlastnosti připojení svazku.
Name |
Typ |
Description |
mountPath
|
string
|
Cesta v kontejneru, do kterého se má svazek připojit. Nesmí obsahovat dvojtečku (:).
|
name
|
string
|
Název připojení svazku.
|
readOnly
|
boolean
|
Příznak označující, jestli je připojení svazku jen pro čtení.
|