Skip to content

Commit 39579d9

Browse files
committed
Merge branch 'release-4.3.0' of https://github.com/Azure/azure-powershell into update-change-log
# Conflicts: # src/ResourceManager/EventHub/AzureRM.EventHub.psd1 # src/ResourceManager/EventHub/ChangeLog.md
2 parents 4e1081c + 4fd2472 commit 39579d9

File tree

1,017 files changed

+433379
-29845
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,017 files changed

+433379
-29845
lines changed

ChangeLog.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* Add-AzureAnalysisServicesAccount to support login with Service Principal
1010
* Automation
1111
* Made changes to AutomationDSC* cmdlets to pull more than 100 records
12+
* Resolved the issue where the Verbose streams stop working after calling some Automation cmdlets (for example Get-AzureRmAutomationVariable, Get-AzureRmAutomationJob).
13+
* Support for NodeConfiguration Build versioning added in StartAzureAutomationDscCompilationJob and ImportAzureAutomationDscNodeConfiguration.
14+
* Bug fixes for existing issues - Fixes the alias issue is #3775 and the runOn alias and support for HybridWorkers.
1215
* Compute
1316
* Set-AzureRmVMAEMExtension: Add support for new Premium Disk sizes
1417
* Set-AzureRmVMAEMExtension: Add support for M series
@@ -20,6 +23,23 @@
2023
* Expose Restriction and Capability to the table format of Get-AzureRmComputeResourceSku
2124
* DataLakeStore
2225
* Fix for issue: https://github.com/Azure/azure-powershell/issues/4323
26+
* EventHub
27+
* added ResourceGroup property to NamespaceAttributes
28+
- 'ResourceGroup' Gets the name of the resource group the Namespace is in
29+
* updated commandlets with new parameter and parameter alias
30+
- below cmdlets updated with Parametersets for Namespace and EventHub for operation of AuthorizationRule
31+
- New-AzureRmEventHubAuthorizationRule
32+
+ Adds a new AuthorizationRule to the existing NameSpace or EventHub.
33+
- Get-AzureRmEventHubAuthorizationRule
34+
+ Gets AuthorizationRule / List of AuthorizationRules for the existing NameSpace or EventHub.
35+
- Set-AzureRmEventHubAuthorizationRule
36+
+ Updates properties of existing AuthorizationRule of EventHub NameSpace.
37+
- Remove-AzureRmEventHubAuthorizationRule
38+
+ Deletes the existing AuthorizationRule of existing NameSpace or EventHub.
39+
- New-AzureRmEventHubKey
40+
+ Generates a new Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.
41+
- Get-AzureRmEventHubKey
42+
+ Gets Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.
2343
* Network
2444
* New-AzureRmExpressRouteCircuitPeeringConfig: Added IPv6 support. New optional parameter added
2545
- PeerAddressType
@@ -31,6 +51,10 @@
3151
- Add-AzureRmApplicationGatewayBackendHttpSettings
3252
- New-AzureRmApplicationGatewayBackendHttpSettings
3353
- Set-AzureRmApplicationGatewayBackendHttpSettings
54+
* Profile
55+
* Data collection has been enabled by default. Usage data is collected by Microsoft in order to improve the user experience. The data is anonymous and does not include command-line argument values.
56+
- Use the Disable-AzureRmDataCollection cmdlet to turn the feature off
57+
- Use the Enable-AzureRmDataCollection cmdlet to turn this feature on
3458
* Resources
3559
* Add Support for validation of scopes for the following roledefinition and roleassignment commandlets before sending the request to ARM
3660
- Get-AzureRMRoleAssignment
@@ -41,28 +65,20 @@
4165
- Remove-AzureRMRoleDefinition
4266
- Set-AzureRMRoleDefinition
4367
* ServiceBus
44-
4568
* Added below new commandlets for AuthorizationRules for NameSpace, Queue and Topic. according to parameter set the authorization rule orperations are perfomed.
4669
- New-AzureRmServiceBusAuthorizationRule
47-
- Adds a new AuthorizationRule to the existing ServiceBus NameSpace/Queue/Topic.
48-
70+
- Adds a new AuthorizationRule to the existing ServiceBus NameSpace/Queue/Topic.
4971
- Get-AzureRmServiceBusAuthorizationRule
50-
- Gets AuthorizationRule / List of AuthorizationRules for the existing ServiceBus NameSpace/Queue/Topic.
51-
72+
- Gets AuthorizationRule / List of AuthorizationRules for the existing ServiceBus NameSpace/Queue/Topic.
5273
- Set-AzureRmServiceBusAuthorizationRule
53-
- Updates properties of existing AuthorizationRule of Servicebus NameSpace/Queue/Topic.
54-
74+
- Updates properties of existing AuthorizationRule of Servicebus NameSpace/Queue/Topic.
5575
- New-AzureRmServiceBusKey
56-
- Generates a new Primary/Secondary Key for AuthorizationRule of existing ServiceBus NameSpace/Queue/Topic.
57-
76+
- Generates a new Primary/Secondary Key for AuthorizationRule of existing ServiceBus NameSpace/Queue/Topic.
5877
- Get-AzureRmServiceBusKey
59-
- Gets Primary/Secondary Key for AuthorizationRule of existing ServiceBus NameSpace/Queue/Topic.
60-
78+
- Gets Primary/Secondary Key for AuthorizationRule of existing ServiceBus NameSpace/Queue/Topic.
6179
- Remove-AzureRmServiceBusNamespaceAuthorizationRule
62-
- Deletes the existing AuthorizationRule of ServiceBus NameSpace/Queue/Topic.
63-
64-
* Added Resource Group property to NamespceAttributes
65-
80+
- Deletes the existing AuthorizationRule of ServiceBus NameSpace/Queue/Topic.
81+
* Added Resource Group property to NamespceAttributes
6682
* Sql
6783
* Updating Set-AzureRmSqlServerTransparentDataEncryptionProtector to display a warning and require confirmation if the Encryption Protector Type is being set to AzureKeyVault
6884
* Adding new updated cmdlets for Auditing settings
@@ -83,10 +99,10 @@
8399
* Add NeworkRule support to resource mode storage account cmdlets
84100
- New-AzureRmStorageAccount
85101
- Set-AzureRmStorageAccount
86-
- Get-AzureStorageAccountNetworkRuleSet
87-
- Update-AzureStorageAccountNetworkRuleSet
88-
- Add-AzureStorageAccountNetworkRule
89-
- Remove-AzureStorageAccountNetworkRule
102+
- Get-AzureRmStorageAccountNetworkRuleSet
103+
- Update-AzureRmStorageAccountNetworkRuleSet
104+
- Add-AzureRmStorageAccountNetworkRule
105+
- Remove-AzureRmStorageAccountNetworkRule
90106

