Skip to content

Commit 21b99bf

Browse files
committed
Merge branch 'release-0.9.8' of https://github.com/Azure/azure-powershell into r098
2 parents f9f8250 + 7fcccb5 commit 21b99bf

File tree

98 files changed

+29591
-25340
lines changed

Some content is hidden

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

98 files changed

+29591
-25340
lines changed

ChangeLog.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Changed the output format of Get image cmdlets as a table
88
* Fixed Set-AzureVMAccessExtension cmdlet
99
* Azure Compute (Service Management) cmdlets
10-
* Changed the warning message to a non-terminating error message for ResourceNotFound in VM cmdlets
1110
* Exposed ComputeImageConfig in Get-AzurePlatformVMImage cmdlet
1211
* Fixed Publish-AzurePlatformExtension and Set-AzurePlatformExtension cmdlets
1312
* Azure Backup - added the following cmdlets
@@ -35,6 +34,15 @@
3534
* Stop-AzureBatchJob
3635
* Stop-AzureBatchJobSchedule
3736
* Stop-AzureBatchTask
37+
* Azure Data Factory
38+
* Update SDK reference to 3.0.0 to use API version 2015-09-01
39+
* Imposes message size limits for all authoring types. Pipelines must be 200 KB or less in size and all others must be 30 KB or less.
40+
* TeradataLinkedService no longer accepts the obsolete properties "database" and "schema".
41+
* Obsolete copy-related properties are no longer returned from the service.
42+
* Azure Sql (ARM) Cmdlets - added the following cmdlets
43+
* Get-AzureSqlServerActiveDirectoryAdministrator
44+
* Set-AzureSqlServerActiveDirectoryAdministrator
45+
* Remove-AzureSqlServerActiveDirectoryAdministrator
3846

3947
## 2015.08.17 version 0.9.7
4048
* Azure Profile cmdlets

setup/azurecmd.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33

4-
<?define productName="Microsoft Azure PowerShell - August 2015" ?>
4+
<?define productName="Microsoft Azure PowerShell - September 2015" ?>
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.9.7" ?>
8+
<?define version="0.9.8" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

src/Common/Commands.Common/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class AzurePowerShell
2727

2828
public const string AssemblyCopyright = "Copyright © Microsoft";
2929

30-
public const string AssemblyVersion = "0.9.7";
30+
public const string AssemblyVersion = "0.9.8";
3131

32-
public const string AssemblyFileVersion = "0.9.7";
32+
public const string AssemblyFileVersion = "0.9.8";
3333

3434
public const string ProfileFile = "AzureProfile.json";
3535

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,69 @@ public static void AssertBatchAccountContextsAreEqual(BatchAccountContext contex
111111
Assert.Equal<string>(context1.TaskTenantUrl, context2.TaskTenantUrl);
112112
}
113113

