Skip to content

Commit 1f4dfd8

Browse files
committed
Update VMSS models/NewAZVMss to include APAE, Update Set Configs for VM + VMSS for APAE
1 parent 4814eef commit 1f4dfd8

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

src/Compute/Compute/Generated/VirtualMachineScaleSet/Config/SetAzVmssProxyAgentSetting.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ public class SetAzureVmssProxySetting : Microsoft.Azure.Commands.ResourceManager
6969
HelpMessage = "Specifies the InVMAccessControlProfileVersion resource id in the IMDS enpoint. Format of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}")]
7070
public string ImdsProfile { get; set; }
7171

72+
[Parameter(
73+
Mandatory = false,
74+
ValueFromPipelineByPropertyName = true,
75+
HelpMessage = "Specifies whether to add installation of the ProxyAgent extension.")]
76+
public bool? AddProxyAgentExtension { get; set; }
77+
7278
public override void ExecuteCmdlet()
7379
{
7480
if (this.VirtualMachineScaleSet.VirtualMachineProfile == null)
@@ -96,6 +102,11 @@ public override void ExecuteCmdlet()
96102
})
97103
};
98104

105+
if (this.IsParameterBound(c => c.AddProxyAgentExtension))
106+
{
107+
this.VirtualMachineScaleSet.VirtualMachineProfile.SecurityProfile.ProxyAgentSettings.AddProxyAgentExtension = this.AddProxyAgentExtension;
108+
}
109+
99110
WriteObject(this.VirtualMachineScaleSet);
100111
}
101112
}

src/Compute/Compute/Manual/PSVirtualMachineScaleSetVMProfile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ public class PSVirtualMachineScaleSetVMProfile
4141
public PSApplicationProfile ApplicationProfile { get; set; }
4242
public SecurityPostureReference SecurityPostureReference { get; set; }
4343
public System.DateTime? TimeCreated { get; private set; }
44+
public bool? AddProxyAgentExtension { get; set; }
4445
}
4546
}

src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ public partial class NewAzureRmVmss : ComputeAutomationBaseCmdlet
292292
HelpMessage = "Specifies whether Metadata Security Protocol(ProxyAgent) feature should be enabled or not.")]
293293
public SwitchParameter EnableProxyAgent { get; set; }
294294

295+
[Parameter(
296+
Mandatory = false,
297+
ValueFromPipelineByPropertyName = true,
298+
ParameterSetName = SimpleParameterSet,
299+
HelpMessage = "Specifies whether to add installation of the ProxyAgent extension.")]
300+
public SwitchParameter AddProxyAgentExtension { get; set; }
301+
295302
private void ConfigureSecuritySettings()
296303
{
297304
if (SecurityType?.ToLower() == SecurityTypes.TrustedLaunch ||

src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
252252
string ifNoneMatch = null,
253253
string securityPostureId = null,
254254
string[] securityPostureExcludeExtension = null,
255-
bool? enableProxyAgent = null
255+
bool? enableProxyAgent = null,
256+
bool? addProxyAgentExtension = null,
256257
)
257258
=> Strategy.CreateResourceConfig(
258259
resourceGroup: resourceGroup,
@@ -285,7 +286,7 @@ internal static ResourceConfig<VirtualMachineScaleSet> CreateVirtualMachineScale
285286
EncryptionAtHost = encryptionAtHost,
286287
UefiSettings = (enableVtpm != null || enableSecureBoot != null) ? new UefiSettings(enableSecureBoot, enableVtpm) : null,
287288
SecurityType = securityType,
288-
ProxyAgentSettings = enableProxyAgent == true ? new ProxyAgentSettings(enableProxyAgent) : null
289+
ProxyAgentSettings = (enableProxyAgent == true || addProxyAgentExtension == true) ? new ProxyAgentSettings(enableProxyAgent) { AddProxyAgentExtension = addProxyAgentExtension } : null,
289290
},
290291
OsProfile = new VirtualMachineScaleSetOSProfile
291292
{

src/Compute/Compute/VirtualMachine/Config/SetAzVMProxyAgentSetting.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ public class SetAzureVMProxySetting : Microsoft.Azure.Commands.ResourceManager.C
7373
HelpMessage = "Increase the value of this parameter allows users to reset the key used for securing communication channel between guest and host.")]
7474
public int? KeyIncarnationId { get; set; }
7575

76+
[Parameter(
77+
Mandatory = false,
78+
ValueFromPipelineByPropertyName = true,
79+
HelpMessage = "Specifies whether to add installation of the ProxyAgent extension.")]
80+
public bool? AddProxyAgentExtension { get; set; }
81+
7682
public override void ExecuteCmdlet()
7783
{
7884
if (this.VM.SecurityProfile == null)
@@ -95,6 +101,12 @@ public override void ExecuteCmdlet()
95101
KeyIncarnationId = this.KeyIncarnationId
96102
};
97103

104+
if (this.IsParameterBound(c => c.AddProxyAgentExtension))
105+
{
106+
this.VM.SecurityProfile.ProxyAgentSettings.AddProxyAgentExtension = this.AddProxyAgentExtension;
107+
}
108+
109+
98110
WriteObject(this.VM);
99111
}
100112
}

0 commit comments

Comments
 (0)