91107
## 2017.07.17 - Version 4.2.1
92108
* Compute

NuGet.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<add key="local-feed" value="tools/LocalFeed" />
5-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
77
<add key="powershell-core" value="https://powershell.myget.org/F/powershell-core/api/v3/index.json" />
88
</packageSources>

src/Common/Commands.Common/AzureDataCmdlet.cs

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -111,48 +111,19 @@ protected override void SaveDataCollectionProfile()
111111
WriteWarning(string.Format(Resources.DataCollectionSaveFileInformation, fileFullPath));
112112
}
113113

114-
protected override void PromptForDataCollectionProfileIfNotExists()
114+
protected override void SetDataCollectionProfileIfNotExists()
115115
{
116-
// Initialize it from the environment variable or profile file.
117116
InitializeDataCollectionProfile();
118117

119-
if (!_dataCollectionProfile.EnableAzureDataCollection.HasValue && CheckIfInteractive())
118+
if (_dataCollectionProfile.EnableAzureDataCollection.HasValue)
120119
{
121-
WriteWarning(Resources.DataCollectionPrompt);
122-
123-
const double timeToWaitInSeconds = 60;
124-
var status = string.Format(Resources.DataCollectionConfirmTime, timeToWaitInSeconds);
125-
ProgressRecord record = new ProgressRecord(0, Resources.DataCollectionActivity, status);
126-
127-
var startTime = DateTime.Now;
128-
var endTime = DateTime.Now;
129-
double elapsedSeconds = 0;
130-
131-
while (!this.Host.UI.RawUI.KeyAvailable && elapsedSeconds < timeToWaitInSeconds)
132-
{
133-
TestMockSupport.Delay(10 * 1000);
134-
endTime = DateTime.Now;
135-
136-
elapsedSeconds = (endTime - startTime).TotalSeconds;
137-
record.PercentComplete = ((int)elapsedSeconds * 100 / (int)timeToWaitInSeconds);
138-
WriteProgress(record);
139-
}
140-
141-
bool enabled = false;
142-
if (this.Host.UI.RawUI.KeyAvailable)
143-
{
144-
KeyInfo keyInfo =
145-
this.Host.UI.RawUI.ReadKey(ReadKeyOptions.NoEcho | ReadKeyOptions.AllowCtrlC |
146-
ReadKeyOptions.IncludeKeyDown);
147-
enabled = (keyInfo.Character == 'Y' || keyInfo.Character == 'y');
148-
}
149-
150-
_dataCollectionProfile.EnableAzureDataCollection = enabled;
120+
return;
121+
}
151122

152-
WriteWarning(enabled ? Resources.DataCollectionConfirmYes : Resources.DataCollectionConfirmNo);
123+
WriteWarning(Resources.RDFEDataCollectionMessage);
153124

154-
SaveDataCollectionProfile();
155-
}
125+
_dataCollectionProfile.EnableAzureDataCollection = true;
126+
SaveDataCollectionProfile();
156127
}
157128

