<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Powershell &#8211; abdulrahmanuk.com</title>
	<atom:link href="https://www.abdulrahmanuk.com/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.abdulrahmanuk.com</link>
	<description>All about Cloud and DevOps</description>
	<lastBuildDate>Mon, 23 Jun 2025 01:28:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.abdulrahmanuk.com/wp-content/uploads/2023/02/icons8-devops-60.png</url>
	<title>Powershell &#8211; abdulrahmanuk.com</title>
	<link>https://www.abdulrahmanuk.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Create an AKS Cluster Using PowerShell in Azure Portal</title>
		<link>https://www.abdulrahmanuk.com/how-to-create-an-aks-cluster-using-powershell-in-azure-portal/</link>
					<comments>https://www.abdulrahmanuk.com/how-to-create-an-aks-cluster-using-powershell-in-azure-portal/#respond</comments>
		
		<dc:creator><![CDATA[Abdul Rahman UK]]></dc:creator>
		<pubDate>Mon, 23 Jun 2025 01:20:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://www.abdulrahmanuk.com/?p=566</guid>

					<description><![CDATA[<p>In today’s DevOps-driven world, Kubernetes has become the cornerstone of modern cloud-native applications. Microsoft Azure provides a fully managed Kubernetes service called Azure Kubernetes Service (AKS), which helps you focus on deploying and managing containerized applications without worrying about the underlying infrastructure. In this guide, we’ll walk you through how to create an AKS cluster [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.abdulrahmanuk.com/how-to-create-an-aks-cluster-using-powershell-in-azure-portal/">How to Create an AKS Cluster Using PowerShell in Azure Portal</a> appeared first on <a rel="nofollow" href="https://www.abdulrahmanuk.com">abdulrahmanuk.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In today’s DevOps-driven world, Kubernetes has become the cornerstone of modern cloud-native applications. Microsoft Azure provides a fully managed Kubernetes service called <strong>Azure Kubernetes Service (AKS)</strong>, which helps you focus on deploying and managing containerized applications without worrying about the underlying infrastructure.</p>



<p>In this guide, we’ll walk you through <strong>how to create an AKS cluster using PowerShell directly from the Azure Cloud Shell or your local PowerShell session</strong>. Whether you’re getting started or automating cluster provisioning, this tutorial will provide a clear, step-by-step approach.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1858" height="994" src="https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2.png" alt="image 2" class="wp-image-568" title="How to Create an AKS Cluster Using PowerShell in Azure Portal 1" srcset="https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2.png 1858w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-768x411.png 768w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-1536x822.png 1536w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-150x80.png 150w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-300x160.png 300w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-696x372.png 696w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-1068x571.png 1068w, https://www.abdulrahmanuk.com/wp-content/uploads/2025/06/image-2-600x321.png 600w" sizes="(max-width: 1858px) 100vw, 1858px" /></figure>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Prerequisites</h3>



<p>Before we begin, make sure you have the following:</p>



<ul class="wp-block-list">
<li>An active <a class="" href="https://portal.azure.com/" rel="nofollow noopener" target="_blank">Azure subscription</a></li>



<li>Azure PowerShell installed locally <strong>or</strong> use <a class="" href="https://shell.azure.com/" rel="nofollow noopener" target="_blank">Azure Cloud Shell</a></li>



<li>Azure CLI is optional but recommended for verification</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 1: Log in to the Azure Account</h2>



<p>Open PowerShell and log in to your Azure account.</p>



<pre class="wp-block-code"><code><code>Connect-AzAccount
</code></code></pre>



<p>This command opens a sign-in window or browser-based prompt to authenticate your account.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4c1.png" alt="📁" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 2: Set Your Subscription (If You Have Multiple)</h2>



<pre class="wp-block-code"><code><code>Get-AzSubscription
Set-AzContext -SubscriptionId "your-subscription-id"
</code></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3d7.png" alt="🏗" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 3: Create a Resource Group</h2>



<p>A resource group is a container that holds related resources for an Azure solution.</p>



<pre class="wp-block-code"><code><code>$resourceGroup = "AKS-ResourceGroup"
$location = "EastUS"

New-AzResourceGroup -Name $resourceGroup -Location $location
</code></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f6e1.png" alt="🛡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 4: Create an Azure AD Service Principal (Optional but recommended)</h2>



<p>This account will be used by AKS to interact with Azure resources.</p>



<pre class="wp-block-code"><code><code>$sp = New-AzADServicePrincipal -DisplayName "AKSServicePrincipal"
$spPassword = (New-AzADSpCredential -ServicePrincipalObjectId $sp.Id).SecretText
</code></code></pre>



<p>Store the AppId and Password for later use.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 5: Create the AKS Cluster</h2>



<pre class="wp-block-code"><code><code>$aksName = "MyAKSCluster"

New-AzAksCluster `
  -ResourceGroupName $resourceGroup `
  -Name $aksName `
  -KubernetesVersion "1.29.2" `
  -NodeCount 3 `
  -NodeVmSize "Standard_DS2_v2" `
  -GenerateSshKey `
  -Location $location `
  -EnableRBAC
</code></code></pre>



<p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> You can specify additional parameters such as <code>-ServicePrincipalId</code>, <code>-ClientSecret</code>, or <code>-NetworkPlugin azure</code> For more custom setups.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50d.png" alt="🔍" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 6: Verify the Cluster</h2>



<p>After creation, verify the AKS cluster status:</p>



<pre class="wp-block-code"><code><code>Get-AzAksCluster -ResourceGroupName $resourceGroup -Name $aksName
</code></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4e6.png" alt="📦" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step 7: Connect to the AKS Cluster Using <code>kubectl</code></h2>



<p>First, install <code>kubectl</code> if you haven&#8217;t already:</p>



<pre class="wp-block-code"><code><code>az aks install-cli
</code></code></pre>



<p>Then, get credentials:</p>



<pre class="wp-block-code"><code><code>az aks get-credentials --resource-group $resourceGroup --name $aksName
</code></code></pre>



<p>Verify connection:</p>



<pre class="wp-block-code"><code><code>kubectl get nodes
</code></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Wrapping Up</h2>



<p>You’ve successfully created an <strong>AKS Cluster using PowerShell</strong> on Microsoft Azure! This process is ideal for automating infrastructure deployment.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Bonus Tips</h2>



<ul class="wp-block-list">
<li>Use Azure Bicep or Terraform for infrastructure-as-code.</li>



<li>Integrate Azure Key Vault and Managed Identity for secure secrets management.</li>



<li>Enable monitoring with Azure Monitor and Log Analytics for production workloads.</li>
</ul>
<p>The post <a rel="nofollow" href="https://www.abdulrahmanuk.com/how-to-create-an-aks-cluster-using-powershell-in-azure-portal/">How to Create an AKS Cluster Using PowerShell in Azure Portal</a> appeared first on <a rel="nofollow" href="https://www.abdulrahmanuk.com">abdulrahmanuk.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.abdulrahmanuk.com/how-to-create-an-aks-cluster-using-powershell-in-azure-portal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
