Skip to content

Commit 0992f85

Browse files
committed
fix merge conflicts
2 parents 4eac030 + 526a74b commit 0992f85

File tree

1,219 files changed

+609021
-601178
lines changed

Some content is hidden

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

1,219 files changed

+609021
-601178
lines changed

.azure-pipelines/daily-build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Please don't use ADO UI defined scheduled triggers because it takes precedence over YAML scheduled triggers.
2+
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers
3+
schedules:
4+
- cron: "0 0 * * *"
5+
displayName: Daily Midnight Build
6+
branches:
7+
include:
8+
- master
9+
10+
pr: none
11+
12+
pool:
13+
vmImage: 'windows-2019'
14+
15+
steps:
16+
- task: DotNetCoreCLI@2
17+
displayName: Build for Version Bump
18+
inputs:
19+
command: 'custom'
20+
custom: 'msbuild'
21+
arguments: 'build.proj'
22+
23+
- task: ComponentGovernanceComponentDetection@0
24+
displayName: Component Detection
25+
inputs:
26+
scanType: 'Register'
27+
verbosity: 'Normal'
28+
alertWarningLevel: 'High'

.azure-pipelines/powershell-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
displayName: Test
6464
dependsOn: Build
6565
condition: succeeded()
66-
timeoutInMinutes: 120
66+
timeoutInMinutes: 180
6767
strategy:
6868
matrix:
6969
windows:

.azure-pipelines/util/publish-artifacts-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ steps:
77
inputs:
88
artifactName: ${{ parameters.artifactName }}
99
targetPath: artifacts
10-
condition: succeededOrFailed()
10+
condition: always()

.azure-pipelines/util/test-steps.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ steps:
99
parameters:
1010
osName: ${{ parameters.osName }}
1111

12+
- task: UseDotNet@2
13+
displayName: 'Use .NET Core sdk'
14+
inputs:
15+
packageType: sdk
16+
version: 2.1.x
17+
18+
- task: UseDotNet@2
19+
displayName: 'Use .NET Core sdk'
20+
inputs:
21+
packageType: sdk
22+
version: 3.1.x
23+
1224
- task: DotNetCoreCLI@2
1325
displayName: Test
1426
inputs:

