Skip to content

Commit 995d0ce

Browse files
committed
fix merge conflicts
2 parents 9ea5a3b + e4d64e5 commit 995d0ce

File tree

1,390 files changed

+1436331
-4729974
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,390 files changed

+1436331
-4729974
lines changed

ChangeLog.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
1+
## 3.4.0 - February 2020
2+
3+
#### Az.CosmosDB
4+
* Added cmdlets for Gremlin, MongoDB, Cassandra and Table APIs.
5+
* Updated .NET SDK Version to 1.0.1
6+
* Added parameters ConflictResolutionPolicyMode, ConflictResolutionPolicyPath and ConflictResolutionPolicyPath in Set-AzCosmosDBSqlContainer.
7+
* Added new cmdlets for Sql API : New-CosmosDBSqlSpatialSpec, New-CosmosDBSqlCompositePath, New-CosmosDBSqlIncludedPathIndex, New-CosmosDBSqlIncludedPath
8+
9+
### Highlights since the last major release
10+
* Az.CosmosDB initial version 0.1.0 released
11+
* Az.Network ConnectionMonitor V2 support added
12+
13+
#### Az.Accounts
14+
* Disable context auto saving when AzureRmContext.json not available
15+
* Update the reference to Azure Powershell Common to 1.3.5-preview
16+
17+
#### Az.ApiManagement
18+
* **Get-AzApiManagementApiSchema** Fixed getting Open-Api Schema associated with an API
19+
https://github.com/Azure/azure-powershell/issues/10626
20+
* **New-AzApiManagementProduct*** and **Set-AzApiManagementProduct**
21+
- Fix documentation for https://github.com/Azure/azure-powershell/issues/10472
22+
* **Set-AzApiManagementApi**
23+
Added example to show how to update the ServiceUrl using the cmdlet
24+
25+
#### Az.Compute
26+
* Limit the number of VM status to 100 to avoid throttling when Get-AzVM -Status is performed without VM name.
27+
* Add Update-AzDiskEncryptionSet cmdlet
28+
* Add EncryptionType and DiskEncryptionSetId parameters to the following cmdlets:
29+
- New-AzDiskUpdateConfig, New-AzSnapshotUpdateConfig
30+
* Add ColocationStatus parameter to Get-AzProximityPlacementGroup cmdlet.
31+
32+
#### Az.DataFactory
33+
* Update ADF .Net SDK version to 4.7.0
34+
35+
#### Az.DeploymentManager
36+
* Adds LIST operations for resources
37+
* Adds capability for performing operations on Health Check steps
38+
39+
#### Az.HDInsight
40+
* Fix document error of New-AzHDInsightCluster.
41+
42+
#### Az.KeyVault
43+
* Add Name alias to VaultName attribute to make Remove-AzureKeyVault consistent with New-AzureKeyVault.
44+
45+
#### Az.Network
46+
* New example added to Set-AzNetworkWatcherConfigFlowLog.md to demonstrate Traffic Analytics disable scenario.
47+
* Add support for assigning management IP configuration to Azure Firewall - a dedicated subnet and Public IP that the firewall will use for its management traffic
48+
- Updated New-AzFirewall cmdlet:
49+
- Added parameter -ManagementPublicIpAddress (not mandatory) which accepts a Public IP Address object
50+
- Added method SetManagementIpConfiguration on firewall object - requires a subnet and a Public IP address as input - subnet name must be 'AzureFirewallManagementSubnet'
51+
* Corrected Get-AzNetworkSecurityGroup examples to show examples for NSG's instead of network interfaces.
52+
* Fixed typo in New-AzVpnSite command that was preventing resource id completer from completing a parameter.
53+
* Added support for Url Confiugration in Rewrite Rules Action Set in the Application Gateway
54+
- New cmdlets added:
55+
- New-AzApplicationGatewayRewriteRuleUrlConfiguration
56+
- Cmdlets updated with optional parameter - UrlConfiguration
57+
- New-AzApplicationGatewayRewriteRuleActionSet
58+
* Add suppport for NetworkWatcher ConnectionMonitor version 2 resources
59+
60+
#### Az.PolicyInsights
61+
* Support evaluating compliance prior to determining what resource to remediate
62+
- Add '-ResourceDiscoverMode' parameter to Start-AzPolicyRemediation
63+
* Add Get-AzPolicyMetadata cmdlet for getting policy metadata resources
64+
* Updated Get-AzPolicyState and Get-AzPolicyStateSummary for API version 2019-10-01
65+
66+
#### Az.RecoveryServices
67+
* Azure Site Recovery support for removing a replicated disk.
68+
* Azure Backup added support for adding tags while creating a Recovery Services Vault.
69+
70+
#### Az.Resources
71+
* Make -Scope optional in *-AzPolicyAssignment cmdlets with default to context subscription
72+
* Add examples of creating ADServicePrincipal with password and key credential
73+
74+
#### Az.Sql
75+
Fix New-AzSqlDatabaseSecondary cmdlet to check for PartnerDatabaseName existence instead of DatabaseName existence.
76+
77+
#### Az.Storage
78+
* Support set Table/Queue Encryption Keytype in Create Storage Account
79+
- New-AzStorageAccount
80+
* Show RequestId when StorageException don't have ExtendedErrorInformation
81+
* Fix the Example 6 of cmdlet Start-AzStorageBlobCopy
82+
83+
#### Az.Websites
84+
* Set-AzWebapp and Set-AzWebappSlot supports AlwaysOn, MinTls and FtpsState properties
85+
* Fixing issue where setting HttpsOnly along with changing AppservicePlan at the same time using the single Set-AzWebApp Command, was resetting HttpsOnly to default value
86+
187
## 3.3.0 - January 2020
288
#### Az.Accounts
389
* Updated Add-AzEnvironment and Set-AzEnvironment to accept parameters AzureAttestationServiceEndpointResourceId and AzureAttestationServiceEndpointSuffix

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Before submitting a design review, please be sure that you have read the documen
143143

