Skip to content

Commit 830bcb4

Browse files
author
Bhavin Shah
committed
2 parents aa06da2 + 0e0998a commit 830bcb4

File tree

556 files changed

+116449
-120493
lines changed

Some content is hidden

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

556 files changed

+116449
-120493
lines changed

.azure-pipelines/powershell-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ variables:
44
LinuxName: linux
55
LinuxImage: ubuntu-18.04
66
MacOSName: macOS
7-
MacOSImage: macOS-10.13
7+
MacOSImage: macOS-10.14
88
TestFramework: netcoreapp2.2
99
TestTarget: Test
1010
Configuration: Debug

ChangeLog.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,96 @@
1+
## 3.6.1 - March 2020
2+
#### Az.Accounts
3+
* Open Azure PowerShell survey page in 'Send-Feedback' [#11020]
4+
* Display Azure PowerShell survey URL in 'Resolve-Error' [#11021]
5+
* Added Az version in UserAgent
6+
7+
#### Az.ApiManagement
8+
* Added support for retrieving and configuring Custom Domain on the DeveloperPortal Endpoint [#11007]
9+
* 'Export-AzApiManagementApi' Added support for downloading Api Definition in Json format [#9987]
10+
* 'Import-AzApiManagementApi' Added support for importing OpenApi 3.0 definition from Json document
11+
* 'New-AzApiManagementIdentityProvider' and 'Set-AzApiManagementIdentityProvider' Added support for configuring 'Signin Tenant' for AAD B2C Provider [#9784]
12+
13+
#### Az.DataLakeStore
14+
* Added reference to System.Buffers explicitly in csproj and psd1.
15+
16+
#### Az.IotHub
17+
* Added support to manage devices in an Iot Hub. New Cmdlets are:
18+
- 'Add-AzIotHubDevice'
19+
- 'Get-AzIotHubDevice'
20+
- 'Remove-AzIotHubDevice'
21+
- 'Set-AzIotHubDevice'
22+
* Added support to manage modules on a target Iot device in an Iot Hub. New Cmdlets are:
23+
- 'Add-AzIotHubModule'
24+
- 'Get-AzIotHubModule'
25+
- 'Remove-AzIotHubModule'
26+
- 'Set-AzIotHubModule'
27+
* Added cmdlet to get the connection string of a target IoT device in an Iot Hub.
28+
* Added cmdlet to get the connection string of a module on a target IoT device in an Iot Hub.
29+
* Added support to get/set parent device of an IoT device. New Cmdlets are:
30+
- 'Get-AzIotHubDeviceParent'
31+
- 'Set-AzIotHubDeviceParent'
32+
* Added support to manage device parent-child relationship.
33+
34+
#### Az.Monitor
35+
* Fixed output value for 'Get-AzMetricDefinition' [#9714]
36+
37+
#### Az.Network
38+
* Updated Sql Management SDK.
39+
* Fixed a naming-difference issue in PrivateLinkServiceConnectionState class.
40+
- Mapping the field ActionsRequired to ActionRequired.
41+
* Added PublicNetworkAccess to 'New-AzSqlServer' and 'Set-AzSqlServer'
42+
43+
#### Az.Resources
44+
* Fixed for null reference bug in 'Get-AzRoleAssignment'
45+
* Marked switch '-Force' and '-PassThru' optional in 'Remove-AzADGroup' [#10849]
46+
* Fixed issue that 'MailNickname' doesn't return in 'Remove-AzADGroup' [#11167]
47+
* Fixed issue that 'Remove-AzADGroup' pipe operation doesn't work [#11171]
48+
* Fixed for null reference bug in GetAzureRoleAssignmentCommand
49+
* Added breaking change attributes for upcoming changes to policy cmdlets
50+
* Updated 'Get-AzResourceGroup' to perform resource group tag filtering on server-side
51+
* Extended Tag cmdlets to accept -ResourceId
52+
- Get-AzTag -ResourceId
53+
- New-AzTag -ResourceId
54+
- Remove-AzTag -ResourceId
55+
* Added new Tag cmdlet
56+
- Update-AzTag -ResourceId
57+
* Brought ScopedDeployment from SDK 3.3.0
58+
59+
#### Az.Sql
60+
* Added PublicNetworkAccess to 'New-AzSqlServer' and 'Set-AzSqlServer'
61+
* Added support for Long Term Retention backup configuration for Managed Databases
62+
- Get/Set LTR policy on a managed database
63+
- Get LTR backup(s) by managed database, managed instance, or by location
64+
- Remove an LTR backup
65+
- Restore an LTR backup to create a new managed database
66+
* Added MinimalTlsVersion to New-AzSqlServer and Set-AzSqlServer
67+
* Added MinimalTlsVersion to New-AzSqlInstance and Set-AzSqlInstance
68+
* Bumped SQL SDK version for Az.Network
69+
70+
#### Az.Storage
71+
* Supported AllowProtectedAppendWrite in ImmutabilityPolicy
72+
- 'Set-AzRmStorageContainerImmutabilityPolicy'
73+
* Added breaking change warning message for AzureStorageTable type change in a future release
74+
- 'New-AzStorageTable'
75+
- 'Get-AzStorageTable'
76+
77+
#### Az.Websites
78+
* Added Tag parameter for 'New-AzAppServicePlan' and 'Set-AzAppServicePlan'
79+
* Stop cmdlet execution if an exception is thrown when adding a custom domain to a website
80+
* Added support to perform operations for App Services not in the same resource group as the App Service Plan
81+
* Applied access restriction to WebApp/Function in different resource groups
82+
* Fixed issue to set custom hostnames for WebAppSlots
83+
184
## 3.5.0 - February 2020
285
### Highlights since the last major release
386
* Updated client side telemetry.
487
* Az.IotHub added cmdlets to support to manage devices.
588
* Az.SqlVirtualMachine added cmdlets for Availability Group Listener.
689

90+
#### Az.Resource
91+
* Fixed bug preventing correct tenant-level resource id generation.
92+
* Fixed typo.
93+
794
#### Az.Accounts
895
* Added SubscriptionId, TenantId, and execution time into data of client side telemetry
996

VirtualMachineCustomScriptExtensionManagedDisk.json

Lines changed: 0 additions & 3814 deletions
This file was deleted.

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please follow [Docker's official instructions][install] to install `docker` corr
1515

1616
## Release
1717

18-
The release containers derive from the [Powershell image][powershell image], and then install the current Az package.
18+
The release containers derive from the [Powershell image][powershell image], and then install the current Az package. The current images are using PowerShell 6.2.4, we are planning to add support for PowerShell 7 in the near future.
1919

2020
[powershell image]: https://hub.docker.com/_/microsoft-powershell
2121

@@ -99,4 +99,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open
9999

100100
[conduct-code]: http://opensource.microsoft.com/codeofconduct/
101101
[conduct-FAQ]: http://opensource.microsoft.com/codeofconduct/faq/
102-
[conduct-email]: mailto:[email protected]
102+
[conduct-email]: mailto:[email protected]

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The Azure PowerShell Developer Guide was created to help with the development and testing of Azure PowerShell cmdlets. This guide contains information on how to set up your environment, create a new project, implement cmdlets, record and run tests, and more.
44

5+
**Note: Except for the way described in this page, There is a new way to generate PowerShell modules through AutoRest PowerShell generator. And related links are attached in the end.**
6+
57
# Table of Contents
68

79
- [Prerequisites](#prerequisites)
@@ -36,6 +38,7 @@ The Azure PowerShell Developer Guide was created to help with the development an
3638
- [After Development](#after-development)
3739
- [Misc](#misc)
3840
- [Publish to PowerShell Gallery](#publish-to-powershell-gallery)
41+
- [Autorest PowerShell Generator](#autorest-powershell-generator)
3942

4043
# Prerequisites
4144

@@ -317,3 +320,7 @@ Whenever you make updates to a project, please make sure to update the correspon
317320
## Publish to PowerShell Gallery
318321

319322
To publish your module to the [official PowerShell gallery](http://www.powershellgallery.com/) or the test gallery site, contact the Azure PowerShell team
323+
324+
# AutoRest PowerShell Generator
325+
- [autorest.powershell documentation](https://github.com/Azure/autorest.powershell/tree/master/docs)
326+
- [examples](https://github.com/Azure/azure-powershell/tree/generation/src)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
using Xunit.Abstractions;
18+
19+
namespace Microsoft.Azure.Commands.Profile.Test
20+
{
21+
public class ErrorResolutionScenarioTests : AccountsTestRunner
22+
{
23+
public ErrorResolutionScenarioTests(ITestOutputHelper output)
24+
: base(output)
25+
{
26+
}
27+
28+
[Fact]
29+
[Trait(Category.AcceptanceType, Category.CheckIn)]
30+
public void WriteInformationInResolveError()
31+
{
32+
TestRunner.RunTestScript("Test-WriteInformationInResolveError");
33+
}
34+
}
35+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Tests cmdlets surrounding default resource group
18+
#>
19+
20+
function Test-WriteInformationInResolveError
21+
{
22+
Assert-Throws { Connect-AzAccount -Wrong }
23+
$err = Resolve-AzError -Last
24+
Assert-AreEqual 1 $err.length
25+
Assert-AreEqual "Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord" $err[0].GetType().FullName
26+
}

src/Accounts/Accounts.Test/ErrorResolutionTests.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void HandlesExceptionError()
6666
var response = new HttpResponseMessage(HttpStatusCode.BadRequest);
6767
var hyakException = new TestHyakException("exception message", CloudHttpRequestErrorInfo.Create(request), CloudHttpResponseErrorInfo.Create(response))
6868
{
69-
Error = new Hyak.Common.CloudError { Code="HyakCode", Message="HyakError"}
69+
Error = new Hyak.Common.CloudError { Code = "HyakCode", Message = "HyakError" }
7070
};
7171

7272
var autorestException = new Microsoft.Rest.Azure.CloudException("exception message")
@@ -79,16 +79,15 @@ public void HandlesExceptionError()
7979

8080
var cmdlet = new ResolveError
8181
{
82-
Error = new []
82+
Error = new[]
8383
{
8484
new ErrorRecord(new Exception("exception message"), "errorCode", ErrorCategory.AuthenticationError, this),
8585
new ErrorRecord(hyakException, "errorCode", ErrorCategory.ConnectionError, this),
8686
new ErrorRecord(autorestException , "errorCode", ErrorCategory.InvalidOperation, this),
8787
},
8888
CommandRuntime = runtime
8989
};
90-
91-
cmdlet.ExecuteCmdlet();
90+
Assert.Throws<NotImplementedException>(() => cmdlet.ExecuteCmdlet());
9291
Assert.NotNull(runtime.OutputPipeline);
9392
Assert.Equal(3, runtime.OutputPipeline.Count);
9493
var errorResult = runtime.OutputPipeline[0] as AzureExceptionRecord;
@@ -130,9 +129,9 @@ public void HandlesNullValuesInArmExceptions()
130129
{
131130
var runtime = new MockCommandRuntime();
132131
var hyakException = new TestHyakException(null, null, null);
133-
132+
134133
var autorestException = new Microsoft.Rest.Azure.CloudException();
135-
134+
136135
var cmdlet = new ResolveError
137136
{
138137
Error = new[]
@@ -143,8 +142,8 @@ public void HandlesNullValuesInArmExceptions()
143142
},
144143
CommandRuntime = runtime
145144
};
146-
147-
cmdlet.ExecuteCmdlet();
145+
146+
Assert.Throws<NotImplementedException>(() => cmdlet.ExecuteCmdlet());
148147
Assert.NotNull(runtime.OutputPipeline);
149148
Assert.Equal(3, runtime.OutputPipeline.Count);
150149
var errorResult = runtime.OutputPipeline[0] as AzureExceptionRecord;
@@ -173,7 +172,7 @@ public void LastParameterFindsLastError()
173172
var cmdlet = new ResolveError { CommandRuntime = mock };
174173
var message = "RuntimeErrorMessage";
175174
var exception = new Exception(message);
176-
cmdlet.ExecuteCmdletWithExceptionInPipeline<AzureErrorRecord>("Resolve-AzureRmError", exception, new KeyValuePair<string, object>("Last", null ) );
175+
cmdlet.ExecuteCmdletWithExceptionInPipeline<AzureErrorRecord>("Resolve-AzureRmError", exception, new KeyValuePair<string, object>("Last", null));
177176
Assert.NotNull(mock.ErrorStream);
178177
Assert.Single(mock.ErrorStream);
179178
Assert.NotNull(mock.OutputPipeline);
@@ -183,8 +182,6 @@ public void LastParameterFindsLastError()
183182
Assert.NotNull(record.Exception);
184183
Assert.Equal(typeof(Exception), record.Exception.GetType());
185184
Assert.Equal(message, record.Message);
186-
187-
188185
}
189186
}
190187
}

src/Accounts/Accounts.Test/SendFeedbackTests.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,5 @@ public void SendFeedbackFailsInNonInteractive()
5858
cmdlet.InvokeBeginProcessing();
5959
});
6060
}
61-
62-
[Fact]
63-
[Trait(Category.AcceptanceType, Category.CheckIn)]
64-
public void CanSerializeSimpleFeedbackPayloadIntoProperForm()
65-
{
66-
var payload = new PSAzureFeedback
67-
{
68-
ModuleName = "Module",
69-
ModuleVersion = "1.0.0",
70-
SubscriptionId = Guid.NewGuid().ToString(),
71-
TenantId = Guid.NewGuid().ToString(),
72-
Environment = "AzureCloud",
73-
Recommendation = 10,
74-
PositiveComments = "Positive",
75-
NegativeComments = "Negative",
76-
77-
};
78-
79-
var serializedPayload = MetricHelper.SerializeCustomEventPayload(payload);
80-
81-
Assert.Equal(payload.ModuleName, serializedPayload["moduleName"]);
82-
Assert.Equal(payload.ModuleVersion, serializedPayload["moduleVersion"]);
83-
Assert.Equal(payload.SubscriptionId.ToString(), serializedPayload["subscriptionId"]);
84-
Assert.Equal(payload.TenantId.ToString(), serializedPayload["tenantId"]);
85-
Assert.Equal(payload.Environment, serializedPayload["environment"]);
86-
Assert.Equal(payload.Recommendation.ToString(), serializedPayload["recommendation"]);
87-
Assert.Equal(payload.PositiveComments, serializedPayload["positiveComments"]);
88-
Assert.Equal(payload.NegativeComments, serializedPayload["negativeComments"]);
89-
Assert.Equal(payload.Email, serializedPayload["email"]);
90-
}
9161
}
9262
}

0 commit comments

Comments
 (0)