ChangeLog.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
## 4.5.0 - August 2020
2+
#### Az.Accounts
3+
* Updated 'Connect-AzAccount' to accept parameter 'MaxContextPopulation' [#9865]
4+
* Updated SubscriptionClient version to 2019-06-01 and display tenant domains [#9838]
5+
* Supported home tenant and managedBy tenant information of subscription
6+
* Corrected module name, version info in telemetry data
7+
* Adjusted SqlDatabaseDnsSuffix and ServiceManagementUrl if environment metadata endpoint returns incompatible value
8+
9+
#### Az.Aks
10+
* Removed 'ClientIdAndSecret' to 'ServicePrincipalIdAndSecret' and set 'ClientIdAndSecret' as an alias [#12381].
11+
* Removed 'Get-AzAks'/'New-AzAks'/'Remove-AzAks'/'Set-AzAks' to 'Get-AzAksCluster'/'New-AzAksCluster'/'Remove-AzAksCluster'/'Set-AzAksCluster' and set the original ones as alias [#12373].
12+
13+
#### Az.ApiManagement
14+
* Added new 'Add-AzApiManagementApiToGateway' cmdlet.
15+
* Added new 'Get-AzApiManagementGateway' cmdlet.
16+
* Added new 'Get-AzApiManagementGatewayHostnameConfiguration' cmdlet.
17+
* Added new 'Get-AzApiManagementGatewayKey' cmdlet.
18+
* Added new 'New-AzApiManagementGateway' cmdlet.
19+
* Added new 'New-AzApiManagementGatewayHostnameConfiguration' cmdlet.
20+
* Added new 'New-AzApiManagementResourceLocationObject' cmdlet.
21+
* Added new 'Remove-AzApiManagementApiFromGateway' cmdlet.
22+
* Added new 'Remove-AzApiManagementGateway' cmdlet.
23+
* Added new 'Remove-AzApiManagementGatewayHostnameConfiguration' cmdlet.
24+
* Added new 'Update-AzApiManagementGateway' cmdlet.
25+
* Added new optional [-GatewayId] parameter to the 'Get-AzApiManagementApi' cmdlet.
26+
27+
#### Az.CognitiveServices
28+
* Used 'Deny' specifically as NetworkRules default action.
29+
30+
#### Az.FrontDoor
31+
* Fixed an issue where an exception is being thrown when Enum.Parse tries to coerce a null value to an Enabled or Disabled enum values [#12344]
32+
33+
#### Az.HDInsight
34+
* Supported creating cluster with encryption in transit feature.
35+
- Add new parameter 'EncryptionInTransit' to the cmdlet 'New-AzHDInsightCluster'
36+
- Add new parameter 'EncryptionInTransit' to the cmdlet 'New-AzHDInsightClusterConfig'
37+
* Supported creating cluster with private link feature:
38+
- Add new parameter 'PublicNetworkAccessType' and 'OutboundPublicNetworkAccessType' to the cmdlet 'New-AzHDInsightCluster'
39+
- Add new parameter 'PublicNetworkAccessType' and 'OutboundPublicNetworkAccessType' to the cmdlet 'New-AzHDInsightClusterConfig'
40+
* Returned virtual network information when calling 'New-AzHDInsightCluster' or 'Get-AzHDInsightCluster'
41+
42+
#### Az.Network
43+
* Added support for AddressPrefixType parameter to 'Remove-AzExpressRouteCircuitConnectionConfig'
44+
* Added non-breaking changes: PeerAddressType functionality for Private Peering in 'Remove-AzExpressRouteCircutPeeringConfig'.
45+
* Code changed to ignore case for AddressPrefixType and PeerAddressType parameter.
46+
* Modified the warning message for 'New-AzLoadBalancerFrontendIpConfig', 'New-AzPublicIpAddress' and 'New-AzPublicIpPrefix'.
47+
48+
#### Az.OperationalInsights
49+
* Added '-ForceDelete' option for 'Remove-AzOperationalInsightsworkspace'
50+
* Added new cmdlet 'Get-AzOperationalInsightsDeletedWorkspace'
51+
* Added new cmdlet 'Restore-AzOperationalInsightsWorkspace'
52+
53+
#### Az.RecoveryServices
54+
* Improved the Azure Backup container/item discovery experience.
55+
56+
#### Az.Resources
57+
* Added properties 'Condition', 'ConditionVersion' and 'Description' to 'New-AzRoleAssignment'
58+
- This included all the relevant changes to the data models
59+
60+
#### Az.Sql
61+
* Fixed potential server name case insensitive error in 'New-AzSqlServer' and 'Set-AzSqlServer'
62+
* Fixed wrong database name returned on existing database error in 'New-AzSqlDatabaseSecondary'
63+
64+
#### Az.Storage
65+
* Supported create container/blob Sas token with new permission x,t
66+
- 'New-AzStorageBlobSASToken'
67+
- 'New-AzStorageContainerSASToken'
68+
* Supported create account Sas token with new permission x,t,f
69+
- 'New-AzStorageAccountSASToken'
70+
* Supported get single file share usage
71+
- 'Get-AzRmStorageShare'
72+
173
## 4.4.0 - July 2020
274
#### Az.Accounts
375
* Added new cmdlet 'Invoke-AzRestMethod'

build.proj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@
100100
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -ErrorAction Ignore&quot;" IgnoreExitCode="true" />
101101
</Target>
102102

103-
<Target Name="FilterBuild" Condition="$(PullRequestNumber) != '' OR $(TargetModule) != ''">
103+
<Target Name="BuildTools">
104+
<!-- Publish static analysis for use cross-platform -->
105+
<Exec Command="dotnet publish $(RepoTools)StaticAnalysis/StaticAnalysis.Netcore.csproj -c $(Configuration) -f netcoreapp2.1" />
106+
</Target>
107+
108+
<Target Name="FilterBuild" Condition="$(PullRequestNumber) != '' OR $(TargetModule) != ''" DependsOnTargets="BuildTools">
104109
<Message Importance="high" Text="Filtering projects and modules..." />
105110
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CreateFilterMappings.ps1&quot;" />
106111

@@ -175,15 +180,12 @@
175180
<!-- Build version controller -->
176181
<Exec Command="dotnet build $(RepoTools)VersionController/VersionController.Netcore.csproj -c $(Configuration)" />
177182

178-
<!-- Publish static analysis for use cross-platform -->
179-
<Exec Command="dotnet publish $(RepoTools)StaticAnalysis/StaticAnalysis.Netcore.csproj -c $(Configuration) -f netcoreapp2.1" />
180-
181183
<!-- Delete powershell runtime files -->
182184
<PropertyGroup>
183185
<RuntimeDllsIncludeList>Microsoft.Powershell.*.dll,System*.dll,Microsoft.VisualBasic.dll,Microsoft.CSharp.dll,Microsoft.CodeAnalysis.dll,Microsoft.CodeAnalysis.CSharp.dll</RuntimeDllsIncludeList>
184186
<RuntimeDllsExcludeList>System.Security.Cryptography.ProtectedData.dll,System.Configuration.ConfigurationManager.dll,System.Runtime.CompilerServices.Unsafe.dll,System.IO.FileSystem.AccessControl.dll,System.Buffers.dll,System.Text.Encodings.Web.dll,System.CodeDom.dll,System.Management.dll,System.Text.Json.dll,System.Threading.Tasks.Extensions.dll</RuntimeDllsExcludeList>
185187
</PropertyGroup>
186-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {{$_}.FullName -notlike '*PreloadAssemblies*' -and {$_}.FullName -notlike '*NetCoreAssemblies*'} | Remove-Item -Force&quot;" />
188+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*'} | Remove-Item -Force&quot;" />
187189
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force&quot;" Condition="'$(CodeSign)' == 'true'" />
188190

189191
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope)&quot;" />

documentation/development-docs/design-guidelines/parameter-best-practices.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,33 @@ In addition, there should be no two parameters with the same position in the sam
155155
Allowing the user to pipe an object from one cmdlet to another is a major scenario in PowerShell, but allowing multiple parameters in the same parameter set to accept their value from the pipeline can cause issues. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/parameter-attribute-declaration#remarks):
156156

157157
> _Only one parameter in a parameter set should declare ValueFromPipeline = true. Multiple parameters can define ValueFromPipelineByPropertyName = true._
158+
159+
160+
## Appendix: Parameter Syntax
161+
162+
In PowerShell documentation, square brackets (`[]`) indicate optional.
163+
Convention is as follows:
164+
165+
```powershell
166+
command-name
167+
-RequiredParameterName <RequiredParameterValue>
168+
[-OptionalParameterName <OptionalParameterValue>]
169+
[-OptionalSwitchParameters]
170+
[-OptionalParameterName] <RequiredParameterValue>
171+
```
172+
173+
Using `New-Alias` cmdlet as an example:
174+
175+
```powershell
176+
New-Alias
177+
[-Name] <string> -required 'positional' parameter
178+
[-Value] <string>
179+
[-Description <string>] -optional parameter
180+
[-Force] -optional switch parameter (all switch parameters are optional, non-positional)
181+
[-Option {None | ReadOnly | Constant | Private | AllScope}]
182+
[-PassThru]
183+
[-Scope <string>]
184+
[-Confirm]
185+
[-WhatIf]
186+
[<CommonParameters>]
187+
```

setup/generate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if( (-not (get-command -ea 0 light)) -or (-not (get-command -ea 0 heat)) -or (-n
3737
$outputName ="Az-Cmdlets"
3838

3939
# generate the product name from the current month/year.
40-
$productName = "Microsoft Azure PowerShell - July 2020"
40+
$productName = "Microsoft Azure PowerShell - August 2020"
4141

4242
# where to put temp files
4343
$tmp = Join-Path $env:temp azure-cmdlets-tmp

src/Accounts/Accounts.Test/AzureRMProfileTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
using Microsoft.Azure.Commands.Profile.Models;
2525
using Microsoft.Azure.Commands.Profile.Test;
2626
using Microsoft.Azure.Commands.ScenarioTest;
27-
using Microsoft.Azure.Internal.Subscriptions.Models;
27+
using Microsoft.Azure.Management.ResourceManager.Version2019_06_01.Models;
2828
using Microsoft.Azure.ServiceManagement.Common.Models;
2929
using Microsoft.Rest;
3030
using Microsoft.Rest.Azure;
@@ -66,7 +66,8 @@ private static RMProfileClient SetupTestEnvironment(List<string> tenants, params
6666
var clientFactory = new MockSubscriptionClientFactory(tenants, subscriptionList);
6767
var mock = new MockClientFactory(new List<object>
6868
{
69-
clientFactory.GetSubscriptionClient()
69+
clientFactory.GetSubscriptionClientVer2019(),
70+
clientFactory.GetSubscriptionClientVer2016()
7071
}, true);
7172
mock.MoqClients = true;
7273
AzureSession.Instance.ClientFactory = mock;
@@ -93,7 +94,8 @@ private static AzureRmProfile SetupLogin(List<string> tenants, params List<strin
9394
var clientFactory = new MockSubscriptionClientFactory(tenants, subscriptionList);
9495
var mock = new MockClientFactory(new List<object>
9596
{
96-
clientFactory.GetSubscriptionClient()
97+
clientFactory.GetSubscriptionClientVer2019(),
98+
clientFactory.GetSubscriptionClientVer2016()
9799
}, true);
98100
mock.MoqClients = true;
99101
AzureSession.Instance.ClientFactory = mock;
@@ -146,6 +148,7 @@ public void SpecifyTenantAndSubscriptionIdSucceed()
146148
null,
147149
false,
148150
null);
151+
Assert.Equal("2019-06-01", client.SubscriptionAndTenantClient.ApiVersion);
149152
}
150153

151154
[Fact]
@@ -165,13 +168,12 @@ public void SubscriptionIdNotExist()
165168
TenantId = DefaultTenant.ToString()
166169
};
167170

168-
var getAsyncResponses = new Queue<Func<AzureOperationResponse<Subscription>>>();
169-
getAsyncResponses.Enqueue(() =>
171+
MockSubscriptionClientFactory.SubGetQueueVer2019 = new Queue<Func<AzureOperationResponse<Subscription>>>();
172+
MockSubscriptionClientFactory.SubGetQueueVer2019.Enqueue(() =>
170173
{
171174
throw new CloudException("InvalidAuthenticationTokenTenant: The access token is from the wrong issuer");
172175
});
173-
MockSubscriptionClientFactory.SetGetAsyncResponses(getAsyncResponses);
174-
176+
175177
Assert.Throws<PSInvalidOperationException>(() => client.Login(
176178
Context.Account,
177179
Context.Environment,
@@ -181,6 +183,7 @@ public void SubscriptionIdNotExist()
181183
null,
182184
false,
183185
null));
186+
Assert.Equal("2019-06-01", client.SubscriptionAndTenantClient.ApiVersion);
184187
}
185188

186189
[Fact]
@@ -231,12 +234,11 @@ public void SubscriptionIdNotInFirstTenant()
231234
TenantId = DefaultTenant.ToString()
232235
};
233236

234-
var getAsyncResponses = new Queue<Func<AzureOperationResponse<Subscription>>>();
235-
getAsyncResponses.Enqueue(() =>
237+
MockSubscriptionClientFactory.SubGetQueueVer2019 = new Queue<Func<AzureOperationResponse<Subscription>>>();
238+
MockSubscriptionClientFactory.SubGetQueueVer2019.Enqueue(() =>
236239
{
237240
throw new CloudException("InvalidAuthenticationTokenTenant: The access token is from the wrong issuer");
238241
});
239-
MockSubscriptionClientFactory.SetGetAsyncResponses(getAsyncResponses);
240242

241243
var azureRmProfile = client.Login(
242244
Context.Account,
@@ -268,8 +270,8 @@ public void SubscriptionNameNotInFirstTenant()
268270
TenantId = DefaultTenant.ToString()
269271
};
270272

271-
var listAsyncResponses = new Queue<Func<AzureOperationResponse<IPage<Subscription>>>>();
272-
listAsyncResponses.Enqueue(() =>
273+
MockSubscriptionClientFactory.SubListQueueVer2019 = new Queue<Func<AzureOperationResponse<IPage<Subscription>>>>();
274+
MockSubscriptionClientFactory.SubListQueueVer2019.Enqueue(() =>
273275
{
274276
var sub1 = new Subscription(
275277
id: DefaultSubscription.ToString(),
@@ -292,7 +294,6 @@ public void SubscriptionNameNotInFirstTenant()
292294
Body = new MockPage<Subscription>(new List<Subscription> { sub1, sub2 })
293295
};
294296
});
295-
MockSubscriptionClientFactory.SetListAsyncResponses(listAsyncResponses);
296297

297298
var azureRmProfile = client.Login(
298299
Context.Account,
@@ -1097,7 +1098,6 @@ public void CanRenewTokenLogin()
10971098
Assert.Contains(graphToken2, graphMessage.Headers.Authorization.Parameter);
10981099
}
10991100

1100-
11011101
private class MockPage<T> : IPage<T>
11021102
{
11031103
public MockPage(IList<T> Items)

0 commit comments

Comments
 (0)