Skip to content

Commit 06e0af3

Browse files
committed
Pull latest changes from Azure/Dev
2 parents 9cd5d12 + a343619 commit 06e0af3

File tree

223 files changed

+23090
-11985
lines changed

Some content is hidden

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

223 files changed

+23090
-11985
lines changed

AzurePowershell.Test.targets

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@
8888
<XUnitTests Include=".\src\ResourceManager\NotificationHubs\Commands.NotificationHubs.Test\bin\Debug\Microsoft.Azure.Commands.NotificationHubs.Test.dll"/>
8989
<XUnitTests Include=".\src\ResourceManager\Cdn\Commands.Cdn.Test\bin\Debug\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.dll"/>
9090
<XUnitTests Include=".\src\ResourceManager\CognitiveServices\CognitiveServices.Test\bin\Debug\Microsoft.Azure.Commands.Management.CognitiveServices.Test.dll"/>
91+
<XUnitTests Include=".\src\ResourceManager\Automation\Commands.Automation.Test\bin\Debug\Microsoft.Azure.Commands.ResourceManager.Automation.Test.dll"/>
92+
<!-- <XUnitTests Include=".\src\ResourceManager\AzureStackAdmin\Commands.AzureStackAdmin.Test\bin\Debug\Microsoft.AzureStack.Commands.Admin.Test.dll"/>
93+
<XUnitTests Include=".\src\ResourceManager\AzureStackStorage\Commands.AzureStackStorage.Tests\bin\Debug\Microsoft.AzureStack.Commands.StorageAdmin.Test.dll"/>
94+
<XUnitTests Include=".\src\ResourceManager\DataLakeAnalytics\Commands.DataLakeAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.DataLakeAnalytics.Test.dll"/>
95+
<XUnitTests Include=".\src\ResourceManager\DataLakeStore\Commands.DataLakeStore.Test\bin\Debug\Microsoft.Azure.Commands.DataLake.Test.dll"/>
96+
<XUnitTests Include=".\src\ResourceManager\DevTestLabs\Commands.DevTestLabs.Test\bin\Debug\Microsoft.Azure.Commands.DevTestLabs.Test.dll"/>
97+
<XUnitTests Include=".\src\ResourceManager\HDInsight\Commands.HDInsight.Test\bin\Debug\Commands.HDInsight.Test.dll"/>
98+
<XUnitTests Include=".\src\ResourceManager\Insights\Commands.Insights.Test\bin\Debug\Microsoft.Azure.Commands.Insights.Test.dll"/>
99+
<XUnitTests Include=".\src\ResourceManager\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServicesArm.Test.dll"/>
100+
<XUnitTests Include=".\src\ResourceManager\RecoveryServices.Backup\Commands.RecoveryServices.Backup.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.dll"/> -->
101+
<XUnitTests Include=".\src\ResourceManager\RedisCache\Commands.RedisCache.Test\bin\Debug\Microsoft.Azure.Commands.RedisCache.Test.dll"/>
102+
<!--<XUnitTests Include=".\src\ResourceManager\ServerManagement\Commands.ServerManagement.Test\bin\Debug\Microsoft.Azure.Commands.ServerManagement.Test.dll"/>
103+
<XUnitTests Include=".\src\ResourceManager\Storage\Commands.Management.Storage.Test\bin\Debug\Microsoft.Azure.Commands.Management.Storage.Test.dll"/>-->
91104
<XUnitTests Include=".\src\ResourceManager\HDInsight\Commands.HDInsight.Test\bin\Debug\Commands.HDInsight.Test.dll"/>
92105
<XUnitTests Include=".\src\Common\Commands.Common.Authentication.Test\bin\Debug\Microsoft.Azure.Commands.Common.Authentication.Test.dll"/>
93106
<XUnitTests Include="@(AsmXUnitTests)"/>