158129
protected override void InitializeQosEvent()

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,32 @@ protected static void InitializeDataCollectionProfile()
138138
if (string.Equals(value, bool.FalseString, StringComparison.OrdinalIgnoreCase))
139139
{
140140
// Disable data collection only if it is explicitly set to 'false'.
141-
_dataCollectionProfile = new AzurePSDataCollectionProfile(true);
141+
_dataCollectionProfile = new AzurePSDataCollectionProfile(false);
142142
}
143143
else if (string.Equals(value, bool.TrueString, StringComparison.OrdinalIgnoreCase))
144144
{
145145
// Enable data collection only if it is explicitly set to 'true'.
146-
_dataCollectionProfile = new AzurePSDataCollectionProfile(false);
146+
_dataCollectionProfile = new AzurePSDataCollectionProfile(true);
147147
}
148148
}
149149

150150
// If the environment value is null or empty, or not correctly set, try to read the setting from default file location.
151151
if (_dataCollectionProfile == null)
152152
{
153+
// If it exists, remove the old AzureDataCollectionProfile.json file
154+
string oldFileFullPath = Path.Combine(AzurePowerShell.ProfileDirectory,
155+
AzurePSDataCollectionProfile.OldDefaultFileName);
156+
if (AzureSession.Instance.DataStore.FileExists(oldFileFullPath))
157+
{
158+
AzureSession.Instance.DataStore.DeleteFile(oldFileFullPath);
159+
}
160+
161+
// Try and read from the new AzurePSDataCollectionProfile.json file
153162
string fileFullPath = Path.Combine(AzurePowerShell.ProfileDirectory,
154163
AzurePSDataCollectionProfile.DefaultFileName);
155-
if (File.Exists(fileFullPath))
164+
if (AzureSession.Instance.DataStore.FileExists(fileFullPath))
156165
{
157-
string contents = File.ReadAllText(fileFullPath);
166+
string contents = AzureSession.Instance.DataStore.ReadFileAsText(fileFullPath);
158167
_dataCollectionProfile =
159168
JsonConvert.DeserializeObject<AzurePSDataCollectionProfile>(contents);
160169
}
@@ -234,7 +243,7 @@ protected bool CheckIfInteractive()
234243
/// <summary>
235244
/// Prompt for the current data collection profile
236245
/// </summary>
237-
protected abstract void PromptForDataCollectionProfileIfNotExists();
246+
protected abstract void SetDataCollectionProfileIfNotExists();
238247

239248
protected virtual void LogCmdletStartInvocationInfo()
240249
{
@@ -294,7 +303,7 @@ protected virtual void TearDownHttpClientPipeline()
294303
/// </summary>
295304
protected override void BeginProcessing()
296305
{
297-
PromptForDataCollectionProfileIfNotExists();
306+
SetDataCollectionProfileIfNotExists();
298307
InitializeQosEvent();
299308
LogCmdletStartInvocationInfo();
300309
SetupDebuggingTraces();

src/Common/Commands.Common/AzurePSDataCollectionProfile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ namespace Microsoft.WindowsAzure.Commands.Common
1919
public class AzurePSDataCollectionProfile
2020
{
2121
public const string EnvironmentVariableName = "Azure_PS_Data_Collection";
22-
public static string DefaultFileName = "AzureDataCollectionProfile.json";
22+
public static string OldDefaultFileName = "AzureDataCollectionProfile.json";
23+
public static string DefaultFileName = "AzurePSDataCollectionProfile.json";
2324

2425
public AzurePSDataCollectionProfile()
2526
{

src/Common/Commands.Common/Extensions/CmdletExtensions.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.WindowsAzure.Commands.Common;
1516
using System;
1617
using System.Collections.Generic;
1718
using System.Collections.ObjectModel;
@@ -216,6 +217,18 @@ public static void InvokeEndProcessing(this PSCmdlet cmdlt)
216217
dynMethod.Invoke(cmdlt, null);
217218
}
218219

220+
public static void EnableDataCollection(this AzurePSCmdlet cmdlt)
221+
{
222+
FieldInfo dynField = (typeof(AzurePSCmdlet)).GetField("_dataCollectionProfile", BindingFlags.NonPublic | BindingFlags.Static);
223+
dynField.SetValue(cmdlt, new AzurePSDataCollectionProfile(true));
224+
}
225+
226+
public static void DisableDataCollection(this AzurePSCmdlet cmdlt)
227+
{
228+
FieldInfo dynField = (typeof(AzurePSCmdlet)).GetField("_dataCollectionProfile", BindingFlags.NonPublic | BindingFlags.Static);
229+
dynField.SetValue(cmdlt, new AzurePSDataCollectionProfile(false));
230+
}
231+
219232
#endregion
220233
}
221234
}

src/Common/Commands.Common/MetricHelper.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
using System;
2222
using System.Collections.Generic;
2323
using System.Diagnostics;
24+
using System.Linq;
25+
using System.Net.NetworkInformation;
2426
using System.Security.Cryptography;
2527
using System.Text;
2628

@@ -52,6 +54,24 @@ public class MetricHelper
5254
/// </summary>
5355
private readonly object _lock = new object();
5456

57+
private static string _hashMacAddress = string.Empty;
58+
59+
private static string HashMacAddress
60+
{
61+
get
62+
{
63+
if (_hashMacAddress == string.Empty)
64+
{
65+
var macAddress = NetworkInterface.GetAllNetworkInterfaces()
66+
.FirstOrDefault(nic => nic.OperationalStatus == OperationalStatus.Up)?
67+
.GetPhysicalAddress()?.ToString();
68+
_hashMacAddress = macAddress == null ? null : GenerateSha256HashString(macAddress).Replace("-", string.Empty).ToLowerInvariant();
69+
}
70+
71+
return _hashMacAddress;
72+
}
73+
}
74+
5575
public MetricHelper()
5676
{
5777
if (TestMockSupport.RunningMocked)
@@ -177,6 +197,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
177197
eventProperties.Add("UserId", qos.Uid);
178198
eventProperties.Add("x-ms-client-request-id", qos.ClientRequestId);
179199
eventProperties.Add("UserAgent", AzurePowerShell.UserAgentValue.ToString());
200+
eventProperties.Add("HashMacAddress", HashMacAddress);
180201
if (qos.InputFromPipeline != null)
181202
{
182203
eventProperties.Add("InputFromPipeline", qos.InputFromPipeline.Value.ToString());

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 29 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)