ð Container Apps ã« Private Link 察å¿ïŒFront Door ãšçµ±åããŠã¿ã
2024幎11æ19æ¥ïŒMicrosoft Ignite 2024éå¬ïŒã«ãAzure Container Apps ã®ã¯ãŒã¯ããŒããããã¡ã€ã«ç°å¢ã§ãPrivate Link ããããªãã¯ãã¬ãã¥ãŒãšããŠå©çšå¯èœã«ãªããŸããð
Public Preview: Private endpoint support in Azure Container Apps for workload profiles environments
Private Link ãæ¡çšããããšã«ãããã»ãã¥ãªãã£ãšãããã¯ãŒã¯æ§èœã«åã ã¡ãªããããããŸãã
- Azure Container Apps ã® ãããªãã¯ãšã³ããã€ã³ããç¡å¹åããç¶æ ã«ãªããããå€éšããã®ã¢ã¯ã»ã¹ãé®æã§ããã
- Private Link éã®é信㯠Microsoft ã® ããã¯ããŒã³ãããã¯ãŒã¯ïŒMSææã®éåNWïŒ ãçµç±ããããããããã¯ãŒã¯é 延ãæå°éã«æããã
Private Link for Front Door æ§æã¯ãã°ããŒãã«åæ£ã«ãããã»ãã¥ãªãã£ãNWããã©ãŒãã³ã¹ã匷åããŠããããããå人çã«ã¯æšå¥šãããã¢ãŒããã¯ãã£ã§ãã
â æ¬ããã°ã§çŽ¹ä»ãã Azureæ§æ
â 2024幎11æ21æ¥æç¹ ã§ã® 泚æç¹
Private Link for Front Door çµç±ã§ Container Apps ãé ä¿¡å ã«ããæ§æãäœæããããã«ã¯ãAzure CLI ãŸã㯠Az-PowerShell ã®æäœãå¿ èŠã«ãªããŸãã æ¬æ©èœã¯ ãããªãã¯ãã¬ãã¥ãŒ ãšããããšãããã2024幎11æ21æ¥æç¹ã§ã¯ãAzure Portal ã«ãã GUIæäœ ãã§ããªããã ã泚æãã ããã
â ãã£ãŠã¿ã
MS Learn ã«ãŠ Container Apps ã Front Doorã«çµ±åãã ãã¥ãŒããªã¢ã« ãå
¬éãããŠããŸããããã£ãŠã¿ãŸãã
Create a private link to an Azure Container App with Azure Front Door (preview)
æ¬ããã°ã§ã¯ãAzure CloudShell 㧠PowerShell 7ç³»ïŒ7.4.5ïŒã䜿çšããŠããŸãã
ïŒ. äºåæºå
ïŒïŒïŒazure-cliã®ææ°å ãš Container Appsã®æ¡åŒµæ©èœ ãæå¹å
Container Apps ã® Private Link ã¯ãããªãã¯ãã¬ãã¥ãŒãªã®ã§ãæ¡åŒµæ©èœãå©çšã§ããããã«ããŸãã
# ææ°å
az upgrade
# Container Apps ã® æ¡åŒµæ©èœ ãæå¹å
az extension add --name containerapp --upgrade --allow-preview true
æ¬ããã°ã§ã¯ãazure-cli ã 2.65.0
ããŒãžã§ã³ã§äœ¿çšããŠããŸãã
ïŒïŒïŒaz login
Azure CloudShellã®ã»ãã·ã§ã³ä¿æã¯æå¹æéäžã§ãããŸãã«åããŸããåãããšäžèšã®ãšã©ãŒãåºãŸããå®æçã«åãã°ã€ã³ããŠãã ããã
Failed to connect to MSI. Please make sure MSI is configured correctly. Get Token request returned: <Response [400]>
az login
ïŒïŒïŒãªãœãŒã¹æ å ± ãå®çŸ©
ãªãœãŒã¹æ å ±ãå®çŸ©ããŸãã
$RESOURCE_GROUP="rg-techblog"
$LOCATION="japaneast"
$ENVIRONMENT_NAME="ca-environment-techblog-je"
$CONTAINERAPP_NAME="container-app-techblog-je"
$AFD_PROFILE="afd-techblog"
$AFD_ENDPOINT="afd-endpoint-techblog"
$AFD_ORIGIN_GROUP="afd-origin-group-techblog"
$AFD_ORIGIN="afd-origin-techblog"
$AFD_ROUTE="afd-route-techblog"
ïŒ. ãªãœãŒã¹ã°ã«ãŒã ãäœæ
ãªãœãŒã¹ã°ã«ãŒã ãäœæããŸãã
az group create `
--name $RESOURCE_GROUP `
--location $LOCATION
ïŒ. Container Apps ç°å¢ ãäœæ
Container Apps ç°å¢ ãäœæããŠãããŸãã
az containerapp env create `
--name $ENVIRONMENT_NAME `
--resource-group $RESOURCE_GROUP `
--location $LOCATION
ãåèãaz containerapp env create (containerapp æ¡åŒµæ©èœ)
æåãããšãContainer Apps ç°å¢ ãš Log Analytics ã¯ãŒã¯ã¹ããŒã¹ ãäœæãããŸãã
Container Apps ç°å¢ ã® ãªãœãŒã¹ID ã ENVIRONMENT_ID
ã«æ ŒçŽããŸãã
$ENVIRONMENT_ID=$(az containerapp env show `
--resource-group $RESOURCE_GROUP `
--name $ENVIRONMENT_NAME `
--query "id" `
--output tsv)
ãåèãaz containerapp env show
Private Link ã®ã¿ã®ã¢ã¯ã»ã¹ãèš±å¯ããããããããªãã¯ãããã¯ãŒã¯ã¢ã¯ã»ã¹ ãç¡å¹åããŸãã
az containerapp env update `
--id $ENVIRONMENT_ID `
--public-network-access Disabled
ãåèãaz containerapp env update (containerapp æ¡åŒµæ©èœ)
æåãããšãåä¿¡ãã©ãã£ãã¯ãçŠæ¢ïŒ=ç¡å¹åïŒãããããšã確èªã§ããŸãã
ïŒ. Container Apps ãäœæ
Container Apps ç°å¢ ãäœæã§ãããããã³ã³ããã®ã¢ããªããããã€ã§ããããã«ãªããŸããã
Container Apps ãäœæããŸãã
az containerapp up `
--name $CONTAINERAPP_NAME `
--resource-group $RESOURCE_GROUP `
--location $LOCATION `
--environment $ENVIRONMENT_NAME `
--image mcr.microsoft.com/k8se/quickstart:latest `
--target-port 80 `
--ingress external `
--query properties.configuration.ingress.fqdn
ãåèãaz containerapp up (containerapp æ¡åŒµæ©èœ)
æåãããšãContainer Apps ãäœæãããŸãã
Front Door ã® é ä¿¡å ãã¹ã ã«èšå®ãã Container Apps ã® ã€ã³ã°ã¬ã¹URI ãååŸããŸãã
$ACA_ENDPOINT=$(az containerapp show `
--name $CONTAINERAPP_NAME `
--resource-group $RESOURCE_GROUP `
--query properties.configuration.ingress.fqdn `
--output tsv)
ãåèãaz containerapp show (containerapp æ¡åŒµæ©èœ)
ïŒ. Front Door ïŒ Private Link ãäœæ
ïŒïŒïŒFront Door ã® ãããã¡ã€ã« ãäœæ
ãããã¡ã€ã« ãäœæããŠãããŸãããªããFront Door ã® Private Linkæ©èœ 㯠Premium SKU ã®ã¿ã§ããStandard SKU 㯠CDNæ©èœ ããæäŸãããŠããŸããã®ã§å©çšäžå¯ã§ãã
az afd profile create `
--profile-name $AFD_PROFILE `
--resource-group $RESOURCE_GROUP `
--sku Premium_AzureFrontDoor
æåãããšãFront Door ãäœæãããŸãã
ïŒïŒïŒFront Door ã® ããã³ããšã³ããã€ã³ã ãäœæ
Front Door ã®ããã³ããšã³ããã€ã³ã ãäœæããŠãããŸããéåžžã¯ããã®ããã³ããšã³ããã€ã³ãã« ã«ã¹ã¿ã ãã¡ã€ã³ ãå²ãåœãŠãŠå€éšå ¬éããŸãããä»åã¯æ€èšŒãªã®ã§ãã®ãŸãŸã«ããŸãã
az afd endpoint create `
--resource-group $RESOURCE_GROUP `
--endpoint-name $AFD_ENDPOINT `
--profile-name $AFD_PROFILE `
--enabled-state Enabled
æåãããšãããã³ããšã³ããã€ã³ã ã確èªã§ããŸãã
ïŒïŒïŒFront Door ã® é ä¿¡å ã°ã«ãŒã ãäœæ
ããã³ããšã³ããã€ã³ã ã§æäŸããããµãŒãã¹ã¯ãé
ä¿¡å
ã°ã«ãŒãããšããåäœã§ç®¡çããŸãã
é
ä¿¡å
ã°ã«ãŒã ãäœæããŸãã
az afd origin-group create `
--resource-group $RESOURCE_GROUP `
--origin-group-name $AFD_ORIGIN_GROUP `
--profile-name $AFD_PROFILE `
--probe-request-type HEAD `
--probe-protocol Http `
--probe-interval-in-seconds 60 `
--probe-path / `
--sample-size 4 `
--successful-samples-required 3 `
--additional-latency-in-milliseconds 50
æåãããšãé
ä¿¡å
ã°ã«ãŒã ã確èªã§ããŸãã
ïŒïŒïŒFront Door ã® é ä¿¡å ãäœæ
é
ä¿¡å
ã®ãªãœãŒã¹æ
å ±ãå®çŸ©ããŠãããŸããå®çŸ©ããéãFront Door ã«ãPrivate Link ã䜿ããããš --private-link-ãã
ã®ãã©ã¡ãŒã¿çŸ€ãæž¡ããŸãã
az afd origin create `
--resource-group $RESOURCE_GROUP `
--origin-group-name $AFD_ORIGIN_GROUP `
--origin-name $AFD_ORIGIN `
--profile-name $AFD_PROFILE `
--host-name $ACA_ENDPOINT `
--origin-host-header $ACA_ENDPOINT `
--priority 1 `
--weight 500 `
--enable-private-link true `
--private-link-location $LOCATION `
--private-link-request-message "AFD Private Link Request" `
--private-link-resource $ENVIRONMENT_ID `
--private-link-sub-resource-type managedEnvironments
æåãããšãé
ä¿¡å
ã®ãªãœãŒã¹æ
å ± ã確èªã§ããŸãã
é
ä¿¡å
ã§ã¯ Private Linkã®èšå® ãå
¥ã£ãŠããªãããã«èŠããŸãããå®éã¯èšå®ãããŠããŸãã
â sharedPrivateLinkResource
ãããã㣠ãçããŠããŸãã
åºåçµæïŒAzure Portaläžã§ã¯ç¢ºèªã§ããªãé ç®ãããããæ²èŒïŒ
{
"deploymentStatus": "NotStarted",
"enabledState": "Enabled",
"enforceCertificateNameCheck": true,
"hostName": "container-app-techblog-je.mangocoast-cd48a694.japaneast.azurecontainerapps.io",
"httpPort": 80,
"httpsPort": 443,
"id": "/subscriptions/<ãµãã¹ã¯ãªãã·ã§ã³ID>/resourcegroups/rg-techblog/providers/Microsoft.Cdn/profiles/afd-techblog/origingroups/afd-origin-group-techblog/origins/afd-origin-techblog",
"name": "afd-origin-techblog",
"originGroupName": "afd-origin-group-techblog",
"originHostHeader": "container-app-techblog-je.mangocoast-cd48a694.japaneast.azurecontainerapps.io",
"priority": 1,
"provisioningState": "Succeeded",
"resourceGroup": "rg-techblog",
"sharedPrivateLinkResource": {
"groupId": "managedEnvironments",
"privateLink": {
"id": "/subscriptions/<ãµãã¹ã¯ãªãã·ã§ã³ID>/resourceGroups/rg-techblog/providers/Microsoft.App/managedEnvironments/ca-environment-techblog-je",
"resourceGroup": "rg-techblog"
},
"privateLinkLocation": "japaneast",
"requestMessage": "AFD Private Link Request"
},
"type": "Microsoft.Cdn/profiles/origingroups/origins",
"weight": 500
}
ïŒïŒïŒPrivate Link for Front Door ãæ¿èªãã
Azure Portal 㧠Private Endpoint ãäœæãããšããã©ã«ãã§èªåæ¿èªã¢ãŒããé©çšãããPrivate Link ãããã«äœ¿ããŸãããã ãFront Door 㧠Private Link ã䜿çšããå Žåã¯ãæåæ¿èªãå¿ èŠã§ãã
MS Learn ã§ã¯azã³ãã³ãã䜿ã£ãŠããŸãããAzure Portal ãã æ¿èªæäœããã»ãããããããã®ã§çŽ¹ä»ããŸãã
Container Apps ç°å¢ã³ã³ãœãŒã«ã«ã¢ã¯ã»ã¹ããããããã¯ãŒã¯(ãã¬ãã¥ãŒ)ããæŒäžããã©ã€ããŒããšã³ããã€ã³ã ãéžæããŸãã
æ¥ç¶ç¶æ
ã ãPendingãã«ãªã£ãŠããããšã確èªããæ¿èªãã¿ã³ãæŒäžããŸãã
æ¿èªãã¿ã³ãæŒäžåŸã10åã»ã©åŸ æ©ããŠãã ãããéåžžã¯ã¹ããŒã¿ã¹ãðããŒã¯ãã確èªã§ããã®ã§ããããã®æ¿èªæäœã¯ç¡éã«ã¹ããŒã¿ã¹ãå€ãããŸãããç§ã¯éå»ã«3æéåŸ ã¡ãŸãããããã£ãšæ¿èªäžã®ã¹ããŒã¿ã¹ããå€åããŸããã§ãããå éšçã«ã¯æ¿èªãéããŠãããããåé¡ãªãã§ãã
ïŒïŒïŒFront Door ã® é ä¿¡å ã«ãŒã ãäœæ
ããã³ããšã³ããã€ã³ã ãš é ä¿¡å ã°ã«ãŒã ãé¢é£ä»ããŸãã
az afd route create `
--resource-group $RESOURCE_GROUP `
--profile-name $AFD_PROFILE `
--endpoint-name $AFD_ENDPOINT `
--forwarding-protocol MatchRequest `
--route-name $AFD_ROUTE `
--https-redirect Enabled `
--origin-group $AFD_ORIGIN_GROUP `
--supported-protocols Http Https `
--link-to-default-domain Enabled
æåãããšãé
ä¿¡å
ã°ã«ãŒãã®ç»é¢ã§ ããã³ããšã³ããã€ã³ã ãçŽã¥ããŠããããšã確èªã§ããŸãã
â åäœç¢ºèª
ããã³ããã¢ãšã³ããã€ã³ã ããã©ãŠã¶ã§å®è¡ããŸãããïŒâ» ååã¯è¡šç€ºããããŸã§ã«30ç§ã»ã©ããããŸãã
az afd endpoint show `
--resource-group $RESOURCE_GROUP `
--profile-name $AFD_PROFILE `
--endpoint-name $AFD_ENDPOINT `
--query hostName `
--output tsv
â ãããã«
ãããŸã§ Container Apps 㯠VNetçµ±å ããµããŒãããŠããŸããããPrivate Link ã«ã察å¿ããŠããããšã Microsoftã®çºè¡šã«ããèŠããŠããã£ãã§ããåä¿¡ãã©ãã£ãã¯ã®ã¿å©çšããããŠãŒã¹ã±ãŒã¹ã¯å€ããPrivate Link ãåŸ æããã人ãã¡ãå€ãã§ãããã
ãŸã ãããªãã¯ãã¬ãã¥ãŒ ã§ã¯ãããŸãããå人çã«ã¯äžè¬æäŸ(GA)ãããŠããå©çšããã¹ãã ãšèããŠããŸããAzure Portal äžã§ã®ç¢ºèªã§ããªãèšå®å€ãããããããªãã¬ãŒã·ã§ã³ãã¹ãçºçããå¯èœæ§ããããŸããæ£åŒãªãªãŒã¹ãåŸ ã¡ãŸãããã
Discussion