ChangeLog.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
##2016.07.04 version 1.6.0
2+
* Azure SQL DB Backup/Restore
3+
* Cmdlets for LTR (Long Term Retention) backup feature
4+
* Get-AzureRmSqlServerBackupLongTermRetentionVault
5+
* Get-AzureRmSqlDatabaseBackupLongTermRetentionPolicy
6+
* Set-AzureRmSqlServerBackupLongTermRetentionVault
7+
* Set-AzureRmSqlDatabaseBackupLongTermRetentionPolicy
8+
* Restore-AzureRmSqlDatabase now supports point-in-time restore of a deleted database
9+
* Restore-AzureRmSqlDatabase now supports restoring from a Long Term Retention backup
10+
111
##2016.06.01 version 1.5.0
212
* Azure Resource Manager
313
- (Get/Set/New/Remove)-AzureRmResourceGroup cmdlets will now use the new autorest generated ARM assembly
@@ -279,7 +289,7 @@
279289
- New-AzureStorageShareSASToken
280290
- New-AzureStorageQueueSASToken
281291
- New-AzureStorageTableSASToken
282-
* Azure SQL DB Backup/restore
292+
* Azure SQL DB Backup/Restore
283293
* Get-AzureRmSqlDatabaseGeoBackup
284294
* Get-AzureRmSqlDeletedDatabaseBackup
285295
* Restore-AzureRmSqlDatabase

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,6 @@ If you encounter any bugs with the library please file an issue in the [Issues](
197197
# Learn More
198198

199199
* [Microsoft Azure Script Center](https://azure.microsoft.com/en-us/documentation/scripts/)
200+
201+
---
202+
_This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments._

src/ResourceManager/Automation/Commands.Automation/Common/AutomationClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public CredentialInfo CreateCredential(string resourceGroupName, string automati
867867

868868
if (createdCredential == null || createdCredential.StatusCode != HttpStatusCode.Created)
869869
{
870-
new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Create",
870+
throw new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Create",
871871
"credential", name, automationAccountName));
872872
}
873873
return new CredentialInfo(resourceGroupName, automationAccountName, createdCredential.Credential);
@@ -891,7 +891,7 @@ public CredentialInfo UpdateCredential(string resourceGroupName, string automati
891891

892892
if (credential == null || credential.StatusCode != HttpStatusCode.OK)
893893
{
894-
new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Update",
894+
throw new AzureAutomationOperationException(string.Format(Resources.AutomationOperationFailed, "Update",
895895
"credential", name, automationAccountName));
896896
}
897897

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public override void ExecuteCmdlet()
9090
throw new Exception(Resources.AzureBackupJobArguementException);
9191
}
9292
WriteDebug(Resources.SettingStartTime);
93-
From = new DateTime();
9493
From = AzureBackupJobHelper.MinimumAllowedDate;
9594
}
9695

