Skip to content

Commit 5b35b43

Browse files
authored
Merge branch 'master' into master
2 parents 4268bfc + 9e8b216 commit 5b35b43

File tree

130 files changed

+6250
-3238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+6250
-3238
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Az module bug report
3+
about: Report errors or unexpected behaviors for the Az module
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
12+
- Make sure you are able to reproduce this issue on the latest released version of Az
13+
- https://www.powershellgallery.com/packages/Az
14+
- Please search the existing issues to see if there has been a similar issue filed
15+
- For issue related to importing a module, please refer to our troubleshooting guide:
16+
- https://github.com/Azure/azure-powershell/blob/master/documentation/troubleshoot-module-load.md
17+
18+
-->
19+
20+
## Description
21+
22+
23+
24+
## Steps to reproduce
25+
26+
```powershell
27+
28+
```
29+
30+
## Environment data
31+
32+
<!-- Please run $PSVersionTable and paste the output in the below code block -->
33+
34+
```
35+
36+
```
37+
38+
## Module versions
39+
40+
<!-- Please run (Get-Module -Name Az.* -ListAvailable) and paste the output in the below code block -->
41+
42+
```powershell
43+
44+
```
45+
46+
## Debug output
47+
48+
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block -->
49+
50+
```
51+
52+
```
53+
54+
## Error output
55+
56+
<!-- Please run Resolve-AzureRmError and paste the output in the below code block -->
57+
58+
```
59+
60+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: AzureRM module bug report
3+
about: Report errors or unexpected behaviors for the AzureRM module
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
12+
- The AzureRM module has been replaced by the Az module; please see the following document for more information:
13+
- https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az
14+
- If you are able to, please migrate to the Az module and see if the issue is reproducible
15+
- If so, please file an issue using the Az module template
16+
- Please search the existing issues to see if there has been a similar issue filed
17+
18+
-->
19+
20+
## Description
21+
22+
23+
24+
## Steps to reproduce
25+
26+
```powershell
27+
28+
```
29+
30+
## Module versions
31+
32+
<!-- Please run (Get-Module -Name AzureRM* -ListAvailable) and paste the output in the below code block -->
33+
34+
```powershell
35+
36+
```
37+
38+
## Debug output
39+
40+
<!-- Set $DebugPreference='Continue' before running the repro and paste the resulting debug stream in the below code block -->
41+
42+
```
43+
44+
```
45+
46+
## Error output
47+
48+
<!-- Please run Resolve-AzureRmError and paste the output in the below code block -->
49+
50+
```
51+
52+
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature or improvement
4+
title: ''
5+
labels: Feature Request
6+
assignees: ''
7+
8+
---
9+
10+
## Description of the new feature
11+
12+
## Proposed implementation details (optional)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Internal issue
3+
about: Azure PowerShell team only
4+
title: ''
5+
labels: Azure PS Team
6+
assignees: ''
7+
8+
---
9+
10+
## Description
11+
12+
## Cost

src/Automation/Automation/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Update help for Import-AzAutomationDscNodeConfiguration
22+
* Added configuration name validation to Import-AzAutomationDscConfiguration cmdlet
23+
* Improved error handling for Import-AzAutomationDscConfiguration cmdlet
2124

2225
## Version 1.1.0
2326
* Added support for Python 2 runbooks

