You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Validate if the resource group name, public IP name and dns name are provided
609
675
if ([string]::IsNullOrEmpty($aksResourceGroupName)) {
610
-
Write-Host"Error: Resource Group name is null or empty."-ForegroundColor Red
676
+
Write-Host"Error: aks Resource Group name is null or empty."-ForegroundColor Red
677
+
failureBanner
611
678
exit1# Exit the script if the resource group name is missing
612
679
}
613
680
if ([string]::IsNullOrEmpty($publicIpName)) {
614
681
Write-Host"Error: Public IP name is null or empty."-ForegroundColor Red
682
+
failureBanner
615
683
exit1# Exit the script if the public IP name is missing
616
684
}
617
685
if ([string]::IsNullOrEmpty($dnsName)) {
618
686
Write-Host"Error: DNS name is null or empty."-ForegroundColor Red
687
+
failureBanner
619
688
exit1# Exit the script if the dns name is missing
620
689
}
621
690
# 6-3. Assign DNS Name to the public IP address
622
691
az network public-ip update --resource-group $aksResourceGroupName--name $publicIpName--dns-name $dnsName
623
692
624
693
# 6-4. Get FQDN for the public IP address
625
694
$fqdn= az network public-ip show --resource-group $aksResourceGroupName--name $publicIpName--query "dnsSettings.fqdn"--output tsv
626
-
627
695
# Validate if the FQDN is null or empty
628
696
if ([string]::IsNullOrEmpty($fqdn)) {
629
697
Write-Host"No FQDN is associated with the public IP address."-ForegroundColor Red
698
+
failureBanner
630
699
Exit1
631
700
} else {
632
701
Write-Host"FQDN for the public IP address is: $fqdn"-ForegroundColor Green
633
702
}
634
703
635
704
# 7. Assign the role for aks system assigned managed identity to App Configuration Data Reader role with the scope of Resourcegroup
636
705
Write-Host"Assign the role for aks system assigned managed identity to App Configuration Data Reader role"-ForegroundColor Green
706
+
# Ensure that the required fields are not null or empty
707
+
if ([string]::IsNullOrEmpty($deploymentResult.ResourceGroupName)) {
708
+
Write-Host"Error: Resource group name for AKS deployment is null or empty."-ForegroundColor Red
709
+
failureBanner
710
+
exit1
711
+
}
712
+
if ([string]::IsNullOrEmpty($deploymentResult.AksName)) {
713
+
Write-Host"Error: AKS cluster name is null or empty."-ForegroundColor Red
714
+
failureBanner
715
+
exit1
716
+
}
717
+
637
718
# Get vmss resource group name
638
719
$vmssResourceGroupName=$(az aks show --resource-group $deploymentResult.ResourceGroupName--name $deploymentResult.AksName--query nodeResourceGroup --output tsv)
720
+
721
+
# Validate if vmss Resource Group Name is null or empty
722
+
if ([string]::IsNullOrEmpty($vmssResourceGroupName)) {
723
+
Write-Host"Error: Unable to retrieve the VMSS resource group name."-ForegroundColor Red
724
+
failureBanner
725
+
exit1
726
+
}
727
+
639
728
# Get vmss name
640
729
$vmssName=$(az vmss list --resource-group $vmssResourceGroupName--query "[0].name"--output tsv)
730
+
731
+
# Validate if vmss Name is null or empty
732
+
if ([string]::IsNullOrEmpty($vmssName)) {
733
+
Write-Host"Error: Unable to retrieve the VMSS name."-ForegroundColor Red
0 commit comments