114+
/// <summary>
115+
/// Creates a RequestInterceptor that does not contact the Batch Service but instead uses the supplied response body.
116+
/// </summary>
117+
/// <param name="responseToUse">The response the interceptor should return. If none is specified, then a new instance of the response type is instantiated.</param>
118+
/// <typeparam name="TParameters">The type of the request parameters.</typeparam>
119+
/// <typeparam name="TResponse">The type of the expected response.</typeparam>
120+
public static RequestInterceptor CreateNoOpInterceptor<TParameters, TResponse>(TResponse responseToUse = null)
121+
where TParameters : ProxyModels.BatchParameters
122+
where TResponse : ProxyModels.BatchOperationResponse, new()
123+
{
124+
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
125+
{
126+
BatchRequest<TParameters, TResponse> request =
127+
(BatchRequest<TParameters, TResponse>)baseRequest;
128+
129+
request.ServiceRequestFunc = (cancellationToken) =>
130+
{
131+
TResponse response = responseToUse ?? new TResponse();
132+
Task<TResponse> task = Task.FromResult(response);
133+
return task;
134+
};
135+
});
136+
return interceptor;
137+
}
138+
139+
/// <summary>
140+
/// Creates a RequestInterceptor that does not contact the Batch Service on a Get NodeFile or a Get NodeFile Properties call.
141+
/// The interceptor must handle both request types since it's possible for one OM node file method to perform both REST APIs.
142+
/// </summary>
143+
/// <param name="fileName">The name of the file to put in the response body.</param>
144+
public static RequestInterceptor CreateNoOpGetFileAndPropertiesInterceptor(string fileName)
145+
{
146+
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
147+
{
148+
BatchRequest<ProxyModels.NodeFileGetParameters, ProxyModels.NodeFileGetResponse> fileRequest = baseRequest as
149+
BatchRequest<ProxyModels.NodeFileGetParameters, ProxyModels.NodeFileGetResponse>;
150+
151+
if (fileRequest != null)
152+
{
153+
fileRequest.ServiceRequestFunc = (cancellationToken) =>
154+
{
155+
ProxyModels.NodeFileGetResponse response = new ProxyModels.NodeFileGetResponse();
156+
Task<ProxyModels.NodeFileGetResponse> task = Task.FromResult(response);
157+
return task;
158+
};
159+
}
160+
else
161+
{
162+
BatchRequest<ProxyModels.NodeFileGetPropertiesParameters, ProxyModels.NodeFileGetPropertiesResponse> propRequest =
163+
(BatchRequest<ProxyModels.NodeFileGetPropertiesParameters, ProxyModels.NodeFileGetPropertiesResponse>)baseRequest;
164+
165+
propRequest.ServiceRequestFunc = (cancellationToken) =>
166+
{
167+
ProxyModels.NodeFileGetPropertiesResponse response = BatchTestHelpers.CreateNodeFileGetPropertiesResponse(fileName);
168+
Task<ProxyModels.NodeFileGetPropertiesResponse> task = Task.FromResult(response);
169+
return task;
170+
};
171+
}
172+
});
173+
174+
return interceptor;
175+
}
176+
114177
/// <summary>
115178
/// Builds a CloudPoolGetResponse object
116179
/// </summary>

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodeUsers/NewBatchComputeNodeUserCommandTests.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
using Microsoft.Azure.Batch;
1717
using Microsoft.Azure.Batch.Protocol;
1818
using Microsoft.Azure.Batch.Protocol.Models;
19-
using Microsoft.Azure.Commands.Batch.Models;
2019
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2120
using Moq;
2221
using System.Collections.Generic;
2322
using System.Management.Automation;
24-
using System.Threading.Tasks;
2523
using Xunit;
2624
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2725

@@ -64,18 +62,7 @@ public void NewBatchComputeNodeUserParametersTest()
6462
cmdlet.Password = "Password1234";
6563

6664
// Don't go to the service on an Add ComputeNodeUser call
67-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
68-
{
69-
BatchRequest<ComputeNodeAddUserParameters, ComputeNodeAddUserResponse> request =
70-
(BatchRequest<ComputeNodeAddUserParameters, ComputeNodeAddUserResponse>)baseRequest;
71-
72-
request.ServiceRequestFunc = (cancellationToken) =>
73-
{
74-
ComputeNodeAddUserResponse response = new ComputeNodeAddUserResponse();
75-
Task<ComputeNodeAddUserResponse> task = Task.FromResult(response);
76-
return task;
77-
};
78-
});
65+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeAddUserParameters, ComputeNodeAddUserResponse>();
7966
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
8067

8168
// Verify no exceptions when required parameters are set

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodeUsers/RemoveBatchComputeNodeUserCommandTests.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using Moq;
2121
using System.Collections.Generic;
2222
using System.Management.Automation;
23-
using System.Threading.Tasks;
2423
using Xunit;
2524
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2625

@@ -61,19 +60,8 @@ public void RemoveBatchComputeNodeUserParametersTest()
6160
cmdlet.ComputeNodeId = "computeNode1";
6261
cmdlet.Name = "testUser";
6362