@@ -112,7 +111,6 @@ public override void ExecuteCmdlet()
112111
else
113112
{
114113
WriteDebug(Resources.SettingEndTime);
115-
To = new DateTime();
116114
To = AzureBackupJobHelper.MinimumAllowedDate;
117115
}
118116
}

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/WaitAzureRMBackupJob.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public override void ExecuteCmdlet()
9696
{
9797
if (!TimeOut.HasValue)
9898
{
99-
TimeOut = new long();
10099
TimeOut = Int64.MaxValue;
101100
}
102101

src/ResourceManager/AzureBatch/Commands.Batch.Test/BatchTestHelpers.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ namespace Microsoft.Azure.Commands.Batch.Test
3737
/// </summary>
3838
public static class BatchTestHelpers
3939
{
40-
internal static readonly string TestCertificateFileName1 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\BatchTestCert01.cer");
41-
internal static readonly string TestCertificateFileName2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\BatchTestCert02.cer");
40+
internal static readonly string TestCertificateFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\BatchTestCert01.cer");
4241
internal const string TestCertificateAlgorithm = "sha1";
4342
internal const string TestCertificatePassword = "Passw0rd";
4443
internal static readonly int DefaultQuotaCount = 20;

src/ResourceManager/AzureBatch/Commands.Batch.Test/Certificates/NewBatchCertificateCommandTests.cs

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using Microsoft.Azure.Batch;
1616
using Microsoft.Azure.Batch.Protocol;
17+
using Microsoft.Azure.Batch.Protocol.BatchRequests;
1718
using Microsoft.Azure.Batch.Protocol.Models;
1819
using Microsoft.Rest.Azure;
1920
using Microsoft.WindowsAzure.Commands.ScenarioTest;
@@ -22,6 +23,7 @@
2223
using System.Collections.Generic;
2324
using System.Management.Automation;
2425
using System.Security.Cryptography.X509Certificates;
26+
using System.Threading.Tasks;
2527
using Xunit;
2628
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2729

@@ -47,15 +49,15 @@ public NewBatchCertificateCommandTests(Xunit.Abstractions.ITestOutputHelper outp
4749

4850
[Fact]
4951
[Trait(Category.AcceptanceType, Category.CheckIn)]
50-
public void NewBatchCertificateParametersTest()
52+
public void NewBatchCertificateRequiredParametersTest()
5153
{
5254
// Setup cmdlet without the required parameters
5355
BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();
5456
cmdlet.BatchContext = context;
5557

5658
Assert.Throws<ArgumentException>(() => cmdlet.ExecuteCmdlet());
5759

58-
cmdlet.FilePath = BatchTestHelpers.TestCertificateFileName1;
60+
cmdlet.FilePath = BatchTestHelpers.TestCertificateFileName;
5961

6062
// Don't go to the service on an Add Certificate call
6163
RequestInterceptor interceptor = BatchTestHelpers.CreateFakeServiceResponseInterceptor<
@@ -70,11 +72,80 @@ public void NewBatchCertificateParametersTest()
7072

7173
// Use the RawData parameter set next
7274
cmdlet.FilePath = null;
73-
X509Certificate2 cert = new X509Certificate2(BatchTestHelpers.TestCertificateFileName1);
75+
X509Certificate2 cert = new X509Certificate2(BatchTestHelpers.TestCertificateFileName);
7476
cmdlet.RawData = cert.RawData;
7577

7678
// Verify no exceptions when required parameters are set
7779
cmdlet.ExecuteCmdlet();
7880
}
81+
82+
[Fact]
83+
[Trait(Category.AcceptanceType, Category.CheckIn)]
84+
public void NewBatchCertificateRequestBodyTest()
85+
{
86+
BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();
87+
cmdlet.BatchContext = context;
88+
89+
X509Certificate2 cert = new X509Certificate2(BatchTestHelpers.TestCertificateFileName);
90+
string certDataBase64String = Convert.ToBase64String(cert.RawData);
91+
92+
CertificateAddParameter requestParameters = null;
93+
94+
// Don't go to the service on an Add Certificate call
95+
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
96+
{
97+
CertificateAddBatchRequest request = (CertificateAddBatchRequest)baseRequest;
98+
99+
request.ServiceRequestFunc = (cancellationToken) =>
100+
{
101+
requestParameters = request.Parameters;
102+
103+
var response = new AzureOperationHeaderResponse<CertificateAddHeaders>();
104+
Task<AzureOperationHeaderResponse<CertificateAddHeaders>> task = Task.FromResult(response);
105+
return task;
106+
};
107+
});
108+
109+
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
110+
111+
// Verify that when just the raw data is specified, the request body matches expectations
112+
cmdlet.RawData = cert.RawData;
113+
cmdlet.ExecuteCmdlet();
114+
Assert.Equal(CertificateFormat.Cer, requestParameters.CertificateFormat);
115+
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);
116+
Assert.Equal(cert.Thumbprint.ToLowerInvariant(), requestParameters.Thumbprint.ToLowerInvariant());
117+
Assert.True(string.IsNullOrEmpty(requestParameters.Password));
118+
Assert.Equal(certDataBase64String, requestParameters.Data);
119+
120+
// Verify that when the raw data is specified with a password, the request body matches expectations
121+
cmdlet.RawData = cert.RawData;
122+
cmdlet.Password = BatchTestHelpers.TestCertificatePassword;
123+
cmdlet.ExecuteCmdlet();
124+
Assert.Equal(CertificateFormat.Pfx, requestParameters.CertificateFormat);
125+
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);
126+
Assert.Equal(cert.Thumbprint.ToLowerInvariant(), requestParameters.Thumbprint.ToLowerInvariant());
127+
Assert.Equal(BatchTestHelpers.TestCertificatePassword, requestParameters.Password);
128+
Assert.Equal(certDataBase64String, requestParameters.Data);
129+
130+
// Verify that when just a file path is specified, the request body matches expectations
131+
cmdlet.RawData = null;
132+
cmdlet.Password = null;
133+
cmdlet.FilePath = BatchTestHelpers.TestCertificateFileName;
134+
cmdlet.ExecuteCmdlet();
135+
Assert.Equal(CertificateFormat.Cer, requestParameters.CertificateFormat);
136+
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);
137+
Assert.Equal(cert.Thumbprint.ToLowerInvariant(), requestParameters.Thumbprint.ToLowerInvariant());
138+
Assert.True(string.IsNullOrEmpty(requestParameters.Password));
139+
Assert.Equal(certDataBase64String, requestParameters.Data);
140+
141+
// Verify that when a file path is specified with a password, the request body matches expectations
142+
cmdlet.Password = BatchTestHelpers.TestCertificatePassword;
143+
cmdlet.ExecuteCmdlet();
144+
Assert.Equal(CertificateFormat.Pfx, requestParameters.CertificateFormat);
145+
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);
146+
Assert.Equal(cert.Thumbprint.ToLowerInvariant(), requestParameters.Thumbprint.ToLowerInvariant());
147+
Assert.Equal(BatchTestHelpers.TestCertificatePassword, requestParameters.Password);
148+
Assert.Equal(certDataBase64String, requestParameters.Data);
149+
}
79150
}
80151
}

