From 5e66d80e627eb51ddcebb01c3346f6ef591ba642 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:17:22 +0530 Subject: [PATCH 1/4] {AzureCompute} Include the ProvisioningState value in Get-AzVMRunCommand output fixes Azure/azure-powershell#21473 ProvisioningState is empty in Get-AzVMRunCommand output. GET VM Run command REST API does return ProvisioningState correctly. See the response returned: ``` Name : navbaRunCommand Location : SouthIndia Id : /subscriptions/XXXXXXX/resourceGroups/navbavmdel/providers/Microsoft.C ompute/virtualMachines/navbavmdel/runCommands/navbaRunCommand Type : Microsoft.Compute/virtualMachines/runCommands Tags : {[Reason, Repro], [CreatedDate, 4/11/2023 4:07:00 AM], [CreatedBy, NA], [OwningTeam, NA]} Source : Microsoft.Azure.Management.Compute.Models.VirtualMachineRunCommandScriptSource Parameters : {} ProtectedParameters : {} AsyncExecution : False RunAsUser : RunAsPassword : TimeoutInSeconds : 0 OutputBlobUri : ErrorBlobUri : ProvisioningState : InstanceView : ``` This PR includes the fix for this and includes the ProvisioningState value in Get-AzVMRunCommand output --- .../Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compute/Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs b/src/Compute/Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs index 02d6894d59c5..230752cab2bd 100644 --- a/src/Compute/Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs +++ b/src/Compute/Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs @@ -69,6 +69,7 @@ public override void ExecuteCmdlet() VirtualMachineRunCommand vmRc = VirtualMachineRunCommandsClient.GetByVirtualMachine(this.ResourceGroupName, this.VMName, this.RunCommandName, this.Expand); PSVirtualMachineRunCommand psObject = new PSVirtualMachineRunCommand(); ComputeAutomationAutoMapperProfile.Mapper.Map(vmRc, psObject); + psObject.ProvisioningState = vmRc.ProvisioningState; WriteObject(psObject); } else From 89b4be5a9f162638f2e28f55f46f3d29a7b726a7 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:18:54 +0530 Subject: [PATCH 2/4] Update PSVirtualMachineRunCommand.cs --- src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs b/src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs index e65349fb1a68..e8709330e1eb 100644 --- a/src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs +++ b/src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs @@ -22,7 +22,7 @@ public class PSVirtualMachineRunCommand public int? TimeoutInSeconds { get; set; } public string OutputBlobUri { get; set; } public string ErrorBlobUri { get; set; } - public string ProvisioningState { get; } + public string ProvisioningState { get; set; } public VirtualMachineRunCommandInstanceView InstanceView { get; set; } } -} \ No newline at end of file +} From 583d69fe1c17b437f143d2c5b7e7104a25fbf478 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:22:43 +0530 Subject: [PATCH 3/4] Update ChangeLog.md --- src/Compute/Compute/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index b5a358be359d..c20c722f476f 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,6 +21,7 @@ --> ## Upcoming Release * Updated the breaking change warning in `New-AzVM` and `New-AzVmss` regarding using the new versioned image aliases to indicate that certain aliases will be removed next breaking change release. +* Updated the `Get-AzVMRunCommand` to include the `ProvisioningState` value. ## Version 5.7.0 * Addressed bug in `Remove-AzVmss` to throw error when `-InstanceId` is null. [#21162] From 3186bd173edd5e434b1cd2188e994e1f87199487 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:23:50 +0530 Subject: [PATCH 4/4] Update ChangeLog.md --- src/Compute/Compute/ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index c20c722f476f..5e67af4982ba 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,7 +21,7 @@ --> ## Upcoming Release * Updated the breaking change warning in `New-AzVM` and `New-AzVmss` regarding using the new versioned image aliases to indicate that certain aliases will be removed next breaking change release. -* Updated the `Get-AzVMRunCommand` to include the `ProvisioningState` value. +* Updated the `Get-AzVMRunCommand` to include the `ProvisioningState` value. Fix [#21473] ## Version 5.7.0 * Addressed bug in `Remove-AzVmss` to throw error when `-InstanceId` is null. [#21162]