Skip to content

Commit 05b8320

Browse files
authored
Merge pull request Azure#3854 from AuxMon/OnlyNewMetrics
Using the new .Net SDK and introducing the breaking changes in the Metrics API after the warning period
2 parents 7dbe6d6 + 5e86fcb commit 05b8320

File tree

190 files changed

+1487
-10649
lines changed

Some content is hidden

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

190 files changed

+1487
-10649
lines changed

setup/azurecmdfiles.wxi

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,24 +1580,12 @@
15801580
<Component Id="cmp652574B007D36760A8F3951C8BBCBA73" Guid="*">
15811581
<File Id="filCDCD5137F842104C0DCEBDE8C282E168" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Azure.Common.NetFramework.dll" />
15821582
</Component>
1583-
<Component Id="cmp19A1422310791548B2EE9CC01D0E80AB" Guid="*">
1584-
<File Id="fil775FC63E54E73F93CF6A7DD79AA7766F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Azure.Insights.dll" />
1585-
</Component>
1586-
<Component Id="cmpAB0BE651457D19885EE5BD5615E283A9" Guid="*">
1587-
<File Id="fil7C8081F59D42A001771050D89E11D7CB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Azure.KeyVault.Core.dll" />
1588-
</Component>
1589-
<Component Id="cmpBE9F3609F315D89DE19004AC7E629A12" Guid="*">
1590-
<File Id="filFED788047F438C9397D43C0F1F5AA7A6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Data.Edm.dll" />
1591-
</Component>
1592-
<Component Id="cmp45E9D11A1E7E15837ADBF6220B8DFD7E" Guid="*">
1593-
<File Id="fil68988BF4794EF93E735022A7BFF20997" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Data.OData.dll" />
1594-
</Component>
1595-
<Component Id="cmp95FB8932F45A41F4AF974FB6F565B75C" Guid="*">
1596-
<File Id="filFA94C707722DFF90E974DB5BC3D375E1" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Data.Services.Client.dll" />
1597-
</Component>
15981583
<Component Id="cmpC9466F4B506234EBA66C4F1204C0CD5D" Guid="*">
15991584
<File Id="fil923B64CC593E3BC837C3F9B6227E8342" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
16001585
</Component>
1586+
<Component Id="cmp19A1422310791548B2EE9CC01D0E80AB" Guid="*">
1587+
<File Id="fil775FC63E54E73F93CF6A7DD79AA7766F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Azure.Management.Monitor.dll" />
1588+
</Component>
16011589
<Component Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" Guid="*">
16021590
<File Id="fil0BC58752DC9792178625EA842D496953" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
16031591
</Component>
@@ -1610,24 +1598,12 @@
16101598
<Component Id="cmpE2B4EA9CCA75508B10345C79226A99BF" Guid="*">
16111599
<File Id="filCA417FF06BB88827F1DDD15499A06D27" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Threading.Tasks.dll" />
16121600
</Component>
1613-
<Component Id="cmp1A1353B6954892B25E4CF5A7F1208CB1" Guid="*">
1614-
<File Id="filED725745AFD8548355339E53DF3C8AEC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
1615-
</Component>
1616-
<Component Id="cmpDF4CF9188B16A6B4C6C76ACC36D49FF0" Guid="*">
1617-
<File Id="filA31B802F0B9BA67ED80BA3D8D91164DC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Threading.Tasks.Extensions.dll" />
1618-
</Component>
16191601
<Component Id="cmp545597FAE11FE5F91F4BDCD56D1DFE83" Guid="*">
16201602
<File Id="fil928770DD46031339492018E2CD7D9BCC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.WindowsAzure.Commands.Common.dll" />
16211603
</Component>
1622-
<Component Id="cmpD0CBA309930AE994CD67A5EB7C9B5B10" Guid="*">
1623-
<File Id="filF4A2BE56AA42EB88C96B3F8DF53F8F6C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.WindowsAzure.Storage.dll" />
1624-
</Component>
16251604
<Component Id="cmp7781002FCC3D1B3F0519A286C3E916E9" Guid="*">
16261605
<File Id="fil7A9F66CF061583CA28B0DA562E249A8B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Newtonsoft.Json.dll" />
16271606
</Component>
1628-
<Component Id="cmp09C89A8B21C5D2C4595F1D35C982F73B" Guid="*">
1629-
<File Id="filF161B346D39B2AA99CBA7434BC7AD7C6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\System.Spatial.dll" />
1630-
</Component>
16311607
</Directory>
16321608
<Directory Id="dirF584E982D38358ACFBC86D63B65C660D" Name="AzureRM.IotHub">
16331609
<Component Id="cmp15C1FCDD65CEFB52792FB6ED02513E11" Guid="*">
@@ -6244,21 +6220,13 @@
62446220
<ComponentRef Id="cmpA848C04563692D93B90821EE8960E3B4" />
62456221
<ComponentRef Id="cmp652574B007D36760A8F3951C8BBCBA73" />
62466222
<ComponentRef Id="cmp19A1422310791548B2EE9CC01D0E80AB" />
6247-
<ComponentRef Id="cmpAB0BE651457D19885EE5BD5615E283A9" />
6248-
<ComponentRef Id="cmpBE9F3609F315D89DE19004AC7E629A12" />
6249-
<ComponentRef Id="cmp45E9D11A1E7E15837ADBF6220B8DFD7E" />
6250-
<ComponentRef Id="cmp95FB8932F45A41F4AF974FB6F565B75C" />
62516223
<ComponentRef Id="cmpC9466F4B506234EBA66C4F1204C0CD5D" />
62526224
<ComponentRef Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" />
62536225
<ComponentRef Id="cmpE389288C5CA88334DBFAA1A298DFDC57" />
62546226
<ComponentRef Id="cmpE0A4360ECC0B00A74E3D29F280B2FD2E" />
62556227
<ComponentRef Id="cmpE2B4EA9CCA75508B10345C79226A99BF" />
6256-
<ComponentRef Id="cmp1A1353B6954892B25E4CF5A7F1208CB1" />
6257-
<ComponentRef Id="cmpDF4CF9188B16A6B4C6C76ACC36D49FF0" />
62586228
<ComponentRef Id="cmp545597FAE11FE5F91F4BDCD56D1DFE83" />
6259-
<ComponentRef Id="cmpD0CBA309930AE994CD67A5EB7C9B5B10" />
62606229
<ComponentRef Id="cmp7781002FCC3D1B3F0519A286C3E916E9" />
6261-
<ComponentRef Id="cmp09C89A8B21C5D2C4595F1D35C982F73B" />
62626230
<ComponentRef Id="cmp15C1FCDD65CEFB52792FB6ED02513E11" />
62636231
<ComponentRef Id="cmpA2E684A10B5D1FE61816950EA488B619" />
62646232
<ComponentRef Id="cmp66C6BE87523BE39FE5A322FE66E678E7" />