src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,6 @@
284284
<None Include="Resources\BatchTestCert01.cer">
285285
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
286286
</None>
287-
<None Include="Resources\BatchTestCert02.cer">
288-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
289-
</None>
290-
<None Include="Resources\BatchTestCert03.cer">
291-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
292-
</None>
293-
<None Include="Resources\BatchTestCert04.pfx">
294-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
295-
</None>
296-
<None Include="Resources\BatchTestCert05.pfx">
297-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
298-
</None>
299287
<Content Include="Resources\TestApplicationPackage.zip">
300288
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
301289
</Content>
@@ -371,29 +359,11 @@
371359
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchApplicationTests\TestUploadApplicationPackage.json">
372360
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
373361
</None>
374-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestAddCertificate.json">
375-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
376-
</None>
377362
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestCancelCertificateDelete.json">
378363
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
379364
</None>
380-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestDeleteCertificate.json">
381-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
382-
</None>
383-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestGetAndListCertificatesWithSelect.json">
384-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
385-
</None>
386-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestGetCertificateByThumbprint.json">
387-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
388-
</None>
389-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestListAllCertificates.json">
390-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
391-
</None>
392-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestListCertificatesByFilter.json">
393-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
394-
</None>
395-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestListCertificatesWithMaxCount.json">
396-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
365+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests\TestCertificateCrudOperations.json">
366+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
397367
</None>
398368
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ComputeNodeTests\TestDisableAndEnableComputeNodeSchedulingById.json">
399369
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -695,9 +665,6 @@
695665
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.TaskTests\TestListAllTasks.json">
696666
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
697667
</None>
698-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.TaskTests\TestListSubtasksWithMaxCount.json">
699-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
700-
</None>
701668
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.TaskTests\TestListTaskPipeline.json">
702669
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
703670
</None>
@@ -745,9 +712,6 @@
745712
</ItemGroup>
746713
<ItemGroup>
747714
<Content Include="about.txt" />
748-
<Content Include="Resources\MSMpiSetup.exe">
749-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
750-
</Content>
751715
</ItemGroup>
752716
<ItemGroup>
753717
<WCFMetadata Include="Service References\" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
using Microsoft.Azure.Management.Resources;
2020
using Microsoft.Azure.Test;
2121
using Microsoft.Azure.Test.HttpRecorder;
22+
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2223
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2324
using System;
2425
using System.Collections.Generic;
2526
using System.IO;
2627
using System.Linq;
27-
using Microsoft.Azure.Commands.Common.Authentication;
28-
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2928
using TestBase = Microsoft.Azure.Test.TestBase;
3029
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
3130
using TestUtilities = Microsoft.Azure.Test.TestUtilities;

0 commit comments

Comments
 (0)