Skip to content

Commit aefdefc

Browse files
authored
Merge pull request #298983 from svaldesgzz/arc-enableds-workloads
Azure Extended Zones: Created 3 new articles and updated TOC
2 parents b03b2dc + 31e2fd3 commit aefdefc

11 files changed

+759
-30
lines changed

articles/extended-zones/TOC.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
href: create-storage-account.md
3030
- name: Request quota increase
3131
href: request-quota-increase.md
32+
- name: Arc-enabled PaaS workloads in Extended Zones
33+
items:
34+
- name: Create Arc-Enabled AKS Clusters in Extended Zones
35+
href: arc-enabled-workloads-arc-enabled-aks-cluster.md
36+
- name: ContainerApps
37+
href: arc-enabled-workloads-container-apps.md
38+
- name: PostgreSQL
39+
href: arc-enabled-workloads-postgre-sql.md
40+
- name: ManagedSQL
41+
href: arc-enabled-workloads-managed-sql.md
3242
- name: Security
3343
items:
3444
- name: Azure Network Security Blog
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: "Create an Arc-enabled AKS cluster in an Extended Zone"
3+
description: Learn how to creat an Arc-enabled AKS cluster in an Extended Zone.
4+
author: svaldes
5+
ms.author: svaldes
6+
ms.service: azure-extended-zones
7+
ms.topic: how-to
8+
ms.date: 05/02/2025
9+
10+
# Customer intent: As a cloud administrator and Azure Extended Zones user, I want a quick method to deploy PaaS services via Arc in an Azure Extended Zone.
11+
---
12+
13+
# Create an Arc-enabled AKS cluster in an Extended Zone
14+
15+
In this article, you'll learn how to create an Arc-enabled AKS cluster in an Extended Zone, which helps you deploy PaaS services through Arc. Refer to [What is Azure Extended Zones? | Services](/azure/extended-zones/overview#services) for currently supported PaaS workloads.
16+
17+
## Prerequisites
18+
19+
- [An Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) with an active subscription.
20+
- Access to an Extended Zone. For more information, see [Request access to an Azure Extended Zone](request-access.md).
21+
- Install the [Azure CLI](/cli/azure/install-azure-cli).
22+
- Access to a public or private container registry, such as the [Azure Container Registry](/azure/container-registry/).
23+
24+
## Getting started
25+
If you're already familiar with the subject, you may skip this paragraph. Here are important topics you may want read before you proceed with creation:
26+
- [Requirements and limitations](/azure/container-apps/azure-arc-overview) of the public preview. Of particular importance are the cluster requirements.
27+
- [Overview of Azure Arc-enabled data services](/azure/azure-arc/data/overview)
28+
- [Connectivity modes and requirements](/azure/azure-arc/data/connectivity)
29+
- [Storage configuration and Kubernetes storage concepts](/azure/azure-arc/data/storage-configuration)
30+
- [Kubernetes resource model](https://github.com/kubernetes/design-proposals-archive/blob/main/scheduling/resources.md#resource-quantities)
31+
32+
### Setup
33+
Install the following Azure CLI extensions.
34+
```powershell
35+
az extension add --name connectedk8s --upgrade --yes
36+
az extension add --name k8s-extension --upgrade --yes
37+
az extension add --name customlocation --upgrade --yes
38+
```
39+
40+
Register the required namespaces.
41+
```powershell
42+
az provider register --namespace Microsoft.ExtendedLocation --wait
43+
az provider register --namespace Microsoft.KubernetesConfiguration --wait
44+
az provider register --namespace Microsoft.App --wait
45+
az provider register --namespace Microsoft.OperationalInsights --wait
46+
```
47+
48+
### Create an Arc-enabled AKS cluster in Extended Zones
49+
50+
Before proceeding to deploy PaaS workloads in Extended Zones, an Arc-enabled AKS cluster has to be created in the target Extended Zone. The following script helps do that and ease the deployment of supported PaaS services (see related content at the end of this article to learn more about them).
51+
52+
> [!NOTE]
53+
> Make sure to keep parameters consistent and transfer them correctly from this script to any following ones.
54+
55+
```powershell
56+
# Create an Arc-enabled AKS cluster on an edge zone
57+
function createArcEnabledAksOnEz {
58+
param(
59+
[string] $SubscriptionId,
60+
[string] $AKSClusterResourceGroupName,
61+
[string] $location = "westus",
62+
[string] $AKSName,
63+
[string] $edgeZone,
64+
[int] $nodeCount = 2,
65+
[string] $vmSize = "standard_nv12ads_a10_v5",
66+
[string] $ArcResourceGroupName,
67+
[switch] $Debug
68+
)
69+
# Set the subscription
70+
az account set --subscription $SubscriptionId
71+
72+
# Login to Azure
73+
az provider register --namespace Microsoft.AzureArcData
74+
75+
# Create new resource group
76+
az group create --name $AKSClusterResourceGroupName --location $location
77+
78+
# Create new cluster and deploy in edge zone
79+
Write-Output "Creating AKS cluster in edge zone..."
80+
az aks create -g $AKSClusterResourceGroupName -n $AKSName --location $location --edge-zone $edgeZone --node-count $nodeCount -s $vmSize --generate-ssh-keys
81+
82+
# Create new resource group for Arc
83+
az group create --name $ArcResourceGroupName --location eastus
84+
85+
# Download cluster credentials and get AKS cluster context
86+
az aks get-credentials --resource-group $AKSClusterResourceGroupName --name $AKSName --overwrite-existing
87+
88+
# Connect the AKS cluster to Arc
89+
$CLUSTER_NAME = "$ArcResourceGroupName-cluster" # Name of the connected cluster resource
90+
Write-Output "Connecting AKS cluster to Azure Arc..."
91+
az connectedk8s connect --resource-group $ArcResourceGroupName --name $CLUSTER_NAME
92+
93+
# DEBUG: Test connection to Arc
94+
if ($Debug) {
95+
Write-Debug az connectedk8s show --resource-group $ArcResourceGroupName --name $CLUSTER_NAME
96+
}
97+
}
98+
99+
100+
createArcEnabledAksOnEz -SubscriptionId "ffc37441-49e9-4291-a520-0b2d4972bb99" `
101+
-AKSClusterResourceGroupName "t1" `
102+
-location "westus" `
103+
-AKSName "my-aks-cluster" `
104+
-edgeZone "losangeles" `
105+
-nodeCount 2 `
106+
-vmSize "standard_nv12ads_a10_v5" `
107+
-ArcResourceGroupName "t2"
108+
```
109+
110+
111+
## Clean up resources
112+
113+
When no longer needed, delete **my-aks-cluster** resource group and all of the resources it contains using the [az group delete](/cli/azure/group#az-group-delete) command.
114+
115+
```powershell
116+
az group delete --name my-aks-cluster
117+
```
118+
119+
## Related content
120+
121+
- [Deploy Arc-enabled workloads in an Extended Zone: ContainerApps](/azure/extended-zones/arc-enabled-workloads-container-apps)
122+
- [Deploy Arc-enabled workloads in an Extended Zone: PostgreSQL](/azure/extended-zones/arc-enabled-workloads-postgre-sql)
123+
- [Deploy Arc-enabled workloads in an Extended Zone: ManagedSQL](/azure/extended-zones/arc-enabled-workloads-managed-sql)
124+
- [Deploy an AKS cluster in an Extended Zone](deploy-aks-cluster.md)
125+
- [Deploy a storage account in an Extended Zone](create-storage-account.md)
126+
- [Frequently asked questions](faq.md)
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
---
2+
title: "Deploy Arc-enabled workloads in an Extended Zone: ContainerApps"
3+
description: Learn how to deploy arc-enabled ContainerApps in an Extended Zone.
4+
author: svaldes
5+
ms.author: svaldes
6+
ms.service: azure-extended-zones
7+
ms.topic: how-to
8+
ms.date: 05/02/2025
9+
10+
# Customer intent: As a cloud administrator and Azure Extended Zones user, I want a quick method to deploy PaaS services via Arc in an Azure Extended Zone.
11+
---
12+
13+
# Deploy Arc-enabled workloads in an Extended Zone: ContainerApps
14+
15+
In this article, you'll learn how to deploy an Arc-enabled ContainerApp in an Extended Zone. Refer to [What is Azure Extended Zones? | Services](/azure/extended-zones/overview#services) for currently supported PaaS workloads.
16+
Feel free to explore [Container Apps on Azure Arc Overview | Microsoft Learn](/azure/container-apps/azure-arc-overview) to become more familiar with Container Apps on Azure Arc.
17+
18+
## Prerequisites
19+
20+
- [An Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) with an active subscription.
21+
- Install the [Azure CLI](/cli/azure/install-azure-cli).
22+
- Access to a public or private container registry, such as the [Azure Container Registry](/azure/container-registry/).
23+
- [An Azure Arc-enabled Kubernetes cluster set up in Extended Zones](/azure/extended-zones/arc-enabled-workloads-arc-enabled-aks-cluster).
24+
> [!NOTE]
25+
> Use the intended Extended Location as your location variable.
26+
27+
## Getting started
28+
If you're already familiar with the subject, you may skip this paragraph. Here are important topics you may want read before you proceed with creation:
29+
- [Requirements and limitations](/azure/container-apps/azure-arc-overview) of the public preview. Of particular importance are the cluster requirements.
30+
- [Overview of Azure Arc-enabled data services](/azure/azure-arc/data/overview)
31+
- [Connectivity modes and requirements](/azure/azure-arc/data/connectivity)
32+
- [Storage configuration and Kubernetes storage concepts](/azure/azure-arc/data/storage-configuration)
33+
- [Kubernetes resource model](https://github.com/kubernetes/design-proposals-archive/blob/main/scheduling/resources.md#resource-quantities)
34+
35+
### Create Container Apps on Arc-enabled AKS in Extended Zones
36+
37+
Now that the Arc-enabled AKS cluster is created, we can proceed to using the following PowerShell script to create our Container App on an AKS cluster in an Extended Zone and connect it to the Azure Arc-enabled Kubernetes.
38+
39+
> [!NOTE]
40+
> Make sure to transfer the parameters from the Arc-enabled AKS steps correctly into the script.
41+
42+
```powershell
43+
# . "./CreateArcEnabledAksOnEZ.ps1"
44+
45+
# Create a container app on an AKS cluster in an edge zone and connect it to Azure Arc-enabled Kubernetes
46+
function CreateContainerAppOnArcEnabledAksEz {
47+
param(
48+
[string] $AKSClusterResourceGroupName,
49+
[string] $location = "westus",
50+
[string] $AKSName,
51+
[string] $edgeZone,
52+
[int] $nodeCount = 2,
53+
[string] $vmSize = "standard_nv12ads_a10_v5",
54+
[string] $ArcResourceGroupName,
55+
[string] $CONNECTED_ENVIRONMENT_NAME,
56+
[string] $CUSTOM_LOCATION_NAME,
57+
[string] $SubscriptionId,
58+
[string] $ACRName,
59+
[string] $imageName,
60+
[switch] $Debug
61+
)
62+
63+
try {
64+
# Set the subscription
65+
az account set --subscription $SubscriptionId
66+
67+
# Create the Arc-enabled EZ AKS cluster
68+
createArcEnabledAksOnEz -SubscriptionId $SubscriptionId -AKSClusterResourceGroupName $AKSClusterResourceGroupName -location $location -AKSName $AKSName -edgeZone $edgeZone -nodeCount $nodeCount -vmSize $vmSize -ArcResourceGroupName $ArcResourceGroupName -Debug:$Debug
69+
70+
# Install container apps extension
71+
$CLUSTER_NAME = "$ArcResourceGroupName-cluster" # Name of the connected cluster resource
72+
$EXTENSION_NAME="appenv-ext"
73+
$NAMESPACE="app-ns"
74+
az k8s-extension create `
75+
--resource-group $ArcResourceGroupName `
76+
--name $EXTENSION_NAME `
77+
--cluster-type connectedClusters `
78+
--cluster-name $CLUSTER_NAME `
79+
--extension-type 'Microsoft.App.Environment' `
80+
--release-train stable `
81+
--auto-upgrade-minor-version true `
82+
--scope cluster `
83+
--release-namespace $NAMESPACE `
84+
--configuration-settings "Microsoft.CustomLocation.ServiceAccount=default" `
85+
--configuration-settings "appsNamespace=${NAMESPACE}" `
86+
--configuration-settings "clusterName=${CONNECTED_ENVIRONMENT_NAME}" `
87+
--configuration-settings "envoy.annotations.service.beta.kubernetes.io/azure-load-balancer-resource-group=${AKSClusterResourceGroupName}"
88+
89+
# Save id property of the Container Apps extension for later
90+
$EXTENSION_ID=$(az k8s-extension show `
91+
--cluster-type connectedClusters `
92+
--cluster-name $CLUSTER_NAME `
93+
--resource-group $ArcResourceGroupName `
94+
--name $EXTENSION_NAME `
95+
--query id `
96+
--output tsv)
97+
98+
# Wait for extension to fully install before proceeding
99+
az resource wait --ids $EXTENSION_ID --custom "properties.provisioningState!='Pending'" --api-version "2020-07-01-preview"
100+
101+
$CONNECTED_CLUSTER_ID=$(az connectedk8s show --resource-group $ArcResourceGroupName --name $CLUSTER_NAME --query id --output tsv)
102+
az customlocation create `
103+
--resource-group $ArcResourceGroupName `
104+
--name $CUSTOM_LOCATION_NAME `
105+
--host-resource-id $CONNECTED_CLUSTER_ID `
106+
--namespace $NAMESPACE `
107+
--cluster-extension-ids $EXTENSION_ID
108+
109+
# DEBUG: Test custom location creation
110+
if ($Debug) {
111+
Write-Debug az customlocation show --resource-group $ArcResourceGroupName --name $CUSTOM_LOCATION_NAME
112+
}
113+
114+
# Save id property of the custom location for later
115+
$CUSTOM_LOCATION_ID=$(az customlocation show `
116+
--resource-group $ArcResourceGroupName `
117+
--name $CUSTOM_LOCATION_NAME `
118+
--query id `
119+
--output tsv)
120+
121+
# Create container Apps connected environment
122+
az containerapp connected-env create `
123+
--resource-group $ArcResourceGroupName `
124+
--name $CONNECTED_ENVIRONMENT_NAME `
125+
--custom-location $CUSTOM_LOCATION_ID `
126+
--location eastus
127+
128+
# DEBUG: validate that the connected environment is successfully created
129+
if ($Debug) {
130+
Write-Debug az containerapp connected-env show --resource-group $ArcResourceGroupName --name $CONNECTED_ENVIRONMENT_NAME
131+
}
132+
133+
# Create a new resource group for the container app
134+
$myResourceGroup="${imageName}-resource-group"
135+
az group create --name $myResourceGroup --location eastus
136+
137+
# Get the custom location id
138+
$customLocationId=$(az customlocation show --resource-group $ArcResourceGroupName --name $CUSTOM_LOCATION_NAME --query id --output tsv)
139+
140+
# Get info about the connected environment
141+
$myContainerApp="${imageName}-container-app"
142+
$myConnectedEnvironment=$(az containerapp connected-env list --custom-location $customLocationId -o tsv --query '[].id')
143+
144+
# create acr and group
145+
az group create --name $ArcResourceGroupName --location eastus
146+
az acr create --resource-group $ArcResourceGroupName --name $ACRName --sku Basic
147+
148+
# Wait for the ACR to be created
149+
Start-Sleep -Seconds 10
150+
151+
# login to acr and get login server
152+
az acr login --name $ACRName
153+
$ACRLoginServer = $(az acr show --name $ACRName --query loginServer --output tsv)
154+
155+
# DEBUG: Test ACR login
156+
if ($Debug) {
157+
Write-Debug az acr show --name $ACRName
158+
Write-Debug az acr repository list --name $ACRName --output table
159+
}
160+
161+
# Build and push docker image
162+
cd .\DemoApp
163+
docker build -t ${imageName} .
164+
docker tag ${imageName} ${ACRLoginServer}/${imageName}:latest
165+
docker push ${ACRLoginServer}/${imageName}:latest
166+
cd ..
167+
168+
# Enable admin user in ACR and get password
169+
az acr update -n $ACRName --admin-enabled true
170+
$password = $(az acr credential show --name ${ACRName} --query passwords[0].value --output tsv)
171+
172+
# Create container app
173+
az containerapp create `
174+
--resource-group $myResourceGroup `
175+
--name $myContainerApp `
176+
--environment $myConnectedEnvironment `
177+
--environment-type connected `
178+
--registry-server ${ACRLoginServer} `
179+
--registry-username ${ACRName} `
180+
--registry-password $password `
181+
--image "${ACRLoginServer}/${imageName}:latest" `
182+
--target-port 80 `
183+
--ingress 'external' `
184+
185+
# Open the container app in a browser
186+
az containerapp browse --resource-group $myResourceGroup --name $myContainerApp
187+
}
188+
catch {
189+
# Catch any error
190+
Write-Error "An error occurred"
191+
Write-Error $Error[0]
192+
}
193+
}
194+
195+
CreateContainerAppOnArcEnabledAksEz -AKSClusterResourceGroupName "my-aks-cluster-group" `
196+
-location "westus" `
197+
-AKSName "my-aks-cluster"`
198+
-edgeZone "losangeles" `
199+
-nodeCount 2 `
200+
-vmSize "standard_nv12ads_a10_v5" `
201+
-ArcResourceGroupName "myArcResourceGroup" `
202+
-CONNECTED_ENVIRONMENT_NAME "myConnectedEnvironment" `
203+
-CUSTOM_LOCATION_NAME "myCustomLocation" `
204+
-SubscriptionId "<your subscription>"`
205+
-ACRName "containerappezacr" `
206+
-imageName "myimage"
207+
```
208+
209+
210+
## Clean up resources
211+
212+
When no longer needed, delete **my-aks-cluster-group** resource group and all of the resources it contains using the [az group delete](/cli/azure/group#az-group-delete) command.
213+
214+
```powershell
215+
az group delete --name my-aks-cluster-group
216+
```
217+
218+
## Related content
219+
220+
- [Create an Arc-enabled AKS cluster in an Extended Zone](/azure/extended-zones/arc-enabled-workloads-arc-enabled-aks-cluster)
221+
- [Deploy Arc-enabled workloads in an Extended Zone: PostgreSQL](/azure/extended-zones/arc-enabled-workloads-postgre-sql)
222+
- [Deploy Arc-enabled workloads in an Extended Zone: ManagedSQL](/azure/extended-zones/arc-enabled-workloads-managed-sql)
223+
- [Deploy an AKS cluster in an Extended Zone](deploy-aks-cluster.md)
224+
- [Deploy a storage account in an Extended Zone](create-storage-account.md)
225+
- [Frequently asked questions](faq.md)

0 commit comments

Comments
 (0)