src/ResourceManager/Insights/Commands.Insights.Test/Events/GetAzureRmLogTests.cs renamed to src/ResourceManager/Insights/Commands.Insights.Test/ActivityLogs/GetAzureRmLogTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
using System.Collections.Generic;
1616
using Microsoft.Azure.Commands.Insights.Events;
17-
using Microsoft.Azure.Insights;
18-
using Microsoft.Azure.Insights.Models;
17+
using Microsoft.Azure.Management.Monitor;
18+
using Microsoft.Azure.Management.Monitor.Models;
1919
using Microsoft.Rest.Azure;
2020
using Microsoft.Rest.Azure.OData;
2121
using Microsoft.WindowsAzure.Commands.ScenarioTest;
@@ -31,8 +31,8 @@ namespace Microsoft.Azure.Commands.Insights.Test.Events
3131
public class GetAzureRmLogTests
3232
{
3333
private readonly GetAzureRmLogCommand cmdlet;
34-
private readonly Mock<InsightsClient> insightsClientMock;
35-
private readonly Mock<IEventsOperations> insightsEventOperationsMock;
34+
private readonly Mock<MonitorClient> MonitorClientMock;
35+
private readonly Mock<IActivityLogsOperations> insightsEventOperationsMock;
3636
private Mock<ICommandRuntime> commandRuntimeMock;
3737
private AzureOperationResponse<IPage<EventData>> response;
3838
private ODataQuery<EventData> filter;
@@ -41,13 +41,13 @@ public class GetAzureRmLogTests
4141
public GetAzureRmLogTests(Xunit.Abstractions.ITestOutputHelper output)
4242
{
4343
//ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
44-
insightsEventOperationsMock = new Mock<IEventsOperations>();
45-
insightsClientMock = new Mock<InsightsClient>();
44+
insightsEventOperationsMock = new Mock<IActivityLogsOperations>();
45+
MonitorClientMock = new Mock<MonitorClient>();
4646
commandRuntimeMock = new Mock<ICommandRuntime>();
4747
cmdlet = new GetAzureRmLogCommand()
4848
{
4949
CommandRuntime = commandRuntimeMock.Object,
50-
InsightsClient = insightsClientMock.Object
50+
MonitorClient = MonitorClientMock.Object
5151
};
5252

5353
response = Utilities.InitializeResponse();
@@ -60,7 +60,7 @@ public GetAzureRmLogTests(Xunit.Abstractions.ITestOutputHelper output)
6060
selected = s;
6161
});
6262

