Analiza un nombre de host personalizado para una aplicación contenedora
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis?api-version=2023-05-01
With optional parameters:
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis?customHostname={customHostname}&api-version=2023-05-01
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
containerAppName
|
path |
True
|
string
|
Nombre de la aplicación contenedora.
|
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos. El nombre distingue mayúsculas de minúsculas.
|
subscriptionId
|
path |
True
|
string
|
Identificador de la suscripción de destino.
|
api-version
|
query |
True
|
string
|
Versión de API que se usará para la operación.
|
customHostname
|
query |
|
string
|
Nombre de host personalizado.
|
Respuestas
Seguridad
azure_auth
Flujo OAuth2 de Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
Analyze Custom Hostname
Sample Request
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerapp0/listCustomHostNameAnalysis?customHostname=my.name.corp&api-version=2023-05-01
/** Samples for ContainerApps ListCustomHostnameAnalysis. */
public final class Main {
/*
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.json
*/
/**
* Sample code: Analyze Custom Hostname.
*
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
manager
.containerApps()
.listCustomHostnameAnalysisWithResponse(
"rg", "testcontainerApp0", "my.name.corp", 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 container_apps_list_custom_host_name_analysis.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.container_apps.list_custom_host_name_analysis(
resource_group_name="rg",
container_app_name="testcontainerApp0",
)
print(response)
# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.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/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/58be094c6b365f8d4d73a91e293dfb4818e57cf6/specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.json
func ExampleContainerAppsClient_ListCustomHostNameAnalysis() {
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)
}
res, err := clientFactory.NewContainerAppsClient().ListCustomHostNameAnalysis(ctx, "rg", "testcontainerApp0", &armappcontainers.ContainerAppsClientListCustomHostNameAnalysisOptions{CustomHostname: to.Ptr("my.name.corp")})
if err != nil {
log.Fatalf("failed to finish the request: %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.CustomHostnameAnalysisResult = armappcontainers.CustomHostnameAnalysisResult{
// ARecords: []*string{
// to.Ptr("aRecord1"),
// to.Ptr("aRecord2")},
// AlternateCNameRecords: []*string{
// to.Ptr("cNameRecord1"),
// to.Ptr("cNameRecord2")},
// AlternateTxtRecords: []*string{
// to.Ptr("txtRecord1"),
// to.Ptr("txtRecord2")},
// CNameRecords: []*string{
// to.Ptr("cNameRecord1"),
// to.Ptr("cNameRecord2")},
// ConflictingContainerAppResourceID: to.Ptr(""),
// CustomDomainVerificationFailureInfo: &armappcontainers.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo{
// },
// CustomDomainVerificationTest: to.Ptr(armappcontainers.DNSVerificationTestResultPassed),
// HasConflictOnManagedEnvironment: to.Ptr(false),
// HostName: to.Ptr("my.name.corp"),
// IsHostnameAlreadyVerified: to.Ptr(true),
// TxtRecords: []*string{
// to.Ptr("txtRecord1"),
// to.Ptr("txtRecord2")},
// }
}
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 Analyzes a custom hostname for a Container App
*
* @summary Analyzes a custom hostname for a Container App
* x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.json
*/
async function analyzeCustomHostname() {
const subscriptionId =
process.env["APPCONTAINERS_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const resourceGroupName = process.env["APPCONTAINERS_RESOURCE_GROUP"] || "rg";
const containerAppName = "testcontainerApp0";
const customHostname = "my.name.corp";
const options = {
customHostname,
};
const credential = new DefaultAzureCredential();
const client = new ContainerAppsAPIClient(credential, subscriptionId);
const result = await client.containerApps.listCustomHostNameAnalysis(
resourceGroupName,
containerAppName,
options
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.AppContainers;
using Azure.ResourceManager.AppContainers.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.json
// this example is just showing the usage of "ContainerApps_ListCustomHostNameAnalysis" 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 ContainerAppResource created on azure
// for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource
string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
string resourceGroupName = "rg";
string containerAppName = "testcontainerApp0";
ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName);
ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId);
// invoke the operation
string customHostname = "my.name.corp";
ContainerAppCustomHostnameAnalysisResult result = await containerApp.GetCustomHostNameAnalysisAsync(customHostname: customHostname);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"hostName": "my.name.corp",
"isHostnameAlreadyVerified": true,
"customDomainVerificationTest": "Passed",
"customDomainVerificationFailureInfo": {},
"hasConflictOnManagedEnvironment": false,
"conflictingContainerAppResourceId": "",
"cNameRecords": [
"cNameRecord1",
"cNameRecord2"
],
"txtRecords": [
"txtRecord1",
"txtRecord2"
],
"aRecords": [
"aRecord1",
"aRecord2"
],
"alternateCNameRecords": [
"cNameRecord1",
"cNameRecord2"
],
"alternateTxtRecords": [
"txtRecord1",
"txtRecord2"
]
}
Definiciones
CustomDomainVerificationFailureInfo
Información de error sin procesar si se produce un error en la comprobación de DNS.
Nombre |
Tipo |
Description |
code
|
string
|
Cadena estandarizada para identificar mediante programación el error.
|
details
|
Details[]
|
Detalles o el error
|
message
|
string
|
Descripción detallada del error e información de depuración.
|
target
|
string
|
Descripción detallada del error e información de depuración.
|
CustomHostnameAnalysisResult
Análisis de dominio personalizado.
Nombre |
Tipo |
Description |
aRecords
|
string[]
|
Registros visibles para este nombre de host.
|
alternateCNameRecords
|
string[]
|
Registros CName alternativos visibles para este nombre de host.
|
alternateTxtRecords
|
string[]
|
Registros TXT alternativos visibles para este nombre de host.
|
cNameRecords
|
string[]
|
CName registra visibles para este nombre de host.
|
conflictWithEnvironmentCustomDomain
|
boolean
|
true si hay un conflicto en el dominio personalizado del nivel de entorno administrado de la aplicación contenedora; de lo contrario, false .
|
conflictingContainerAppResourceId
|
string
|
Nombre de la aplicación contenedora en conflicto en el entorno administrado si se encuentra dentro de la misma suscripción.
|
customDomainVerificationFailureInfo
|
CustomDomainVerificationFailureInfo
|
Información de error sin procesar si se produce un error en la comprobación de DNS.
|
customDomainVerificationTest
|
DnsVerificationTestResult
|
Resultado de la prueba de comprobación de DNS.
|
hasConflictOnManagedEnvironment
|
boolean
|
true si hay un conflicto en el entorno administrado de la aplicación contenedora; de lo contrario, false .
|
hostName
|
string
|
Nombre de host que se analizó
|
isHostnameAlreadyVerified
|
boolean
|
true si ya se ha comprobado el nombre de host; de lo contrario, false .
|
txtRecords
|
string[]
|
Registros TXT visibles para este nombre de host.
|
DefaultErrorResponse
App Service respuesta de error.
Nombre |
Tipo |
Description |
error
|
Error
|
Modelo de error.
|
Details
Detalles o el error
Nombre |
Tipo |
Description |
code
|
string
|
Cadena estandarizada para identificar mediante programación el error.
|
message
|
string
|
Descripción detallada del error e información de depuración.
|
target
|
string
|
Descripción detallada del error e información de depuración.
|
DnsVerificationTestResult
Resultado de la prueba de comprobación de DNS.
Nombre |
Tipo |
Description |
Failed
|
string
|
|
Passed
|
string
|
|
Skipped
|
string
|
|
Error
Modelo de error.
Nombre |
Tipo |
Description |
code
|
string
|
Cadena estandarizada para identificar mediante programación el error.
|
details
|
Details[]
|
Detalles o el error
|
innererror
|
string
|
Más información para depurar el error.
|
message
|
string
|
Descripción detallada del error e información de depuración.
|
target
|
string
|
Descripción detallada del error e información de depuración.
|