Obtenha os certificados gerenciados em um determinado ambiente gerenciado.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates?api-version=2024-03-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
environmentName
|
path |
True
|
string
|
Nome do ambiente gerenciado.
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos. O nome não diferencia maiúsculas de minúsculas.
|
subscriptionId
|
path |
True
|
string
|
A ID da assinatura de destino.
|
api-version
|
query |
True
|
string
|
A versão da API a ser usada para esta operação.
|
Respostas
Segurança
azure_auth
Azure Ative Directory OAuth2 Flow
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
Name |
Description |
user_impersonation
|
personificar a sua conta de utilizador
|
Exemplos
List Managed Certificates by Managed Environment
Pedido de amostra
GET https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates?api-version=2024-03-01
/**
* Samples for ManagedCertificates List.
*/
public final class Main {
/*
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/
* ManagedCertificates_ListByManagedEnvironment.json
*/
/**
* Sample code: List Managed Certificates by Managed Environment.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void listManagedCertificatesByManagedEnvironment(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager.managedCertificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.appcontainers import ContainerAppsAPIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-appcontainers
# USAGE
python managed_certificates_list_by_managed_environment.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 = ContainerAppsAPIClient(
credential=DefaultAzureCredential(),
subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
)
response = client.managed_certificates.list(
resource_group_name="examplerg",
environment_name="testcontainerenv",
)
for item in response:
print(item)
# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_ListByManagedEnvironment.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 armappcontainers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/edf14cc0a577f6b9c4e3ce018cec0c383e64b7b0/specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_ListByManagedEnvironment.json
func ExampleManagedCertificatesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewManagedCertificatesClient().NewListPager("examplerg", "testcontainerenv", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.ManagedCertificateCollection = armappcontainers.ManagedCertificateCollection{
// Value: []*armappcontainers.ManagedCertificate{
// {
// Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ManagedCertificateProperties{
// DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME),
// ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded),
// SubjectName: to.Ptr("CN=my-subject-name.company.country.net"),
// },
// },
// {
// Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-root"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ManagedCertificateProperties{
// DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationHTTP),
// ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded),
// SubjectName: to.Ptr("CN=company.country.net"),
// },
// },
// {
// Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"),
// ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-txt"),
// Location: to.Ptr("East US"),
// Properties: &armappcontainers.ManagedCertificateProperties{
// DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationTXT),
// ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded),
// SubjectName: to.Ptr("CN=txt.company.country.net"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Managed Certificates in a given managed environment.
*
* @summary Get the Managed Certificates in a given managed environment.
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_ListByManagedEnvironment.json
*/
async function listManagedCertificatesByManagedEnvironment() {
const subscriptionId =
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "examplerg";
const environmentName = "testcontainerenv";
const credential = new DefaultAzureCredential();
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.managedCertificates.list(resourceGroupName, environmentName)) {
resArray.push(item);
}
console.log(resArray);
}
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.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.AppContainers.Models;
using Azure.ResourceManager.AppContainers;
// Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_ListByManagedEnvironment.json
// this example is just showing the usage of "ManagedCertificates_List" 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 ContainerAppManagedEnvironmentResource created on azure
// for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
string resourceGroupName = "examplerg";
string environmentName = "testcontainerenv";
ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName);
ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId);
// get the collection of this ContainerAppManagedCertificateResource
ContainerAppManagedCertificateCollection collection = containerAppManagedEnvironment.GetContainerAppManagedCertificates();
// invoke the operation and iterate over the result
await foreach (ContainerAppManagedCertificateResource item in collection.GetAllAsync())
{
// the variable item 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
ContainerAppManagedCertificateData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"value": [
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name",
"type": "Microsoft.App/ManagedEnvironments/managedCertificates",
"location": "East US",
"properties": {
"subjectName": "CN=my-subject-name.company.country.net",
"provisioningState": "Succeeded",
"domainControlValidation": "CNAME"
}
},
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-root",
"type": "Microsoft.App/ManagedEnvironments/managedCertificates",
"location": "East US",
"properties": {
"subjectName": "CN=company.country.net",
"provisioningState": "Succeeded",
"domainControlValidation": "HTTP"
}
},
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-txt",
"type": "Microsoft.App/ManagedEnvironments/managedCertificates",
"location": "East US",
"properties": {
"subjectName": "CN=txt.company.country.net",
"provisioningState": "Succeeded",
"domainControlValidation": "TXT"
}
}
]
}
Definições
createdByType
O tipo de identidade que criou o recurso.
Name |
Tipo |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
DefaultErrorResponse
Resposta de erro do Serviço de Aplicativo.
Name |
Tipo |
Description |
error
|
Error
|
Modelo de erro.
|
Details
Detalhes ou o erro
Name |
Tipo |
Description |
code
|
string
|
String padronizada para identificar programaticamente o erro.
|
message
|
string
|
Descrição detalhada do erro e informações de depuração.
|
target
|
string
|
Descrição detalhada do erro e informações de depuração.
|
Error
Modelo de erro.
Name |
Tipo |
Description |
code
|
string
|
String padronizada para identificar programaticamente o erro.
|
details
|
Details[]
|
Detalhes ou o erro
|
innererror
|
string
|
Mais informações para depurar erro.
|
message
|
string
|
Descrição detalhada do erro e informações de depuração.
|
target
|
string
|
Descrição detalhada do erro e informações de depuração.
|
ManagedCertificate
Certificados gerenciados usados para associações de domínio personalizado de aplicativos de contêiner em um ambiente gerenciado
Name |
Tipo |
Description |
id
|
string
|
ID de recurso totalmente qualificado para o recurso. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
A geolocalização onde o recurso vive
|
name
|
string
|
O nome do recurso
|
properties
|
Properties
|
Propriedades específicas do recurso de certificado
|
systemData
|
systemData
|
Metadados do Azure Resource Manager contendo informações createdBy e modifiedBy.
|
tags
|
object
|
Tags de recursos.
|
type
|
string
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
ManagedCertificateCollection
Coleção de certificados gerenciados.
Name |
Tipo |
Description |
nextLink
|
string
|
Link para a próxima página de recursos.
|
value
|
ManagedCertificate[]
|
Recolha de recursos.
|
Properties
Propriedades específicas do recurso Perfil de carga de trabalho.
Name |
Tipo |
Description |
currentCount
|
integer
|
Contagem atual de nós.
|
maximumCount
|
integer
|
Contagem máxima de nós.
|
minimumCount
|
integer
|
Contagem mínima de instâncias.
|
systemData
Metadados referentes à criação e última modificação do recurso.
Name |
Tipo |
Description |
createdAt
|
string
|
O carimbo de data/hora da criação de recursos (UTC).
|
createdBy
|
string
|
A identidade que criou o recurso.
|
createdByType
|
createdByType
|
O tipo de identidade que criou o recurso.
|
lastModifiedAt
|
string
|
O carimbo de data/hora da última modificação do recurso (UTC)
|
lastModifiedBy
|
string
|
A identidade que modificou o recurso pela última vez.
|
lastModifiedByType
|
createdByType
|
O tipo de identidade que modificou o recurso pela última vez.
|