144144
Please submit a design review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr
145145

146-
_Note_: You will need to be part of the `GitHub Azure` org to see this repository. Please go to [this link](aka.ms/azuregithub) to become part of the `Azure` org.
146+
_Note_: You will need to be part of the `GitHub Azure` org to see this repository. Please go to [this link](https://aka.ms/azuregithub) to become part of the `Azure` org.
147147

148148
We recommend using the `platyPS` module to easily generate markdown files that contains the above information and including the files in the design submission.
149149

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66

77
The following are naming conventions to keep in mind when coming up with a name for your parameters.
88

9-
In addition, a recommended list of parameter names can be found [here](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/standard-cmdlet-parameter-names-and-types).
9+
In addition, a recommended list of parameter names can be found [here](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/standard-cmdlet-parameter-names-and-types).
1010

1111
#### Standard Parameter Name
1212

13-
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#use-standard-parameter-names):
13+
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#use-standard-parameter-names):
1414

1515
> _Your cmdlet should use standard parameter names so that the user can quickly determine what a particular parameter means. If a more specific name is required, use a standard parameter name, and then specify a more specific name as an alias. For example, the `Get-Service` cmdlet has a parameter that has a generic name (**Name**) and a more specific alias (**ServiceName**). Both terms can be used to specify the parameter._
1616
1717
#### Pascal Case
1818

19-
Similar to cmdlets, parameters should follow pascal casing.From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#use-pascal-case-for-parameter-names):
19+
Similar to cmdlets, parameters should follow pascal casing.From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#use-pascal-case-for-parameter-names):
2020

2121
> _Use Pascal case for parameter names. In other words, capitalize the first letter of each word in the parameter name, including the first letter of the name._
2222
2323
#### Singularity
2424

25-
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#use-singular-parameter-names):
25+
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#use-singular-parameter-names):
2626

2727
> _Avoid using plural names for parameters whose value is a single element. This includes parameters that take arrays or lists because the user might supply an array or list with only one element._
2828
>
@@ -40,15 +40,15 @@ The type of parameters should always be defined; a parameter should never be of
4040

4141
#### Consistent Parameter Types
4242

43-
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#use-consistent-parameter-types):
43+
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#use-consistent-parameter-types):
4444

4545
> _When the same parameter is used by multiple cmdlets, always use the same parameter type. For example, if the **Process** parameter is an **Int16** type for one cmdlet, do not make the **Process** parameter for another cmdlet a **UInt16** type._
4646
4747
#### Array vs. Enumerable Types
4848

4949
For parameters that require a collection of elements to be provided, use an array instead of any other enumerable type to represent this collection.
5050

51-
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#support-arrays-for-parameters):
51+
From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#support-arrays-for-parameters):
5252

5353
> _Frequently, users must perform the same operation against multiple arguments. For these users, a cmdlet should accept an array as parameter input so that a user can pass the arguments into the parameter as a Windows PowerShell variable. For example, the `Get-Process` cmdlet uses an array for the strings that identify the names of the processes to retrieve._
5454
@@ -126,7 +126,7 @@ The following are naming conventions to keep in mind when coming up with a name
126126

127127
#### Pascal Case
128128

129-
Similar to parameters (mentioned above), parameter set names should follow pascal casing. From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/strongly-encouraged-development-guidelines#use-pascal-case-for-cmdlet-names-sd02):
129+
Similar to parameters (mentioned above), parameter set names should follow pascal casing. From the [_Strongly Encouraged Development Guidelines_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines#use-pascal-case-for-cmdlet-names-sd02):
130130

131131
> _Use Pascal case for cmdlet names. In other words, capitalize the first letter of the verb and all terms used in the noun. For example, "Clear-ItemProperty"._
132132
@@ -136,22 +136,22 @@ The following are guidelines that should be followed when working with the attri
136136

137137
#### Mutually Exclusive Parameter Sets
138138

139-
For PowerShell to determine which parameter set a user is intending to use with a set of provided parameters, the parameter sets need to be designed in such a way that they are mutually exclusive. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/parameter-attribute-declaration#remarks):
139+
For PowerShell to determine which parameter set a user is intending to use with a set of provided parameters, the parameter sets need to be designed in such a way that they are mutually exclusive. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/parameter-attribute-declaration#remarks):
140140

141141
> _Each parameter set must have at least one unique parameter. Good cmdlet design indicates this unique parameter should also be mandatory if possible. If your cmdlet is designed to be run without parameters, the unique parameter cannot be mandatory._
142142
143143
#### Positional Parameters Limit
144144

145-
It is possible to call a PowerShell cmdlet without providing the parameter names, but just the values you would like to pass through. This is done by specifying the position at which the value of each parameter should be provided by using the `Position` property for a parameter. However, when there are too many positional parameters in a single parameter set, it can be difficult for the user to remember the exact ordering in which the parameter values should be provided. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/parameter-attribute-declaration#remarks):
145+
It is possible to call a PowerShell cmdlet without providing the parameter names, but just the values you would like to pass through. This is done by specifying the position at which the value of each parameter should be provided by using the `Position` property for a parameter. However, when there are too many positional parameters in a single parameter set, it can be difficult for the user to remember the exact ordering in which the parameter values should be provided. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/parameter-attribute-declaration#remarks):
146146

147147
> _When you specify positional parameters, limit the number of positional parameters in a parameter set to less than five. And, positional parameters do not have to be contiguous. Positions 5, 100, and 250 work the same as positions 0, 1, and 2._
148148
149-
In addition, there should be no two parameters with the same position in the same parameter set. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/developer/cmdlet/parameter-attribute-declaration#remarks):
149+
In addition, there should be no two parameters with the same position in the same parameter set. From the remarks section of [_Parameter Attribute Declaration_](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/parameter-attribute-declaration#remarks):
150150

151151
> _No parameter set should contain more than one positional parameter with the same position._
152152
153153
#### ValueFromPipeline Limit
154154

155-
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/developer/cmdlet/parameter-attribute-declaration#remarks):
155+
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

157-
> _Only one parameter in a parameter set should declare ValueFromPipeline = true. Multiple parameters can define ValueFromPipelineByPropertyName = true._
157+
> _Only one parameter in a parameter set should declare ValueFromPipeline = true. Multiple parameters can define ValueFromPipelineByPropertyName = true._
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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.Azure.Commands.Common.Authentication;
16+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
using Microsoft.Azure.Commands.Common.Authentication.Core;
18+
using Microsoft.Azure.Commands.Common.Authentication.Models;
19+
using Microsoft.Azure.Commands.Common.Authentication.Properties;
20+
using Microsoft.Azure.Commands.ResourceManager.Common;
21+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
23+
using Newtonsoft.Json;
24+
using System;
25+
using System.IO;
26+
using Xunit;
27+
using Xunit.Abstractions;
28+
29+
namespace Microsoft.Azure.Commands.Profile.Test
30+
{
31+
public class AutoSaveSettingOnLoadingTests
32+
{
33+
private MemoryDataStore dataStore;
34+
private string profileBasePath;
35+
private string settingsPath;
36+
37+
public AutoSaveSettingOnLoadingTests(ITestOutputHelper output)
38+
{
39+
dataStore = new MemoryDataStore();
40+
profileBasePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
41+
settingsPath = Path.Combine(profileBasePath, Resources.AzureDirectoryName);
42+
settingsPath = Path.Combine(settingsPath, ContextAutosaveSettings.AutoSaveSettingsFile);
43+
}
44+
45+
internal string HookSettingFile(string hook)
46+
{
47+
var result = new ContextAutosaveSettings
48+
{
49+
CacheDirectory = hook,
50+
ContextDirectory = hook,
51+
Mode = ContextSaveMode.CurrentUser,
52+
CacheFile = "TokenCache.dat",
53+
ContextFile = "AzureRmContext.json"
54+
};
55+
56+
var backupPath = String.Empty;
57+
if (!dataStore.FileExists(settingsPath))
58+
{
59+
string directoryPath = Path.GetDirectoryName(settingsPath);
60+
if (!dataStore.DirectoryExists(directoryPath))
61+
{
62+
dataStore.CreateDirectory(directoryPath);
63+
}
64+
}
65+
else
66+
{
67+
backupPath = BackupSetting();
68+
}
69+
dataStore.WriteFile(settingsPath, JsonConvert.SerializeObject(result));
70+
return backupPath;
71+
}
72+
73+
internal string BackupSetting()
74+
{
75+
var backupPath = settingsPath + ".bak";
76+
dataStore.CopyFile(settingsPath, backupPath);
77+
return backupPath;
78+
}
79+
80+
internal void RestoreSetting(string backupPath)
81+
{
82+
if(dataStore.FileExists(backupPath))
83+
{
84+
dataStore.DeleteFile(settingsPath);
85+
dataStore.CopyFile(backupPath, settingsPath);
86+
dataStore.DeleteFile(backupPath);
87+
}
88+
else
89+
{
90+
dataStore.DeleteFile(settingsPath);
91+
}
92+
}
93+
94+
[Fact]
95+
[Trait(Category.AcceptanceType, Category.CheckIn)]
96+
public void DisableAutoSaveWhenSettingFileBreaks()
97+
{
98+
string faker = Path.Combine(Directory.GetParent(profileBasePath).ToString(), "faker");
99+
faker = Path.Combine(faker,Resources.AzureDirectoryName);
100+
var backupPath = HookSettingFile(faker);
101+
102+
try
103+
{
104+
AzureSessionInitializer.CreateOrReplaceSession(dataStore);
105+
TestMockSupport.RunningMocked = true;
106+
var cmdlet = new ConnectAzureRmAccountCommand();
107+
cmdlet.OnImport();
108+
Assert.Equal(ContextSaveMode.Process, AzureSession.Instance.ARMContextSaveMode);
109+
Assert.Equal(typeof(ResourceManagerProfileProvider), AzureRmProfileProvider.Instance.GetType());
110+
var afterModified = dataStore.ReadFileAsText(settingsPath);
111+
var newSetting = JsonConvert.DeserializeObject<ContextAutosaveSettings>(afterModified) as ContextAutosaveSettings;
112+
Assert.NotNull(newSetting);
113+
Assert.Equal(ContextSaveMode.CurrentUser, newSetting.Mode);
114+
Assert.Equal(typeof(AuthenticationStoreTokenCache), AzureSession.Instance.TokenCache.GetType());
115+
}
116+
finally
117+
{
118+
RestoreSetting(backupPath);
119+
}
120+
}
121+
}
122+
}

0 commit comments

Comments
 (0)