64-
// Don't go to the service on a DeleteTVMUser call
65-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
66-
{
67-
BatchRequest<ComputeNodeDeleteUserParameters, ComputeNodeDeleteUserResponse> request =
68-
(BatchRequest<ComputeNodeDeleteUserParameters, ComputeNodeDeleteUserResponse>)baseRequest;
69-
70-
request.ServiceRequestFunc = (cancellationToken) =>
71-
{
72-
ComputeNodeDeleteUserResponse response = new ComputeNodeDeleteUserResponse();
73-
Task<ComputeNodeDeleteUserResponse> task = Task.FromResult(response);
74-
return task;
75-
};
76-
});
63+
// Don't go to the service on a Delete ComputeNodeUser call
64+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeDeleteUserParameters, ComputeNodeDeleteUserResponse>();
7765
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
7866

7967
// Verify no exceptions when required parameters are set

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodes/GetBatchComputeNodeCommandTests.cs

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using System.Collections.Generic;
2222
using System.Linq;
2323
using System.Management.Automation;
24-
using System.Threading.Tasks;
2524
using Xunit;
2625
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2726

@@ -56,18 +55,8 @@ public void GetBatchComputeNodeTest()
5655
cmdlet.Filter = null;
5756

5857
// Build a compute node instead of querying the service on a Get ComputeNode call
59-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
60-
{
61-
BatchRequest<ComputeNodeGetParameters, ComputeNodeGetResponse> request =
62-
(BatchRequest<ComputeNodeGetParameters, ComputeNodeGetResponse>)baseRequest;
63-
64-
request.ServiceRequestFunc = (cancellationToken) =>
65-
{
66-
ComputeNodeGetResponse response = BatchTestHelpers.CreateComputeNodeGetResponse(cmdlet.Id);
67-
Task<ComputeNodeGetResponse> task = Task.FromResult(response);
68-
return task;
69-
};
70-
});
58+
ComputeNodeGetResponse response = BatchTestHelpers.CreateComputeNodeGetResponse(cmdlet.Id);
59+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeGetParameters, ComputeNodeGetResponse>(response);
7160
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
7261

7362
// Setup the cmdlet to write pipeline output to a list that can be examined later
@@ -95,18 +84,8 @@ public void ListBatchComputeNodesByODataFilterTest()
9584
string[] idsOfConstructedComputeNodes = new[] { "computeNode1", "computeNode2" };
9685

9786
// Build some compute nodes instead of querying the service on a List ComputeNodes call
98-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
99-
{
100-
BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse> request =
101-
(BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse>)baseRequest;
102-
103-
request.ServiceRequestFunc = (cancellationToken) =>
104-
{
105-
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
106-
Task<ComputeNodeListResponse> task = Task.FromResult(response);
107-
return task;
108-
};
109-
});
87+
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
88+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeListParameters, ComputeNodeListResponse>(response);
11089
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
11190

11291
// Setup the cmdlet to write pipeline output to a list that can be examined later
@@ -142,18 +121,8 @@ public void ListBatchComputeNodesWithoutFiltersTest()
142121
string[] idsOfConstructedComputeNodes = new[] { "computeNode1", "computeNode2", "computeNode3" };
143122

144123
// Build some compute nodes instead of querying the service on a List ComputeNodes call
145-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
146-
{
147-
BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse> request =
148-
(BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse>)baseRequest;
149-
150-
request.ServiceRequestFunc = (cancellationToken) =>
151-
{
152-
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
153-
Task<ComputeNodeListResponse> task = Task.FromResult(response);
154-
return task;
155-
};
156-
});
124+
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
125+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeListParameters, ComputeNodeListResponse>(response);
157126
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
158127

159128
// Setup the cmdlet to write pipeline output to a list that can be examined later
@@ -194,18 +163,8 @@ public void ListComputeNodesMaxCountTest()
194163
string[] idsOfConstructedComputeNodes = new[] { "computeNode1", "computeNode2", "computeNode3" };
195164

196165
// Build some compute nodes instead of querying the service on a List ComputeNodes call
197-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
198-
{
199-
BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse> request =
200-
(BatchRequest<ComputeNodeListParameters, ComputeNodeListResponse>)baseRequest;
201-
202-
request.ServiceRequestFunc = (cancellationToken) =>
203-
{
204-
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
205-
Task<ComputeNodeListResponse> task = Task.FromResult(response);
206-
return task;
207-
};
208-
});
166+
ComputeNodeListResponse response = BatchTestHelpers.CreateComputeNodeListResponse(idsOfConstructedComputeNodes);
167+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeListParameters, ComputeNodeListResponse>(response);
209168
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
210169