63-
insightsClientMock.SetupGet(f => f.Events).Returns(this.insightsEventOperationsMock.Object);
63+
MonitorClientMock.SetupGet(f => f.ActivityLogs).Returns(this.insightsEventOperationsMock.Object);
6464
}
6565

6666
[Fact]

src/ResourceManager/Insights/Commands.Insights.Test/Alerts/AddAzureRmLogAlertRuleTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Insights.Alerts;
16-
using Microsoft.Azure.Management.Insights;
17-
using Microsoft.Azure.Management.Insights.Models;
16+
using Microsoft.Azure.Management.Monitor.Management;
17+
using Microsoft.Azure.Management.Monitor.Management.Models;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1919
using Moq;
2020
using System;
@@ -31,7 +31,7 @@ namespace Microsoft.Azure.Commands.Insights.Test.Alerts
3131
public class AddAzureRmLogAlertRuleTests
3232
{
3333
private readonly AddAzureRmLogAlertRuleCommand cmdlet;
34-
private readonly Mock<InsightsManagementClient> insightsManagementClientMock;
34+
private readonly Mock<MonitorManagementClient> insightsManagementClientMock;
3535
private readonly Mock<IAlertRulesOperations> insightsAlertRuleOperationsMock;
3636
private Mock<ICommandRuntime> commandRuntimeMock;
3737
private Rest.Azure.AzureOperationResponse<AlertRuleResource> response;
@@ -42,15 +42,21 @@ public AddAzureRmLogAlertRuleTests(ITestOutputHelper output)
4242
{
4343
// XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
4444
insightsAlertRuleOperationsMock = new Mock<IAlertRulesOperations>();
45-
insightsManagementClientMock = new Mock<InsightsManagementClient>();
45+
insightsManagementClientMock = new Mock<MonitorManagementClient>();
4646
commandRuntimeMock = new Mock<ICommandRuntime>();
4747
cmdlet = new AddAzureRmLogAlertRuleCommand()
4848
{
4949
CommandRuntime = commandRuntimeMock.Object,
50-
InsightsManagementClient = insightsManagementClientMock.Object
50+
MonitorManagementClient = insightsManagementClientMock.Object
51+
};
52+
53+
AlertRuleResource alertRuleResourceInput = new AlertRuleResource()
54+
{
55+
Location = null,
56+
IsEnabled = true,
57+
AlertRuleResourceName = "a name"
5158
};
5259

53-
AlertRuleResource alertRuleResourceInput = new AlertRuleResource(location: null, isEnabled: true, alertRuleResourceName: "a name");
5460
response = new Rest.Azure.AzureOperationResponse<AlertRuleResource>()
5561
{
5662
Body = alertRuleResourceInput

src/ResourceManager/Insights/Commands.Insights.Test/Alerts/AddAzureRmMetricAlertRuleTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Insights.Alerts;
16-
using Microsoft.Azure.Management.Insights;
17-
using Microsoft.Azure.Management.Insights.Models;
16+
using Microsoft.Azure.Management.Monitor.Management;
17+
using Microsoft.Azure.Management.Monitor.Management.Models;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1919
using Moq;
2020
using System;
@@ -31,7 +31,7 @@ namespace Microsoft.Azure.Commands.Insights.Test.Alerts
3131
public class AddAzureRmMetricAlertRuleTests
3232
{
3333
private readonly AddAzureRmMetricAlertRuleCommand cmdlet;
34-
private readonly Mock<InsightsManagementClient> insightsManagementClientMock;
34+
private readonly Mock<MonitorManagementClient> insightsManagementClientMock;
3535
private readonly Mock<IAlertRulesOperations> insightsAlertRuleOperationsMock;
3636
private Mock<ICommandRuntime> commandRuntimeMock;
3737
private Rest.Azure.AzureOperationResponse<AlertRuleResource> response;
@@ -42,15 +42,21 @@ public AddAzureRmMetricAlertRuleTests(ITestOutputHelper output)
4242
{
4343
//XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
4444
insightsAlertRuleOperationsMock = new Mock<IAlertRulesOperations>();
45-
insightsManagementClientMock = new Mock<InsightsManagementClient>();
45+
insightsManagementClientMock = new Mock<MonitorManagementClient>();
4646
commandRuntimeMock = new Mock<ICommandRuntime>();
4747
cmdlet = new AddAzureRmMetricAlertRuleCommand()
4848
{
4949
CommandRuntime = commandRuntimeMock.Object,
50-
InsightsManagementClient = insightsManagementClientMock.Object
50+
MonitorManagementClient = insightsManagementClientMock.Object
51+
};
52+
53+
AlertRuleResource alertRuleResourceInput = new AlertRuleResource()
54+
{
55+
AlertRuleResourceName = "a name",
56+
Location = null,
57+
IsEnabled = true
5158
};
5259

53-
AlertRuleResource alertRuleResourceInput = new AlertRuleResource(alertRuleResourceName: "a name", location: null, isEnabled: true);
5460
response = new Rest.Azure.AzureOperationResponse<AlertRuleResource>()
5561
{
5662
Body = alertRuleResourceInput

src/ResourceManager/Insights/Commands.Insights.Test/Alerts/AddAzureRmWebtestAlertRuleTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Insights.Alerts;
16-
using Microsoft.Azure.Management.Insights;
17-
using Microsoft.Azure.Management.Insights.Models;
16+
using Microsoft.Azure.Management.Monitor.Management;
17+
using Microsoft.Azure.Management.Monitor.Management.Models;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1919
using Moq;
2020
using System;
@@ -31,7 +31,7 @@ namespace Microsoft.Azure.Commands.Insights.Test.Alerts
3131
public class AddAzureRmWebtestAlertRuleTests
3232
{
3333
private readonly AddAzureRmWebtestAlertRuleCommand cmdlet;
34-
private readonly Mock<InsightsManagementClient> insightsManagementClientMock;
34+
private readonly Mock<MonitorManagementClient> insightsManagementClientMock;
3535
private readonly Mock<IAlertRulesOperations> insightsAlertRuleOperationsMock;
3636
private Mock<ICommandRuntime> commandRuntimeMock;
3737
private Rest.Azure.AzureOperationResponse<AlertRuleResource> response;
@@ -42,15 +42,21 @@ public AddAzureRmWebtestAlertRuleTests(ITestOutputHelper output)
4242
{
4343
//XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
4444
insightsAlertRuleOperationsMock = new Mock<IAlertRulesOperations>();
45-
insightsManagementClientMock = new Mock<InsightsManagementClient>();
45+
insightsManagementClientMock = new Mock<MonitorManagementClient>();
4646
commandRuntimeMock = new Mock<ICommandRuntime>();
4747
cmdlet = new AddAzureRmWebtestAlertRuleCommand()
4848
{
4949
CommandRuntime = commandRuntimeMock.Object,
50-
InsightsManagementClient = insightsManagementClientMock.Object
50+
MonitorManagementClient = insightsManagementClientMock.Object
51+
};
52+
53+
AlertRuleResource alertRuleResourceInput = new AlertRuleResource()
54+
{
55+
Location = null,
56+
IsEnabled = true,
57+
AlertRuleResourceName = "a name"
5158
};
5259

53-
AlertRuleResource alertRuleResourceInput = new AlertRuleResource(location: null, isEnabled: true, alertRuleResourceName: "a name");
5460
response = new Rest.Azure.AzureOperationResponse<AlertRuleResource>()
5561
{
5662
Body = alertRuleResourceInput

src/ResourceManager/Insights/Commands.Insights.Test/Alerts/GetAzureRmAlertHistoryTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
using System.Collections.Generic;
1616
using Microsoft.Azure.Commands.Insights.Alerts;
17-
using Microsoft.Azure.Insights;
18-
using Microsoft.Azure.Insights.Models;
17+
using Microsoft.Azure.Management.Monitor;
18+
using Microsoft.Azure.Management.Monitor.Models;
1919
using Microsoft.Rest.Azure;
2020
using Microsoft.Rest.Azure.OData;
2121
using Microsoft.WindowsAzure.Commands.ScenarioTest;
@@ -32,8 +32,8 @@ namespace Microsoft.Azure.Commands.Insights.Test.Alerts
3232
public class GetAzureRmAlertHistoryTests
3333
{
3434
private readonly GetAzureRmAlertHistoryCommand cmdlet;
35-
private readonly Mock<InsightsClient> insightsClientMock;
36-
private readonly Mock<IEventsOperations> insightsEventOperationsMock;
35+
private readonly Mock<MonitorClient> MonitorClientMock;
36+
private readonly Mock<IActivityLogsOperations> insightsEventOperationsMock;
3737
private Mock<ICommandRuntime> commandRuntimeMock;
3838
private AzureOperationResponse<IPage<EventData>> response;
3939
private ODataQuery<EventData> filter;
@@ -42,13 +42,13 @@ public class GetAzureRmAlertHistoryTests
4242
public GetAzureRmAlertHistoryTests(ITestOutputHelper output)
4343
{
4444
//XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
45-
insightsEventOperationsMock = new Mock<IEventsOperations>();
46-
insightsClientMock = new Mock<InsightsClient>();
45+
insightsEventOperationsMock = new Mock<IActivityLogsOperations>();
46+
MonitorClientMock = new Mock<MonitorClient>();
4747
commandRuntimeMock = new Mock<ICommandRuntime>();
4848
cmdlet = new GetAzureRmAlertHistoryCommand()
4949
{
5050
CommandRuntime = commandRuntimeMock.Object,
51-
InsightsClient = insightsClientMock.Object
51+
MonitorClient = MonitorClientMock.Object
5252
};
5353

5454
response = Test.Utilities.InitializeResponse();
@@ -61,7 +61,7 @@ public GetAzureRmAlertHistoryTests(ITestOutputHelper output)
6161
selected = s;
6262
});
6363

64-
insightsClientMock.SetupGet(f => f.Events).Returns(this.insightsEventOperationsMock.Object);
64+
MonitorClientMock.SetupGet(f => f.ActivityLogs).Returns(this.insightsEventOperationsMock.Object);
6565
}
6666

6767
[Fact]

0 commit comments

Comments
 (0)