diff --git a/.gitignore b/.gitignore
index 51e1e635620f..ae9ce57e9090 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,9 @@ binaries/
[Rr]elease/
build/
restoredPackages/
+PolicheckOutput/
+tools/net46/
+tools/Microsoft.WindowsAzure.Build.Tasks/packages/
PublishedNugets/
src/NuGet.Config
tools/7-zip/
diff --git a/Directory.Build.props b/Directory.Build.props
index afc420775ea1..f846c41eccf6 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,54 +1,37 @@

-
-
- $(MSBuildThisFileDirectory)
- $(LibraryRoot)src
- $(LibraryRoot)tools
- $(LibraryRoot)\restoredPackages
- Microsoft Azure Management Libraries
- src\Authentication\Authentication.sln
- AzureManagementLibraries.sln
- $(LibraryRoot)binaries
- $(BinariesFolder)\packages
- false
- false
- All
- "$(LibraryToolsFolder)\nuget.exe"
+
+
+ $(MSBuildThisFileDirectory)
+ $(LibraryRoot)src
+ $(LibraryRoot)tools
+ $(LibraryRoot)\restoredPackages
+ Microsoft Azure Management Libraries
+ src\Authentication\Authentication.sln
+ AzureManagementLibraries.sln
+ $(LibraryRoot)binaries
+ $(LibraryRoot)PolicheckOutput
+ $(BinariesFolder)\packages
+ false
+ false
+ All
+ "$(LibraryToolsFolder)\nuget.exe"
1234
+ true
true
- $(IgnorePathTokens) Microsoft.Azure.KeyVault.Samples Gallery Intune FileConventions FileStaging ConfigureAwaitAnalyzer ObjectModelCodeGeneration Azure.Batch.IntegrationTests Azure.Batch.ProtocolTests IntegrationTestCommon
-
-
+ $(IgnorePathTokens) Microsoft.Azure.KeyVault.Samples Gallery Intune FileConventions Batch.FileStaging.Tests ConfigureAwaitAnalyzer ObjectModelCodeGeneration Azure.Batch.IntegrationTests Azure.Batch.ProtocolTests IntegrationTestCommon
+
$(OnPremiseBuildTasks)
true
false
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
$(LibraryRoot)src\UpgradeVS17\SdkCommon\ClientRuntime
$(LibraryRoot)src\UpgradeVS17\SdkCommon\ClientRuntime
-
-
+
+
diff --git a/build.proj b/build.proj
index 026bf5cb9d6d..c11e49de8a06 100644
--- a/build.proj
+++ b/build.proj
@@ -9,6 +9,7 @@
+
diff --git a/src/SDKs/Authorization/Authorization.Tests/Tests/BasicTests.cs b/src/SDKs/Authorization/Authorization.Tests/Tests/BasicTests.cs
index 02a5242d50ff..875e95f9bfd5 100644
--- a/src/SDKs/Authorization/Authorization.Tests/Tests/BasicTests.cs
+++ b/src/SDKs/Authorization/Authorization.Tests/Tests/BasicTests.cs
@@ -430,8 +430,7 @@ public void RoleAssignmentListForScopeTest()
}
}
- //[Fact(Skip = "Graph issue when adding user to group, needs investigation")]
- [Fact]
+ [Fact(Skip = "Graph issue when adding user to group, needs investigation")]
public void RoleAssignmentListWithAssignedToFilterTest()
{
HttpMockServer.RecordsDirectory = GetSessionsDirectoryPath();
diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/App.config b/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/App.config
index a3b421db1507..231f27d6bc26 100644
--- a/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/App.config
+++ b/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/App.config
@@ -7,7 +7,7 @@
-
+
diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/Azure.Batch.IntegrationTests.csproj b/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/Azure.Batch.IntegrationTests.csproj
index 074857e9699e..26102d80aecc 100644
--- a/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/Azure.Batch.IntegrationTests.csproj
+++ b/src/SDKs/Batch/DataPlane/Azure.Batch.IntegrationTests/Azure.Batch.IntegrationTests.csproj
@@ -74,5 +74,7 @@
+
+
diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch.ProtocolTests/Azure.Batch.ProtocolTests.csproj b/src/SDKs/Batch/DataPlane/Azure.Batch.ProtocolTests/Azure.Batch.ProtocolTests.csproj
index 6da3b2251c60..8173349e01f8 100644
--- a/src/SDKs/Batch/DataPlane/Azure.Batch.ProtocolTests/Azure.Batch.ProtocolTests.csproj
+++ b/src/SDKs/Batch/DataPlane/Azure.Batch.ProtocolTests/Azure.Batch.ProtocolTests.csproj
@@ -25,6 +25,10 @@
+
+
+
+
diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/Azure.Batch.Unit.Tests.csproj b/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/Azure.Batch.Unit.Tests.csproj
index 8320eea53ea3..0e40fe65f98b 100644
--- a/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/Azure.Batch.Unit.Tests.csproj
+++ b/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/Azure.Batch.Unit.Tests.csproj
@@ -3,7 +3,7 @@
Debug
$(LibraryNugetPackageFolder)
-
+
$(BuiltPackageOutputDir)
false
true
@@ -25,7 +25,12 @@
bin\$(Configuration)\
bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
+
+
+
+
+
@@ -43,7 +48,7 @@
false
- netcoreapp1.1
+ netcoreapp1.1;net452
diff --git a/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/HttpClientBehaviorTests.cs b/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/HttpClientBehaviorTests.cs
new file mode 100644
index 000000000000..edace3741334
--- /dev/null
+++ b/src/SDKs/Batch/DataPlane/Azure.Batch.Unit.Tests/HttpClientBehaviorTests.cs
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+namespace Azure.Batch.Unit.Tests
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+ using Microsoft.Azure.Batch.Protocol;
+ using Microsoft.Net.Http.Server;
+ using Xunit;
+
+ public class HttpClientBehaviorTests
+ {
+ private const string url = "http://localhost:2055";
+
+ [Theory]
+ [MemberData(nameof(HttpMethods))]
+ public async Task HttpClient_IncludesContentLengthHeaderOnExpectedHttpVerbs(HttpMethod httpMethod)
+ {
+ BatchSharedKeyCredential creds = new BatchSharedKeyCredential(ClientUnitTestCommon.DummyAccountName, ClientUnitTestCommon.DummyAccountKey);
+
+ HttpRequestMessage message = new HttpRequestMessage(httpMethod, url);
+ message.Headers.Add("client-request-id", Guid.NewGuid().ToString());
+
+ await creds.ProcessHttpRequestAsync(message, CancellationToken.None);
+ Assert.NotNull(message.Headers.Authorization);
+
+ var settings = new WebListenerSettings()
+ {
+ Authentication = { Schemes = AuthenticationSchemes.None },
+ UrlPrefixes = { url }
+ };
+ using (WebListener listener = new WebListener(settings))
+ {
+ listener.Start();
+ Task listenTask = AcceptAndAssertAsync(httpMethod, listener, AssertRequestHasExpectedContentLength);
+
+ HttpClient client = new HttpClient();
+ await client.SendAsync(message);
+
+ await listenTask;
+ }
+ }
+
+ private static IEnumerable