211170
// Setup the cmdlet to write pipeline output to a list that can be examined later

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodes/ResetBatchComputeNodeCommandTests.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
using Microsoft.Azure.Batch.Common;
1818
using Microsoft.Azure.Batch.Protocol;
1919
using Microsoft.Azure.Batch.Protocol.Models;
20-
using Microsoft.Azure.Commands.Batch.Models;
2120
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2221
using Moq;
2322
using System.Collections.Generic;
24-
using System.Linq;
2523
using System.Management.Automation;
2624
using System.Threading.Tasks;
2725
using Xunit;
@@ -63,18 +61,7 @@ public void ResetBatchComputeNodeParametersTest()
6361
cmdlet.Id = "computeNode1";
6462

6563
// Don't go to the service on a Reimage ComputeNode call
66-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
67-
{
68-
BatchRequest<ComputeNodeReimageParameters, ComputeNodeReimageResponse> request =
69-
(BatchRequest<ComputeNodeReimageParameters, ComputeNodeReimageResponse>)baseRequest;
70-
71-
request.ServiceRequestFunc = (cancellationToken) =>
72-
{
73-
ComputeNodeReimageResponse response = new ComputeNodeReimageResponse();
74-
Task<ComputeNodeReimageResponse> task = Task.FromResult(response);
75-
return task;
76-
};
77-
});
64+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeReimageParameters, ComputeNodeReimageResponse>();
7865
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
7966

8067
// Verify no exceptions when required parameter is set
@@ -102,6 +89,7 @@ public void ResetComputeNodeRequestTest()
10289

10390
request.ServiceRequestFunc = (cancellationToken) =>
10491
{
92+
// Grab the reimage option from the outgoing request.
10593
requestReimageOption = request.TypedParameters.ComputeNodeReimageOption;
10694

10795
ComputeNodeReimageResponse response = new ComputeNodeReimageResponse();

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodes/RestartBatchComputeNodeCommandTests.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
using Microsoft.Azure.Batch.Common;
1818
using Microsoft.Azure.Batch.Protocol;
1919
using Microsoft.Azure.Batch.Protocol.Models;
20-
using Microsoft.Azure.Commands.Batch.Models;
2120
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2221
using Moq;
2322
using System.Collections.Generic;
24-
using System.Linq;
2523
using System.Management.Automation;
2624
using System.Threading.Tasks;
2725
using Xunit;
@@ -63,18 +61,7 @@ public void RestartBatchComputeNodeParametersTest()
6361
cmdlet.Id = "computeNode1";
6462

6563
// Don't go to the service on a Reboot ComputeNode call
66-
RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
67-
{
68-
BatchRequest<ComputeNodeRebootParameters, ComputeNodeRebootResponse> request =
69-
(BatchRequest<ComputeNodeRebootParameters, ComputeNodeRebootResponse>)baseRequest;
70-
71-
request.ServiceRequestFunc = (cancellationToken) =>
72-
{
73-
ComputeNodeRebootResponse response = new ComputeNodeRebootResponse();
74-
Task<ComputeNodeRebootResponse> task = Task.FromResult(response);
75-
return task;
76-
};
77-
});
64+
RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor<ComputeNodeRebootParameters, ComputeNodeRebootResponse>();
7865
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
7966

8067
// Verify no exceptions when required parameter is set
@@ -102,6 +89,7 @@ public void RestartComputeNodeRequestTest()
10289

10390
request.ServiceRequestFunc = (cancellationToken) =>
10491
{
92+
// Grab the reboot option from the outgoing request.
10593
requestRebootOption = request.TypedParameters.ComputeNodeRebootOption;
10694

10795
ComputeNodeRebootResponse response = new ComputeNodeRebootResponse();

0 commit comments

Comments
 (0)