Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Aks/Aks/Az.Aks.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.Aks.dll')
FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = 'Get-AzAks', 'New-AzAks', 'Remove-AzAks', 'Import-AzAksCredential',
'Start-AzAksDashboard', 'Stop-AzAksDashboard', 'Set-AzAks',
CmdletsToExport = 'Get-AzAksCluster', 'New-AzAksCluster', 'Remove-AzAksCluster', 'Import-AzAksCredential',
'Start-AzAksDashboard', 'Stop-AzAksDashboard', 'Set-AzAksCluster',
'New-AzAksNodePool', 'Update-AzAksNodePool', 'Remove-AzAksNodePool',
'Get-AzAksNodePool', 'Install-AzAksKubectl', 'Get-AzAksVersion'

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
AliasesToExport = @('Get-AzAks', 'New-AzAks', 'Remove-AzAks', 'Set-AzAks')

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
2 changes: 2 additions & 0 deletions src/Aks/Aks/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Removed `ClientIdAndSecret` to `ServicePrincipalIdAndSecret` and set `ClientIdAndSecret` as an alias [#12381].
* Removed `Get-AzAks`/`New-AzAks`/`Remove-AzAks`/`Set-AzAks` to `Get-AzAksCluster`/`New-AzAksCluster`/`Remove-AzAksCluster`/`Set-AzAksCluster` and set the original ones as alias [#12373].

## Version 1.1.3
* Fixed bug `Get-AzAks` doesn't get all clusters [#12296]
Expand Down
7 changes: 5 additions & 2 deletions src/Aks/Aks/Commands/CreateOrUpdateKubeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Rest.Azure.OData;
using Microsoft.Azure.Management.Internal.Resources.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.Aks
{
Expand Down Expand Up @@ -69,7 +70,9 @@ public abstract class CreateOrUpdateKubeBase : KubeCmdletBase
Mandatory = false,
ParameterSetName = DefaultParamSet,
HelpMessage = "The client id and client secret associated with the AAD application / service principal.")]
public PSCredential ClientIdAndSecret { get; set; }
[Alias("ClientIdAndSecret")]
[CmdletParameterBreakingChange("ClientIdAndSecret", ReplaceMentCmdletParameterName = "ServicePrincipalIdAndSecret")]
public PSCredential ServicePrincipalIdAndSecret { get; set; }

[Parameter(Mandatory = false,
HelpMessage = "Azure location for the cluster. Defaults to the location of the resource group.")]
Expand Down Expand Up @@ -149,7 +152,7 @@ protected virtual ManagedCluster BuildNewCluster()
new ContainerServiceLinuxProfile(LinuxProfileAdminUserName,
new ContainerServiceSshConfiguration(pubKey));

var acsServicePrincipal = EnsureServicePrincipal(ClientIdAndSecret?.UserName, ClientIdAndSecret?.Password?.ToString());
var acsServicePrincipal = EnsureServicePrincipal(ServicePrincipalIdAndSecret?.UserName, ServicePrincipalIdAndSecret?.Password?.ToString());

var spProfile = new ManagedClusterServicePrincipalProfile(
acsServicePrincipal.SpId,
Expand Down
5 changes: 4 additions & 1 deletion src/Aks/Aks/Commands/GetAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.ContainerService;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.Aks
{
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks", DefaultParameterSetName = ResourceGroupParameterSet)]
[CmdletDeprecation(ReplacementCmdletName = "Get-AzAksCluster")]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AksCluster", DefaultParameterSetName = ResourceGroupParameterSet)]
[Alias("Get-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks")]
[OutputType(typeof(PSKubernetesCluster))]
public class GetAzureRmAks : KubeCmdletBase
{
Expand Down
5 changes: 4 additions & 1 deletion src/Aks/Aks/Commands/NewAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
using Microsoft.Azure.Commands.Aks.Models;
using Microsoft.Azure.Commands.Aks.Properties;
using Microsoft.Azure.Management.ContainerService;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.Azure.Commands.Aks
{
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks", DefaultParameterSetName = DefaultParamSet, SupportsShouldProcess = true)]
[CmdletDeprecation(ReplacementCmdletName = "New-AzAksCluster")]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AksCluster", DefaultParameterSetName = DefaultParamSet, SupportsShouldProcess = true)]
[Alias("New-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks")]
[OutputType(typeof(PSKubernetesCluster))]
public class NewAzureRmAks : NewKubeBase
{
Expand Down
2 changes: 1 addition & 1 deletion src/Aks/Aks/Commands/NewKubeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected override ManagedCluster BuildNewCluster()
new ContainerServiceLinuxProfile(LinuxProfileAdminUserName,
new ContainerServiceSshConfiguration(pubKey));

var acsServicePrincipal = EnsureServicePrincipal(ClientIdAndSecret?.UserName, ClientIdAndSecret?.Password?.ToString());
var acsServicePrincipal = EnsureServicePrincipal(ServicePrincipalIdAndSecret?.UserName, ServicePrincipalIdAndSecret?.Password?.ToString());

var spProfile = new ManagedClusterServicePrincipalProfile(
acsServicePrincipal.SpId,
Expand Down
5 changes: 4 additions & 1 deletion src/Aks/Aks/Commands/RemoveAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.ContainerService;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.Aks
{
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks", SupportsShouldProcess = true, DefaultParameterSetName = GroupNameParameterSet)]
[CmdletDeprecation(ReplacementCmdletName = "Remove-AzAksCluster")]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AksCluster", SupportsShouldProcess = true, DefaultParameterSetName = GroupNameParameterSet)]
[Alias("Remove-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks")]
[OutputType(typeof(bool))]
public class RemoveAzureRmAks : KubeCmdletBase
{
Expand Down
9 changes: 6 additions & 3 deletions src/Aks/Aks/Commands/SetAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
using Microsoft.Azure.Management.ContainerService;
using Microsoft.Azure.Management.ContainerService.Models;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.Azure.Commands.Aks
{
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks", DefaultParameterSetName = DefaultParamSet, SupportsShouldProcess = true)]
[CmdletDeprecation(ReplacementCmdletName = "Set-AzAksCluster")]
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AksCluster", DefaultParameterSetName = DefaultParamSet, SupportsShouldProcess = true)]
[Alias("Set-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Aks")]
[OutputType(typeof(PSKubernetesCluster))]
public class SetAzureRmAks : CreateOrUpdateKubeBase
{
Expand Down Expand Up @@ -108,10 +111,10 @@ public override void ExecuteCmdlet()
new ContainerServiceSshPublicKey(GetSshKey(SshKeyValue))
};
}
if (this.IsParameterBound(c => c.ClientIdAndSecret))
if (this.IsParameterBound(c => c.ServicePrincipalIdAndSecret))
{
WriteVerbose(Resources.UpdatingServicePrincipal);
var acsServicePrincipal = EnsureServicePrincipal(ClientIdAndSecret.UserName, ClientIdAndSecret.Password.ToString());
var acsServicePrincipal = EnsureServicePrincipal(ServicePrincipalIdAndSecret.UserName, ServicePrincipalIdAndSecret.Password.ToString());

var spProfile = new ManagedClusterServicePrincipalProfile(
acsServicePrincipal.SpId,
Expand Down
9 changes: 4 additions & 5 deletions src/Aks/Aks/help/Az.Aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Locale: en-US
Commands to interact with Azure managed Kubernetes clusters.

## Az.Aks Cmdlets
### [Get-AzAks](Get-AzAks.md)
### [Get-AzAksCluster](Get-AzAksCluster.md)
List Kubernetes managed clusters.

### [Get-AzAksNodePool](Get-AzAksNodePool.md)
Expand All @@ -26,19 +26,19 @@ Import and merge Kubectl config for a managed Kubernetes Cluster.
### [Install-AzAksKubectl](Install-AzAksKubectl.md)
Download and install kubectl, the Kubernetes command-line tool.

### [New-AzAks](New-AzAks.md)
### [New-AzAksCluster](New-AzAksCluster.md)
Create a new managed Kubernetes cluster.

### [New-AzAksNodePool](New-AzAksNodePool.md)
Create a new node pool in specified cluster.

### [Remove-AzAks](Remove-AzAks.md)
### [Remove-AzAksCluster](Remove-AzAksCluster.md)
Delete a managed Kubernetes cluster.

### [Remove-AzAksNodePool](Remove-AzAksNodePool.md)
Delete node pool from managed cluster.

### [Set-AzAks](Set-AzAks.md)
### [Set-AzAksCluster](Set-AzAksCluster.md)
Update or create a managed Kubernetes cluster.

### [Start-AzAksDashboard](Start-AzAksDashboard.md)
Expand All @@ -49,4 +49,3 @@ Stop the Kubectl SSH tunnel created in Start-AzKubernetesDashboard.

### [Update-AzAksNodePool](Update-AzAksNodePool.md)
Update node pool in a managed cluster.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.Aks.dll-Help.xml
Module Name: Az.Aks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/get-azaks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/get-azakscluster
schema: 2.0.0
---

# Get-AzAks
# Get-AzAksCluster

## SYNOPSIS
List Kubernetes managed clusters.
Expand All @@ -14,17 +14,18 @@ List Kubernetes managed clusters.

### ResourceGroupParameterSet (Default)
```
Get-AzAks [[-ResourceGroupName] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Get-AzAksCluster [[-ResourceGroupName] <String>] [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

### IdParameterSet
```
Get-AzAks [-Id] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Get-AzAksCluster [-Id] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### NameParameterSet
```
Get-AzAks [-ResourceGroupName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>]
Get-AzAksCluster [-ResourceGroupName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

Expand All @@ -34,8 +35,8 @@ List Kubernetes managed clusters.
## EXAMPLES

### List all Kubernetes clusters
```
PS C:\> Get-AzAks
```powershell
PS C:\> Get-AzAksCluster
```

## PARAMETERS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.Aks.dll-Help.xml
Module Name: Az.Aks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/new-azaks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/new-azakscluster
schema: 2.0.0
---

# New-AzAks
# New-AzAksCluster

## SYNOPSIS
Create a new managed Kubernetes cluster.

## SYNTAX

```
New-AzAks [-Force] [-NodeVmSetType <String>] [-NodeVnetSubnetID <String>] [-NodeMaxPodCount <Int32>]
New-AzAksCluster [-Force] [-NodeVmSetType <String>] [-NodeVnetSubnetID <String>] [-NodeMaxPodCount <Int32>]
[-NodeOsType <String>] [-NodeSetPriority <String>] [-NodeScaleSetEvictionPolicy <String>]
[-AcrNameToAttach <String>] [-EnableRbac] [-WindowsProfileAdminUserName <String>]
[-WindowsProfileAdminUserPassword <SecureString>] [-NetworkPlugin <String>] [-LoadBalancerSku <String>]
[-ResourceGroupName] <String> [-Name] <String> [[-ClientIdAndSecret] <PSCredential>] [-Location <String>]
[-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>] [-KubernetesVersion <String>]
[-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>] [-EnableNodeAutoScaling]
[-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>] [-SshKeyValue <String>] [-AsJob]
[-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-ResourceGroupName] <String> [-Name] <String> [[-ServicePrincipalIdAndSecret] <PSCredential>]
[-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
[-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>]
[-SshKeyValue <String>] [-AsJob] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -32,15 +33,15 @@ Create a new Azure Kubernetes Service(AKS) cluster.

### New an AKS with default params.

```
```powershell
PS C:\> New-AzAks -ResourceGroupName myResourceGroup -Name myCluster
```

### Create Windows Server container on an AKS.
To create Windows Server container on an AKS, you must specify at least four following parameters when creating the AKS, and the value for `NetworkPlugin` and `NodeVmSetType` must be `azure` and `VirtualMachineScaleSets` respectively.
`-WindowsProfileAdminUserName *** -WindowsProfileAdminUserPassword *** -NetworkPlugin azure -NodeVmSetType VirtualMachineScaleSets`

```
```powershell
PS C:\> $cred = ConvertTo-SecureString -AsPlainText "Password!!123" -Force
PS C:\> New-AzAks -ResourceGroupName myResourceGroup -Name myCluster -WindowsProfileAdminUserName azureuser -WindowsProfileAdminUserPassword $cred -NetworkPlugin azure -NodeVmSetType VirtualMachineScaleSets
PS C:\> New-AzAksNodePool -ResourceGroupName myResourceGroup -ClusterName myCluster -Name win1 -OsType Windows -VmSetType VirtualMachineScaleSets
Expand Down Expand Up @@ -78,21 +79,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ClientIdAndSecret
The client id and client secret associated with the AAD application / service principal.

```yaml
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.

Expand Down Expand Up @@ -454,6 +440,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ServicePrincipalIdAndSecret
The client id and client secret associated with the AAD application / service principal.

```yaml
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases: ClientIdAndSecret

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SshKeyValue
SSH key file value or key file path.
Defaults to {HOME}/.ssh/id_rsa.pub.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.Aks.dll-Help.xml
Module Name: Az.Aks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/remove-azaks
online version: https://docs.microsoft.com/en-us/powershell/module/az.aks/remove-azakscluster
schema: 2.0.0
---

# Remove-AzAks
# Remove-AzAksCluster

## SYNOPSIS
Delete a managed Kubernetes cluster.
Expand All @@ -14,20 +14,20 @@ Delete a managed Kubernetes cluster.

### GroupNameParameterSet (Default)
```
Remove-AzAks [-ResourceGroupName] <String> [-Name] <String> [-PassThru] [-AsJob] [-Force]
Remove-AzAksCluster [-ResourceGroupName] <String> [-Name] <String> [-PassThru] [-AsJob] [-Force]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### InputObjectParameterSet
```
Remove-AzAks -InputObject <PSKubernetesCluster> [-PassThru] [-AsJob] [-Force]
Remove-AzAksCluster -InputObject <PSKubernetesCluster> [-PassThru] [-AsJob] [-Force]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### IdParameterSet
```
Remove-AzAks [-Id] <String> [-PassThru] [-AsJob] [-Force] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Remove-AzAksCluster [-Id] <String> [-PassThru] [-AsJob] [-Force] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -36,7 +36,7 @@ Delete a managed Kubernetes cluster.
## EXAMPLES

### Delete an existing managed Kubernetes cluster
```
```powershell
PS C:\> Remove-AzAks -ResourceGroupName group -Name myCluster
```

Expand Down
Loading