Skip to content

Commit 69182b7

Browse files
Merge pull request #3 from Azure-Samples/paolos-changes
Updated Azure AD to Microsoft Entra ID
2 parents acbff9e + 9fb19a9 commit 69182b7

6 files changed

+25
-25
lines changed

scripts/deploy-one-node-pool.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ aksResourceGroup="<AKS resource group name>"
1414
location="<Region>"
1515

1616
# Name and resource group name of the Azure Container Registry used by the AKS cluster.
17-
# The name of the cluster is also used to create or select an existing admin group in the Azure AD tenant.
17+
# The name of the cluster is also used to create or select an existing admin group in the Microsoft Entra ID tenant.
1818
acrName="<ACR name>"
1919
acrResourceGroup="<ACR resource group name>"
2020
acrSku="Basic"

scripts/deploy-two-node-pools.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ aksResourceGroupName="${aksPrefix}RG"
1717
location="WestEurope"
1818

1919
# Name and resource group name of the Azure Container Registry used by the AKS cluster.
20-
# The name of the cluster is also used to create or select an existing admin group in the Azure AD tenant.
20+
# The name of the cluster is also used to create or select an existing admin group in the Microsoft Entra ID tenant.
2121
acrName="${aksPrefix}Acr"
2222
acrResourceGroupName="$aksResourceGroupName"
2323
acrSku="Standard"
@@ -251,17 +251,17 @@ else
251251
fi
252252

253253
# Get the user principal name of the current user
254-
echo "Retrieving the user principal name of the current user from the [$tenantId] Azure AD tenant..."
254+
echo "Retrieving the user principal name of the current user from the [$tenantId] Microsoft Entra ID tenant..."
255255
userPrincipalName=$(az account show --query user.name --output tsv)
256256
if [[ -n $userPrincipalName ]]; then
257-
echo "[$userPrincipalName] user principal name successfully retrieved from the [$tenantId] Azure AD tenant"
257+
echo "[$userPrincipalName] user principal name successfully retrieved from the [$tenantId] Microsoft Entra ID tenant"
258258
else
259-
echo "Failed to retrieve the user principal name of the current user from the [$tenantId] Azure AD tenant"
259+
echo "Failed to retrieve the user principal name of the current user from the [$tenantId] Microsoft Entra ID tenant"
260260
exit
261261
fi
262262

263-
# Retrieve the objectId of the user in the Azure AD tenant used by AKS for user authentication
264-
echo "Retrieving the objectId of the [$userPrincipalName] user principal name from the [$tenantId] Azure AD tenant..."
263+
# Retrieve the objectId of the user in the Microsoft Entra ID tenant used by AKS for user authentication
264+
echo "Retrieving the objectId of the [$userPrincipalName] user principal name from the [$tenantId] Microsoft Entra ID tenant..."
265265
userObjectId=$(az ad user show --upn-or-object-id $userPrincipalName --query objectId --output tsv 2>/dev/null)
266266

267267
if [[ -n $userObjectId ]]; then
@@ -286,30 +286,30 @@ else
286286
exit
287287
fi
288288

289-
# Assign Azure Kubernetes Service RBAC Admin role to the current user
290-
echo "Checking if [$userPrincipalName] user has been assigned to [Azure Kubernetes Service RBAC Admin] role on the [$aksName] AKS cluster..."
289+
# Assign Azure Kubernetes Service RBAC Cluster Admin role to the current user
290+
echo "Checking if [$userPrincipalName] user has been assigned to [Azure Kubernetes Service RBAC Cluster Admin] role on the [$aksName] AKS cluster..."
291291
role=$(az role assignment list \
292292
--assignee $userObjectId \
293293
--scope $aksClusterId \
294294
--query [?roleDefinitionName].roleDefinitionName \
295295
--output tsv 2>/dev/null)
296296

297-
if [[ $role == "Owner" ]] || [[ $role == "Contributor" ]] || [[ $role == "Azure Kubernetes Service RBAC Admin" ]]; then
297+
if [[ $role == "Owner" ]] || [[ $role == "Contributor" ]] || [[ $role == "Azure Kubernetes Service RBAC Cluster Admin" ]]; then
298298
echo "[$userPrincipalName] user is already assigned to the [$role] role on the [$aksName] AKS cluster"
299299
else
300-
echo "[$userPrincipalName] user is not assigned to the [Azure Kubernetes Service RBAC Admin] role on the [$aksName] AKS cluster"
301-
echo "Assigning the [$userPrincipalName] user to the [Azure Kubernetes Service RBAC Admin] role on the [$aksName] AKS cluster..."
300+
echo "[$userPrincipalName] user is not assigned to the [Azure Kubernetes Service RBAC Cluster Admin] role on the [$aksName] AKS cluster"
301+
echo "Assigning the [$userPrincipalName] user to the [Azure Kubernetes Service RBAC Cluster Admin] role on the [$aksName] AKS cluster..."
302302

