Skip to content

Commit ff1bc90

Browse files
committed
Added -EnableAutomaticUpgrade + -TreatFailureAsDeploymentFailure to New Az-VmGalleryApp + New Az-VmssGalleryApp and updated Changelog/Help Docs
1 parent d2759c2 commit ff1bc90

File tree

5 files changed

+107
-0
lines changed

5 files changed

+107
-0
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Bool) to `New-AzVmGalleryApplication` and `New-AzVmssGalleryApplication` cmdlets.
2324
* Added `-Redeploy` switch parameter for `Update-AzHost` cmdlet to enable dedicated host redeployment.
2425
* ComputeRP related cmdlets will now use 2025-04-01 version of the ComputeRP API.
2526
* Added `-AddProxyAgentExtension` parameter (Switch) to `New-AzVmss` and `New-AzVM`

src/Compute/Compute/Generated/Gallery/NewAzureVmGalleryApplicationCommand.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ public class NewAzureVmGalleryApplicationCommand : Microsoft.Azure.Commands.Reso
3838
[ValidateNotNullOrEmpty]
3939
public string ConfigReferenceId { get; set; }
4040

41+
[Parameter(
42+
Mandatory = false,
43+
HelpMessage = "If set to true, when a new Gallery Application version is available in PIR/SIG it will be automatically updated for the VM.")]
44+
[ValidateNotNullOrEmpty]
45+
public bool? EnableAutomaticUpgrade { get; set; }
46+
47+
[Parameter(
48+
Mandatory = false,
49+
HelpMessage = "If set to true, any failure for any operation in the VmApplication will fail the deployment.")]
50+
[ValidateNotNullOrEmpty]
51+
public bool? TreatFailureAsDeploymentFailure { get; set; }
52+
4153
public override void ExecuteCmdlet()
4254
{
4355

@@ -47,6 +59,14 @@ public override void ExecuteCmdlet()
4759
{
4860
vmGal.ConfigurationReference = this.ConfigReferenceId;
4961
}
62+
if (this.IsParameterBound(c => c.EnableAutomaticUpgrade))
63+
{
64+
vmGal.EnableAutomaticUpgrade = this.EnableAutomaticUpgrade;
65+
}
66+
if (this.IsParameterBound(c => c.TreatFailureAsDeploymentFailure))
67+
{
68+
vmGal.TreatFailureAsDeploymentFailure = this.TreatFailureAsDeploymentFailure;
69+
}
5070

5171
WriteObject(vmGal);
5272
}

src/Compute/Compute/Generated/Gallery/NewAzureVmssGalleryApplicationCommand.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ public class NewAzureVmssGalleryApplicationCommand : Microsoft.Azure.Commands.Re
3737
[ValidateNotNullOrEmpty]
3838
public string ConfigReferenceId { get; set; }
3939

40+
[Parameter(
41+
Mandatory = false,
42+
HelpMessage = "If set to true, when a new Gallery Application version is available in PIR/SIG it will be automatically updated for the VM.")]
43+
[ValidateNotNullOrEmpty]
44+
public bool? EnableAutomaticUpgrade { get; set; }
45+
46+
[Parameter(
47+
Mandatory = false,
48+
HelpMessage = "If set to true, any failure for any operation in the VmApplication will fail the deployment.")]
49+
[ValidateNotNullOrEmpty]
50+
public bool? TreatFailureAsDeploymentFailure { get; set; }
51+
4052
public override void ExecuteCmdlet()
4153
{
4254

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

62+
if (this.IsParameterBound(c => c.EnableAutomaticUpgrade))
63+
{
64+
vmGal.EnableAutomaticUpgrade = this.EnableAutomaticUpgrade;
65+
}
66+
67+
if (this.IsParameterBound(c => c.TreatFailureAsDeploymentFailure))
68+
{
69+
vmGal.TreatFailureAsDeploymentFailure = this.TreatFailureAsDeploymentFailure;
70+
}
71+
5072
WriteObject(vmGal);
5173
}
5274
}

src/Compute/Compute/help/New-AzVmGalleryApplication.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Create a local PSVMGalleryApplication object.
1414

1515
```
1616
New-AzVmGalleryApplication -PackageReferenceId <String> [-ConfigReferenceId <String>]
17+
[-EnableAutomaticUpgrade <Bool>] [-TreatFailureAsDeploymentFailure <Bool>]
1718
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
1819
[<CommonParameters>]
1920
```
@@ -27,6 +28,7 @@ Creates a local PSVMGalleryApplication object.
2728
```powershell
2829
$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
2930
$vmGal = New-AzVmGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
31+
-EnableAutomaticUpgrade $true -TreatFailureAsDeploymentFailure $true
3032
Add-AzVmGalleryApplication -VM $vm -GalleryApplication $vmGal -Order 1
3133
```
3234

@@ -79,6 +81,36 @@ Accept pipeline input: False
7981
Accept wildcard characters: False
8082
```
8183
84+
### -EnableAutomaticUpgrade
85+
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).
86+
87+
```yaml
88+
Type: System.String
89+
Parameter Sets: (All)
90+
Aliases:
91+
92+
Required: False
93+
Position: Named
94+
Default value: None
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
99+
### -TreatFailureAsDeploymentFailure
100+
Determines whether a failure encountered during the application process should be treated as a deployment failure.
101+
102+
```yaml
103+
Type: System.String
104+
Parameter Sets: (All)
105+
Aliases:
106+
107+
Required: False
108+
Position: Named
109+
Default value: None
110+
Accept pipeline input: False
111+
Accept wildcard characters: False
112+
```
113+
82114
### -Confirm
83115
Prompts you for confirmation before running the cmdlet.
84116

src/Compute/Compute/help/New-AzVmssGalleryApplication.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Create a local PSVMGalleryApplication object.
1414

1515
```
1616
New-AzVmssGalleryApplication -PackageReferenceId <String> [-ConfigReferenceId <String>]
17+
[-EnableAutomaticUpgrade <Bool>] [-TreatFailureAsDeploymentFailure <Bool>]
1718
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
1819
[<CommonParameters>]
1920
```
@@ -27,6 +28,7 @@ Creates a local PSVMGalleryApplication object.
2728
```powershell
2829
$vmss = Get-AzVmss -ResourceGroupName $rgName -Name $vmssName
2930
$vmGal = New-AzVmssGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
31+
-EnableAutomaticUpgrade $true -TreatFailureAsDeploymentFailure $true
3032
Add-AzVmssGalleryApplication -VirtualMachineScaleSetVM $vmss.VirtualMachineProfile -GalleryApplication $vmGal -Order 1
3133
```
3234

@@ -79,6 +81,36 @@ Accept pipeline input: False
7981
Accept wildcard characters: False
8082
```
8183
84+
### -EnableAutomaticUpgrade
85+
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).
86+
87+
```yaml
88+
Type: System.String
89+
Parameter Sets: (All)
90+
Aliases:
91+
92+
Required: False
93+
Position: Named
94+
Default value: None
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
99+
### -TreatFailureAsDeploymentFailure
100+
Determines whether a failure encountered during the application process should be treated as a deployment failure.
101+
102+
```yaml
103+
Type: System.String
104+
Parameter Sets: (All)
105+
Aliases:
106+
107+
Required: False
108+
Position: Named
109+
Default value: None
110+
Accept pipeline input: False
111+
Accept wildcard characters: False
112+
```
113+
82114
### -Confirm
83115
Prompts you for confirmation before running the cmdlet.
84116

0 commit comments

Comments
 (0)