Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

-->
## Upcoming Release
* Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Bool) to `New-AzVmGalleryApplication` and `New-AzVmssGalleryApplication` cmdlets.
* Added `-Redeploy` switch parameter for `Update-AzHost` cmdlet to enable dedicated host redeployment.
* ComputeRP related cmdlets will now use 2025-04-01 version of the ComputeRP API.
* Added `-AddProxyAgentExtension` parameter (Switch) to `New-AzVmss` and `New-AzVM`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ public class NewAzureVmGalleryApplicationCommand : Microsoft.Azure.Commands.Reso
[ValidateNotNullOrEmpty]
public string ConfigReferenceId { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "If set to true, when a new Gallery Application version is available in PIR/SIG it will be automatically updated for the VM.")]
[ValidateNotNullOrEmpty]
public bool? EnableAutomaticUpgrade { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "If set to true, any failure for any operation in the VmApplication will fail the deployment.")]
[ValidateNotNullOrEmpty]
public bool? TreatFailureAsDeploymentFailure { get; set; }

public override void ExecuteCmdlet()
{

Expand All @@ -47,6 +59,14 @@ public override void ExecuteCmdlet()
{
vmGal.ConfigurationReference = this.ConfigReferenceId;
}
if (this.IsParameterBound(c => c.EnableAutomaticUpgrade))
{
vmGal.EnableAutomaticUpgrade = this.EnableAutomaticUpgrade;
}
if (this.IsParameterBound(c => c.TreatFailureAsDeploymentFailure))
{
vmGal.TreatFailureAsDeploymentFailure = this.TreatFailureAsDeploymentFailure;
}

WriteObject(vmGal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ public class NewAzureVmssGalleryApplicationCommand : Microsoft.Azure.Commands.Re
[ValidateNotNullOrEmpty]
public string ConfigReferenceId { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "If set to true, when a new Gallery Application version is available in PIR/SIG it will be automatically updated for the VM.")]
[ValidateNotNullOrEmpty]
public bool? EnableAutomaticUpgrade { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "If set to true, any failure for any operation in the VmApplication will fail the deployment.")]
[ValidateNotNullOrEmpty]
public bool? TreatFailureAsDeploymentFailure { get; set; }

public override void ExecuteCmdlet()
{

Expand All @@ -47,6 +59,16 @@ public override void ExecuteCmdlet()
vmGal.ConfigurationReference = this.ConfigReferenceId;
}

if (this.IsParameterBound(c => c.EnableAutomaticUpgrade))
{
vmGal.EnableAutomaticUpgrade = this.EnableAutomaticUpgrade;
}

if (this.IsParameterBound(c => c.TreatFailureAsDeploymentFailure))
{
vmGal.TreatFailureAsDeploymentFailure = this.TreatFailureAsDeploymentFailure;
}

WriteObject(vmGal);
}
}
Expand Down
32 changes: 32 additions & 0 deletions src/Compute/Compute/help/New-AzVmGalleryApplication.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Create a local PSVMGalleryApplication object.

```
New-AzVmGalleryApplication -PackageReferenceId <String> [-ConfigReferenceId <String>]
[-EnableAutomaticUpgrade <Bool>] [-TreatFailureAsDeploymentFailure <Bool>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand All @@ -27,6 +28,7 @@ Creates a local PSVMGalleryApplication object.
```powershell
$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
$vmGal = New-AzVmGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
-EnableAutomaticUpgrade $true -TreatFailureAsDeploymentFailure $true
Add-AzVmGalleryApplication -VM $vm -GalleryApplication $vmGal -Order 1
```

Expand Down Expand Up @@ -79,6 +81,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableAutomaticUpgrade
Specifies whether the underlying VMSS should automatically update when a new version of the Gallery Application becomes available in the Public Image Repository (PIR) or Shared Image Gallery (SIG).

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

### -TreatFailureAsDeploymentFailure
Determines whether a failure encountered during the application process should be treated as a deployment failure.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

### -Confirm
Prompts you for confirmation before running the cmdlet.

Expand Down
32 changes: 32 additions & 0 deletions src/Compute/Compute/help/New-AzVmssGalleryApplication.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Create a local PSVMGalleryApplication object.

```
New-AzVmssGalleryApplication -PackageReferenceId <String> [-ConfigReferenceId <String>]
[-EnableAutomaticUpgrade <Bool>] [-TreatFailureAsDeploymentFailure <Bool>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand All @@ -27,6 +28,7 @@ Creates a local PSVMGalleryApplication object.
```powershell
$vmss = Get-AzVmss -ResourceGroupName $rgName -Name $vmssName
$vmGal = New-AzVmssGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
-EnableAutomaticUpgrade $true -TreatFailureAsDeploymentFailure $true
Add-AzVmssGalleryApplication -VirtualMachineScaleSetVM $vmss.VirtualMachineProfile -GalleryApplication $vmGal -Order 1
```

Expand Down Expand Up @@ -79,6 +81,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableAutomaticUpgrade
Specifies whether the underlying VMSS should automatically update when a new version of the Gallery Application becomes available in the Public Image Repository (PIR) or Shared Image Gallery (SIG).

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

### -TreatFailureAsDeploymentFailure
Determines whether a failure encountered during the application process should be treated as a deployment failure.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

### -Confirm
Prompts you for confirmation before running the cmdlet.

Expand Down
Loading