303303
az role assignment create \
304-
--role "Azure Kubernetes Service RBAC Admin" \
304+
--role "Azure Kubernetes Service RBAC Cluster Admin" \
305305
--assignee $userObjectId \
306306
--scope $aksClusterId \
307307
--only-show-errors 1>/dev/null
308308

309309
if [[ $? == 0 ]]; then
310-
echo "[$userPrincipalName] user successfully assigned to the [Azure Kubernetes Service RBAC Admin] role on the [$aksName] AKS cluster"
310+
echo "[$userPrincipalName] user successfully assigned to the [Azure Kubernetes Service RBAC Cluster Admin] role on the [$aksName] AKS cluster"
311311
else
312-
echo "Failed to assign the [$userPrincipalName] user to the [Azure Kubernetes Service RBAC Admin] role on the [$aksName] AKS cluster"
312+
echo "Failed to assign the [$userPrincipalName] user to the [Azure Kubernetes Service RBAC Cluster Admin] role on the [$aksName] AKS cluster"
313313
exit
314314
fi
315315
fi

templates/one-node-pool/azuredeploy.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"defaultValue": "[subscription().tenantId]",
131131
"type": "string",
132132
"metadata": {
133-
"description": "Specifies the tenant id of the Azure Active Directory used by the AKS cluster for authentication."
133+
"description": "Specifies the tenant id of the Microsoft Entra ID used by the AKS cluster for authentication."
134134
}
135135
},
136136
"aadProfileAdminGroupObjectIDs": {
@@ -374,14 +374,14 @@
374374
},
375375
"imageOffer": {
376376
"type": "string",
377-
"defaultValue": "UbuntuServer",
377+
"defaultValue": "0001-com-ubuntu-server-jammy",
378378
"metadata": {
379379
"description": "Specifies the offer of the platform image or marketplace image used to create the virtual machine."
380380
}
381381
},
382382
"imageSku": {
383383
"type": "string",
384-
"defaultValue": "18.04-LTS",
384+
"defaultValue": "22_04-lts-gen2",
385385
"metadata": {
386386
"description": "Specifies the Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version."
387387
}

templates/one-node-pool/azuredeploy.parameters.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@
8080
"value": "Canonical"
8181
},
8282
"imageOffer": {
83-
"value": "UbuntuServer"
83+
"value": "0001-com-ubuntu-server-jammy"
8484
},
8585
"imageSku": {
86-
"value": "18.04-LTS"
86+
"value": "22_04-lts-gen2"
8787
},
8888
"authenticationType": {
8989
"value": "password"

templates/two-node-pools/azuredeploy.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"defaultValue": "[subscription().tenantId]",
142142
"type": "string",
143143
"metadata": {
144-
"description": "Specifies the tenant id of the Azure Active Directory used by the AKS cluster for authentication."
144+
"description": "Specifies the tenant id of the Microsoft Entra ID used by the AKS cluster for authentication."
145145
}
146146
},
147147
"aadProfileAdminGroupObjectIDs": {
@@ -591,14 +591,14 @@
591591
},
592592
"imageOffer": {
593593
"type": "string",
594-
"defaultValue": "UbuntuServer",
594+
"defaultValue": "0001-com-ubuntu-server-jammy",
595595
"metadata": {
596596
"description": "Specifies the offer of the platform image or marketplace image used to create the virtual machine."
597597
}
598598
},
599599
"imageSku": {
600600
"type": "string",
601-
"defaultValue": "18.04-LTS",
601+
"defaultValue": "22_04-lts-gen2",
602602
"metadata": {
603603
"description": "Specifies the Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version."
604604
}

templates/two-node-pools/azuredeploy.parameters.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@
106106
"value": "Canonical"
107107
},
108108
"imageOffer": {
109-
"value": "UbuntuServer"
109+
"value": "0001-com-ubuntu-server-jammy"
110110
},
111111
"imageSku": {
112-
"value": "18.04-LTS"
112+
"value": "22_04-lts-gen2"
113113
},
114114
"authenticationType": {
115115
"value": "password"

0 commit comments

Comments
 (0)