src/Automation/Automation/Common/AutomationPSClientDSC.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,11 @@ public Model.DscConfiguration CreateConfiguration(
173173
string fileContent = null;
174174
string configurationName = String.Empty;
175175

176-
try
176+
if (File.Exists(Path.GetFullPath(sourcePath)))
177177
{
178-
if (File.Exists(Path.GetFullPath(sourcePath)))
179-
{
180-
fileContent = System.IO.File.ReadAllText(sourcePath);
181-
}
178+
fileContent = System.IO.File.ReadAllText(sourcePath);
182179
}
183-
catch (Exception)
184-
{
180+
else {
185181
// exception in accessing the file path
186182
throw new FileNotFoundException(
187183
string.Format(
@@ -192,6 +188,10 @@ public Model.DscConfiguration CreateConfiguration(
192188
// configuration name is same as filename
193189
configurationName = Path.GetFileNameWithoutExtension(sourcePath);
194190

191+
if (!System.Text.RegularExpressions.Regex.IsMatch(configurationName, "^([a-zA-Z]{1}([a-zA-Z0-9]|_){0,63})$")) {
192+
throw new PSInvalidOperationException("Invalid configuration name. Valid configuration names can contain only letters, numbers, and underscores. The name must start with a letter. The length of the name must be between 1 and 64 characters. ");
193+
}
194+
195195
// for the private preview, configuration can be imported in Published mode only
196196
// Draft mode is not implemented
197197
if (!published)
@@ -238,14 +238,30 @@ public Model.DscConfiguration CreateConfiguration(
238238
}
239239
};
240240

241-
var configuration =
242-
this.automationManagementClient.DscConfiguration.CreateOrUpdate(
241+
try
242+
{
243+
var configuration =
244+
this.automationManagementClient.DscConfiguration.CreateOrUpdate(
243245
resourceGroupName,
244246
automationAccountName,
245247
configurationName,
246248
configurationCreateParameters);
247249

248-
return new Model.DscConfiguration(resourceGroupName, automationAccountName, configuration);
250+
return new Model.DscConfiguration(resourceGroupName, automationAccountName, configuration);
251+
}
252+
catch (Microsoft.Azure.Management.Automation.Models.ErrorResponseException ex)
253+
{
254+
if (ex.Response.Content != null)
255+
{
256+
throw new Microsoft.Azure.Management.Automation.Models.ErrorResponseException(ex.Response.Content, ex);
257+
}
258+
else {
259+
throw ex;
260+
}
261+
}
262+
catch (Exception ex) {
263+
throw ex;
264+
}
249265
}
250266
}
251267

src/Automation/Automation/help/Import-AzAutomationDscNodeConfiguration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Specify the path of a .mof file.
2727

2828
### Example 1: Import a DSC node configuration into Automation
2929
```
30-
PS C:\>Import-AzAutomationDscConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -Force
30+
PS C:\>Import-AzAutomationDscNodeConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -Force
3131
```
3232

3333
This command imports a DSC node configuration from the file named webserver.mof into the Automation account named Contoso17, under the DSC configuration ContosoConfiguration.
@@ -36,7 +36,7 @@ If there is an existing DSC node configuration named ContosoConfiguration.webser
3636

3737
### Example 2: Import a DSC node configuration into Automation and create a new build version and not overwrite existing NodeConfiguration.
3838
```
39-
PS C:\>Import-AzAutomationDscConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -IncrementNodeConfigurationBuild
39+
PS C:\>Import-AzAutomationDscNodeConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -IncrementNodeConfigurationBuild
4040
```
4141

4242
This command imports a DSC node configuration from the file named webserver.mof into the Automation account named Contoso17, under the DSC configuration ContosoConfiguration.

src/Compute/Compute.Test/ScenarioTests/ImageTests.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,10 @@ function Test-Image
129129
Assert-AreEqual 1 $images.Count;
130130

131131
# Update Image Tag
132-
$image = Get-AzImage -ResourceGroupName $rgname -ImageName $imageName;
133-
$image.Tags = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]";
134-
$image.Tags.Add("test1", "testval3");
135-
$image.Tags.Add("test2", "testval4");
136-
Update-AzImage -ResourceGroupName $rgname -ImageName $imageName -Image $image;
132+
$images[0] | Update-AzImage -Tag @{test1 = "testval3"; test2 = "testval4"};
133+
Update-AzImage -ResourceGroupName $rgname -ImageName $imageName -Tag @{test1 = "testval3"; test2 = "testval4"};
134+
Update-AzImage -Image $images[0] -Tag @{test1 = "testval3"; test2 = "testval4"};
135+
Update-AzImage -ResourceId $images[0].Id -Tag @{test1 = "testval3"; test2 = "testval4"};
137136

138137
$image = Get-AzImage -ResourceGroupName $rgname -ImageName $imageName;
139138
Assert-True {$image.Tags.ContainsKey("test1") }
@@ -215,7 +214,7 @@ function Test-ImageCapture
215214
$p = Add-AzVMDataDisk -VM $p -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 2 -VhdUri $dataDiskVhdUri2 -CreateOption Empty;
216215
$p = Add-AzVMDataDisk -VM $p -Name 'testDataDisk3' -Caching 'ReadOnly' -DiskSizeInGB 12 -Lun 3 -VhdUri $dataDiskVhdUri3 -CreateOption Empty;
217216
$p = Remove-AzVMDataDisk -VM $p -Name 'testDataDisk3';
218-
217+
219218
# OS & Image
220219
$user = "Foo12";
221220
$password = $PLACEHOLDER;

src/Compute/Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,11 +2083,19 @@ function Test-VirtualMachineScaleSetAutoRollback
20832083
Assert-AreEqual 2 $vmss.Sku.Capacity;
20842084
Assert-AreEqual $false $vmss.VirtualMachineProfile.StorageProfile.OsDisk.WriteAcceleratorEnabled;
20852085

2086+
$vmssVMsStatus = Get-AzVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName -InstanceView;
2087+
$vmssVMsStatusFullOutput = $vmssVMsStatus | fc | Out-String;
2088+
Assert-True { $vmssVMsStatusFullOutput.Contains("InstanceView") };
2089+
20862090
$vmss2 = $vmss | Update-AzVmss -DisableAutoRollback $true;
20872091
Assert-True { $vmss2.UpgradePolicy.AutomaticOSUpgradePolicy.DisableAutomaticRollback };
20882092

20892093
$result = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName -OSUpgradeHistory;
20902094
Assert-Null $result
2095+
2096+
$vmssVMsStatus = Get-AzVmssVM -ResourceGroupName $rgname -VMScaleSetName $vmssName -InstanceView;
2097+
$vmssVMsStatusFullOutput = $vmssVMsStatus | fc | Out-String;
2098+
Assert-True { $vmssVMsStatusFullOutput.Contains("InstanceView") };
20912099
}
20922100
finally
20932101
{

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.ImageTests/TestImage.json

Lines changed: 1331 additions & 719 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineScaleSetTests/TestVirtualMachineScaleSetAutoRollback.json

Lines changed: 1167 additions & 2098 deletions
Large diffs are not rendered by default.

src/Compute/Compute/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- Additional information about change #1
2020
-->
2121
## Upcoming Release
22+
* Add Tag and ResourceId parameters to Update-AzImage cmdlet
23+
* Get-AzVmssVM without instance ID and with InstanceView can list VMSS VMs with instance view.
2224

2325
## Version 1.3.0
2426
* AEM extension: Add support for UltraSSD and P60,P70 and P80 disks

src/Compute/Compute/Generated/ContainerService/ContainerServiceCreateOrUpdateMethod.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ public override void ExecuteCmdlet()
5757

5858
[Parameter(
5959
ParameterSetName = "DefaultParameter",
60-
Position = 1,
60+
Position = 0,
6161
Mandatory = true,
6262
ValueFromPipelineByPropertyName = true)]
6363
[ResourceGroupCompleter]
6464
public string ResourceGroupName { get; set; }
6565

6666
[Parameter(
6767
ParameterSetName = "DefaultParameter",
68-
Position = 2,
68+
Position = 1,
6969
Mandatory = true,
7070
ValueFromPipelineByPropertyName = true)]
7171
public string Name { get; set; }
7272

7373
[Parameter(
7474
ParameterSetName = "DefaultParameter",
75-
Position = 3,
75+
Position = 2,
7676
Mandatory = true,
7777
ValueFromPipeline = true)]
7878
public PSContainerService ContainerService { get; set; }
@@ -107,22 +107,22 @@ public override void ExecuteCmdlet()
107107

108108
[Parameter(
109109
ParameterSetName = "DefaultParameter",
110-
Position = 1,
110+
Position = 0,
111111
Mandatory = true,
112112
ValueFromPipelineByPropertyName = true)]
113113
[ResourceGroupCompleter]
114114
public string ResourceGroupName { get; set; }
115115

116116
[Parameter(
117117
ParameterSetName = "DefaultParameter",
118-
Position = 2,
118+
Position = 1,
119119
Mandatory = true,
120120
ValueFromPipelineByPropertyName = true)]
121121
public string Name { get; set; }
122122

123123
[Parameter(
124124
ParameterSetName = "DefaultParameter",
125-
Position = 3,
125+
Position = 2,
126126
Mandatory = true,
127127
ValueFromPipeline = true)]
128128
public PSContainerService ContainerService { get; set; }

0 commit comments

Comments
 (0)