diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..0fb069a43607 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +# Exclude all. +**/* + +# Include the build. +!src/Package/Release/ResourceManager/**/* +!src/Package/Debug/ResourceManager/**/* \ No newline at end of file diff --git a/.gitignore b/.gitignore index 480138ad788f..4dbf1c158517 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,9 @@ app.config # User-specific files *.suo *.user +*.userprefs *.sln.docstates +.vscode # Build results [Dd]ebug/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..2732045ba420 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +sudo: required +language: csharp +mono: none +dotnet: 2.0.0 +dist: trusty + +env: + - NAME="azure-powershell-core" CONFIG="Release" + +services: + - docker + +before_install: + - sudo apt-get update + - sudo apt-get install docker-ce + +script: + - dotnet msbuild build.proj /t:BuildNetcore /p:Configuration=$CONFIG + +after_success: + - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + docker build . -t $DOCKER_USER/$NAME:$TRAVIS_COMMIT --build-arg CONFIG=$CONFIG; + docker tag $DOCKER_USER/$NAME:$TRAVIS_COMMIT $DOCKER_USER/$NAME:$TRAVIS_BRANCH; + + docker login -u $DOCKER_USER -p $DOCKER_PASS; + + docker push $DOCKER_USER/$NAME:$TRAVIS_COMMIT; + docker push $DOCKER_USER/$NAME:$TRAVIS_BRANCH; + + if [ "$TRAVIS_BRANCH" == "master" ]; then + docker tag $DOCKER_USER/$NAME:$TRAVIS_COMMIT $DOCKER_USER/$NAME:latest; + docker push $DOCKER_USER/$NAME:latest; + fi; + fi diff --git a/Azure.PowerShell.NetCore.sln b/Azure.PowerShell.Netcore.sln similarity index 68% rename from Azure.PowerShell.NetCore.sln rename to Azure.PowerShell.Netcore.sln index 389a874d5c5c..1a590acf6601 100644 --- a/Azure.PowerShell.NetCore.sln +++ b/Azure.PowerShell.Netcore.sln @@ -1,41 +1,49 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26507.0 +VisualStudioVersion = 15.0.27019.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.NetCore", "src\Common\Commands.Common.Authentication\Authentication.NetCore.csproj", "{D12674F6-CB92-438F-A68D-21CE12F8611B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Authentication.Netcore", "src\Common\Commands.Common.Authentication\Common.Authentication.Netcore.csproj", "{D12674F6-CB92-438F-A68D-21CE12F8611B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Netcore", "src\Common\Commands.Common\Common.Netcore.csproj", "{998E17F1-A0D4-48CE-8EE5-3B60E7841D8D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Netcore", "src\Common\Commands.Common\Common.Netcore.csproj", "{998E17F1-A0D4-48CE-8EE5-3B60E7841D8D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.ResourceManager.Netcore", "src\ResourceManager\Common\Commands.ResourceManager.Common\Common.ResourceManager.Netcore.csproj", "{35A7AFAB-9F76-4CC8-AD83-6BE14DAEE597}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.ResourceManager.Netcore", "src\ResourceManager\Common\Commands.ResourceManager.Common\Common.ResourceManager.Netcore.csproj", "{35A7AFAB-9F76-4CC8-AD83-6BE14DAEE597}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Profile.Netcore", "src\ResourceManager\Profile\Commands.Profile\Commands.Profile.Netcore.csproj", "{31044C50-5F29-4CB4-9E7C-8E0123FA6B77}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile.Netcore", "src\ResourceManager\Profile\Commands.Profile\Commands.Profile.Netcore.csproj", "{31044C50-5F29-4CB4-9E7C-8E0123FA6B77}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Tags.Netcore", "src\ResourceManager\Tags\Commands.Tags\Commands.Tags.Netcore.csproj", "{4D14DBA3-26A1-4102-8012-196CF2C31C56}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags.Netcore", "src\ResourceManager\Tags\Commands.Tags\Commands.Tags.Netcore.csproj", "{4D14DBA3-26A1-4102-8012-196CF2C31C56}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Resources.Rest.Netcore", "src\ResourceManager\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.Netcore.csproj", "{0E33B20F-5AC6-43BE-B91F-203DDB5981DC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest.Netcore", "src\ResourceManager\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.Netcore.csproj", "{0E33B20F-5AC6-43BE-B91F-203DDB5981DC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Resources.Netcore", "src\ResourceManager\Resources\Commands.Resources\Commands.Resources.Netcore.csproj", "{B270ACDB-0E27-42CD-BB84-B9A6E47543B0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Netcore", "src\ResourceManager\Resources\Commands.Resources\Commands.Resources.Netcore.csproj", "{B270ACDB-0E27-42CD-BB84-B9A6E47543B0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Netcore", "src\Common\Commands.Common.Storage\Storage.Netcore.csproj", "{6B91BCDC-5031-4A7A-A566-83308FF997C6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Storage.Netcore", "src\Common\Commands.Common.Storage\Common.Storage.Netcore.csproj", "{6B91BCDC-5031-4A7A-A566-83308FF997C6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Storage.Netcore", "src\ResourceManager\Storage\Commands.Management.Storage\Commands.Storage.Netcore.csproj", "{6878D60B-AD5B-4D37-8B84-5D529090FBAC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage.Netcore", "src\ResourceManager\Storage\Commands.Management.Storage\Commands.Storage.Netcore.csproj", "{6878D60B-AD5B-4D37-8B84-5D529090FBAC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Websites.Netcore", "src\ResourceManager\Websites\Commands.Websites\Commands.Websites.Netcore.csproj", "{59581DCA-1726-4EE2-A665-0112E681C35C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites.Netcore", "src\ResourceManager\Websites\Commands.Websites\Commands.Websites.Netcore.csproj", "{59581DCA-1726-4EE2-A665-0112E681C35C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.Abstractions.NetCore", "src\Common\Commands.Common.Authentication.Abstractions\Authentication.Abstractions.NetCore.csproj", "{7290FAB3-878F-4960-A02D-70E5DC88622D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Authentication.Abstractions.Netcore", "src\Common\Commands.Common.Authentication.Abstractions\Common.Authentication.Abstractions.Netcore.csproj", "{7290FAB3-878F-4960-A02D-70E5DC88622D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.ResourceManager.Authentication.Netcore", "src\ResourceManager\Common\Commands.Common.Authentication.ResourceManager\Common.ResourceManager.Authentication.Netcore.csproj", "{AF50ACE6-9A6A-4A18-8140-B6C5BDD0EFD6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.ResourceManager.Authentication.Netcore", "src\ResourceManager\Common\Commands.Common.Authentication.ResourceManager\Common.ResourceManager.Authentication.Netcore.csproj", "{AF50ACE6-9A6A-4A18-8140-B6C5BDD0EFD6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Compute.Netcore", "src\ResourceManager\Compute\Commands.Compute\Commands.Compute.Netcore.csproj", "{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Compute.Netcore", "src\ResourceManager\Compute\Commands.Compute\Commands.Compute.Netcore.csproj", "{7B61AB3B-9F62-4B96-BCED-13920B56CD3C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Network.Netcore", "src\ResourceManager\Network\Commands.Network\Commands.Network.Netcore.csproj", "{40ACDC82-5A87-4D52-83B5-ED21274363A5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Netcore", "src\ResourceManager\Network\Commands.Network\Commands.Network.Netcore.csproj", "{40ACDC82-5A87-4D52-83B5-ED21274363A5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4B187BE1-F8C4-4658-AD17-98AA087482AA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Profile.Test.Netcore", "src\ResourceManager\Profile\Commands.Profile.Test\Commands.Profile.Test.Netcore.csproj", "{87246108-B555-4F5F-B916-A9C6FABB1971}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile.Test.Netcore", "src\ResourceManager\Profile\Commands.Profile.Test\Commands.Profile.Test.Netcore.csproj", "{87246108-B555-4F5F-B916-A9C6FABB1971}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.ResourceManager.ScenarioTests.Netcore", "src\ResourceManager\Common\Commands.ScenarioTests.ResourceManager.Common\Common.ResourceManager.ScenarioTests.Netcore.csproj", "{624FE5CE-0F46-4A0A-9A1B-54D5724B7F96}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.ResourceManager.ScenarioTests.Netcore", "src\ResourceManager\Common\Commands.ScenarioTests.ResourceManager.Common\Common.ResourceManager.ScenarioTests.Netcore.csproj", "{624FE5CE-0F46-4A0A-9A1B-54D5724B7F96}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Rbac.Netcore", "src\Common\Commands.Common.Graph.RBAC\Common.Rbac.Netcore.csproj", "{32BB23AC-A900-4EB8-ABBE-D8AABEB90E31}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Authorization.Netcore", "src\Common\Commands.Common.Authorization\Common.Authorization.Netcore.csproj", "{826C77AA-C038-46F1-86AE-9A9F2E564D41}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Network.Netcore", "src\Common\Commands.Common.Network\Common.Network.Netcore.csproj", "{EBFE7C29-7BF6-4E32-8844-09A38A597E05}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.KeyVault.Netcore", "src\ResourceManager\KeyVault\Commands.KeyVault\Commands.KeyVault.Netcore.csproj", "{814E7BBB-3D69-410A-81CF-374C29CC5C6B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -107,6 +115,22 @@ Global {624FE5CE-0F46-4A0A-9A1B-54D5724B7F96}.Debug|Any CPU.Build.0 = Debug|Any CPU {624FE5CE-0F46-4A0A-9A1B-54D5724B7F96}.Release|Any CPU.ActiveCfg = Release|Any CPU {624FE5CE-0F46-4A0A-9A1B-54D5724B7F96}.Release|Any CPU.Build.0 = Release|Any CPU + {32BB23AC-A900-4EB8-ABBE-D8AABEB90E31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32BB23AC-A900-4EB8-ABBE-D8AABEB90E31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32BB23AC-A900-4EB8-ABBE-D8AABEB90E31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32BB23AC-A900-4EB8-ABBE-D8AABEB90E31}.Release|Any CPU.Build.0 = Release|Any CPU + {826C77AA-C038-46F1-86AE-9A9F2E564D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {826C77AA-C038-46F1-86AE-9A9F2E564D41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {826C77AA-C038-46F1-86AE-9A9F2E564D41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {826C77AA-C038-46F1-86AE-9A9F2E564D41}.Release|Any CPU.Build.0 = Release|Any CPU + {EBFE7C29-7BF6-4E32-8844-09A38A597E05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBFE7C29-7BF6-4E32-8844-09A38A597E05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBFE7C29-7BF6-4E32-8844-09A38A597E05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBFE7C29-7BF6-4E32-8844-09A38A597E05}.Release|Any CPU.Build.0 = Release|Any CPU + {814E7BBB-3D69-410A-81CF-374C29CC5C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {814E7BBB-3D69-410A-81CF-374C29CC5C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {814E7BBB-3D69-410A-81CF-374C29CC5C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {814E7BBB-3D69-410A-81CF-374C29CC5C6B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -115,4 +139,7 @@ Global {87246108-B555-4F5F-B916-A9C6FABB1971} = {4B187BE1-F8C4-4658-AD17-98AA087482AA} {624FE5CE-0F46-4A0A-9A1B-54D5724B7F96} = {4B187BE1-F8C4-4658-AD17-98AA087482AA} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0A9808F3-5476-4731-BD44-617A8BA3DD65} + EndGlobalSection EndGlobal diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..7abdd1f3ae49 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM microsoft/powershell + +ARG CONFIG=Release + +COPY src/Package/${CONFIG}/ResourceManager /usr/local/share/powershell/Modules \ No newline at end of file diff --git a/NuGet.config b/NuGet.config index e1a9620bbf2a..a371f4a1e6f3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,6 +8,5 @@ - diff --git a/build.proj b/build.proj index 7cf91254ddf7..4ebf155c5d87 100644 --- a/build.proj +++ b/build.proj @@ -260,14 +260,14 @@ - + - - - + + + @@ -526,7 +526,7 @@ - + diff --git a/src/Common/Commands.Common.Authentication.Abstractions/Authentication.Abstractions.NetCore.csproj b/src/Common/Commands.Common.Authentication.Abstractions/Common.Authentication.Abstractions.Netcore.csproj similarity index 84% rename from src/Common/Commands.Common.Authentication.Abstractions/Authentication.Abstractions.NetCore.csproj rename to src/Common/Commands.Common.Authentication.Abstractions/Common.Authentication.Abstractions.Netcore.csproj index 861f87c4ea13..cfebe52e2541 100644 --- a/src/Common/Commands.Common.Authentication.Abstractions/Authentication.Abstractions.NetCore.csproj +++ b/src/Common/Commands.Common.Authentication.Abstractions/Common.Authentication.Abstractions.Netcore.csproj @@ -1,8 +1,10 @@  + + netcoreapp2.0 - Authentication.Abstractions + Microsoft.Azure.Commands.Common.Authentication.Abstractions win10-x64 Microsoft.Azure.Commands.Common.Authentication.Abstractions false @@ -17,11 +19,10 @@ TRACE;DEBUG;NETSTANDARD + false - - @@ -29,8 +30,6 @@ - - diff --git a/src/Common/Commands.Common.Authentication/Authentication/KeyStoreApplicationCredentialProvider.cs b/src/Common/Commands.Common.Authentication/Authentication/KeyStoreApplicationCredentialProvider.cs index 760b693f4fc6..bb514be8183a 100644 --- a/src/Common/Commands.Common.Authentication/Authentication/KeyStoreApplicationCredentialProvider.cs +++ b/src/Common/Commands.Common.Authentication/Authentication/KeyStoreApplicationCredentialProvider.cs @@ -14,6 +14,9 @@ using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.Rest.Azure.Authentication; +#if NETSTANDARD +using Microsoft.WindowsAzure.Commands.Common; +#endif using System.Security; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Authentication/Authentication/ServicePrincipalTokenProvider.cs b/src/Common/Commands.Common.Authentication/Authentication/ServicePrincipalTokenProvider.cs index 4e4bcd521112..c78b91c95af2 100644 --- a/src/Common/Commands.Common.Authentication/Authentication/ServicePrincipalTokenProvider.cs +++ b/src/Common/Commands.Common.Authentication/Authentication/ServicePrincipalTokenProvider.cs @@ -16,6 +16,9 @@ using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.Rest.Azure.Authentication; +#if NETSTANDARD +using Microsoft.WindowsAzure.Commands.Common; +#endif using System; using System.Collections.Generic; using System.Security; @@ -79,10 +82,9 @@ private AuthenticationResult AcquireTokenWithSecret(AdalConfiguration config, st return context.AcquireToken(config.ResourceClientUri, credential); #else var credential = new ClientCredential(appId, ConversionUtilities.SecureStringToString(appKey)); - return context.AcquireTokenAsync(context.Authority, credential) - .ConfigureAwait(false).GetAwaiter().GetResult(); -#endif - } + return context.AcquireTokenAsync(config.ResourceClientUri, credential).ConfigureAwait(false).GetAwaiter().GetResult(); +#endif + } private AuthenticationResult AcquireTokenWithCertificate( AdalConfiguration config, diff --git a/src/Common/Commands.Common.Authentication/AzureSessionInitializer.cs b/src/Common/Commands.Common.Authentication/AzureSessionInitializer.cs index d58846e7f47e..005d3e75e147 100644 --- a/src/Common/Commands.Common.Authentication/AzureSessionInitializer.cs +++ b/src/Common/Commands.Common.Authentication/AzureSessionInitializer.cs @@ -182,15 +182,15 @@ public AdalSession() { } - public override TraceLevel AuthenticationLegacyTraceLevel + public override System.Diagnostics.TraceLevel AuthenticationLegacyTraceLevel { get { - return TraceLevel.Off; + return System.Diagnostics.TraceLevel.Off; } set { - + } } diff --git a/src/Common/Commands.Common.Authentication/Authentication.NetCore.csproj b/src/Common/Commands.Common.Authentication/Common.Authentication.Netcore.csproj similarity index 81% rename from src/Common/Commands.Common.Authentication/Authentication.NetCore.csproj rename to src/Common/Commands.Common.Authentication/Common.Authentication.Netcore.csproj index 86d7257188b7..5a93e0a875e3 100644 --- a/src/Common/Commands.Common.Authentication/Authentication.NetCore.csproj +++ b/src/Common/Commands.Common.Authentication/Common.Authentication.Netcore.csproj @@ -1,8 +1,10 @@  + + netcoreapp2.0 - Authentication + Microsoft.Azure.Commands.Common.Authentication win10-x64 Microsoft.Azure.Commands.Common.Authentication false @@ -17,19 +19,15 @@ TRACE;DEBUG;NETSTANDARD + false - - - - - @@ -41,7 +39,7 @@ - + diff --git a/src/Common/Commands.Common.Authorization/Common.Authorization.Netcore.csproj b/src/Common/Commands.Common.Authorization/Common.Authorization.Netcore.csproj new file mode 100644 index 000000000000..8297a918bb42 --- /dev/null +++ b/src/Common/Commands.Common.Authorization/Common.Authorization.Netcore.csproj @@ -0,0 +1,53 @@ + + + + + + netcoreapp2.0 + Microsoft.Azure.Commands.Common.Authorization + win10-x64 + Microsoft.Azure.Commands.Common.Authorization + false + + + + True + True + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + TRACE;DEBUG;NETSTANDARD + false + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/src/Common/Commands.Common.Graph.RBAC/ApplicationsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/ApplicationsOperations.cs index 300166cbf536..6c66f9934bfd 100644 --- a/src/Common/Commands.Common.Graph.RBAC/ApplicationsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/ApplicationsOperations.cs @@ -4,15 +4,11 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { - using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Graph.RBAC/Common.Rbac.Netcore.csproj b/src/Common/Commands.Common.Graph.RBAC/Common.Rbac.Netcore.csproj new file mode 100644 index 000000000000..379a98b0e954 --- /dev/null +++ b/src/Common/Commands.Common.Graph.RBAC/Common.Rbac.Netcore.csproj @@ -0,0 +1,53 @@ + + + + + + netcoreapp2.0 + Microsoft.Azure.Commands.Common.Graph.RBAC + win10-x64 + Microsoft.Azure.Commands.Common.Graph.RBAC + false + + + + True + True + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + TRACE;DEBUG;NETSTANDARD + false + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/src/Common/Commands.Common.Graph.RBAC/GroupsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/GroupsOperations.cs index e48b1f2c86f9..2e63791e89e1 100644 --- a/src/Common/Commands.Common.Graph.RBAC/GroupsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/GroupsOperations.cs @@ -5,14 +5,11 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; @@ -20,6 +17,8 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 using System.Threading; using System.Threading.Tasks; + using AzureOperationResponse = Microsoft.Rest.Azure.AzureOperationResponse; + /// /// GroupsOperations operations. /// diff --git a/src/Common/Commands.Common.Graph.RBAC/IApplicationsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/IApplicationsOperations.cs index 91b198d1744a..2183cd09dc4d 100644 --- a/src/Common/Commands.Common.Graph.RBAC/IApplicationsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/IApplicationsOperations.cs @@ -5,17 +5,15 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; + using AzureOperationResponse = Microsoft.Rest.Azure.AzureOperationResponse; + /// /// ApplicationsOperations operations. /// diff --git a/src/Common/Commands.Common.Graph.RBAC/IGroupsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/IGroupsOperations.cs index 1c7e31a2c05e..98ef5edf3061 100644 --- a/src/Common/Commands.Common.Graph.RBAC/IGroupsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/IGroupsOperations.cs @@ -5,17 +5,15 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; + using AzureOperationResponse = Microsoft.Rest.Azure.AzureOperationResponse; + /// /// GroupsOperations operations. /// diff --git a/src/Common/Commands.Common.Graph.RBAC/IServicePrincipalsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/IServicePrincipalsOperations.cs index 047925f3f50a..a674e04440f6 100644 --- a/src/Common/Commands.Common.Graph.RBAC/IServicePrincipalsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/IServicePrincipalsOperations.cs @@ -4,14 +4,9 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { - using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Graph.RBAC/IUsersOperations.cs b/src/Common/Commands.Common.Graph.RBAC/IUsersOperations.cs index dbbdce391476..2287f803365f 100644 --- a/src/Common/Commands.Common.Graph.RBAC/IUsersOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/IUsersOperations.cs @@ -4,14 +4,9 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { - using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Graph.RBAC/ServicePrincipalsOperations.cs b/src/Common/Commands.Common.Graph.RBAC/ServicePrincipalsOperations.cs index 2dd8c7fa9c7b..476e18e15a97 100644 --- a/src/Common/Commands.Common.Graph.RBAC/ServicePrincipalsOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/ServicePrincipalsOperations.cs @@ -4,15 +4,11 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { - using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Graph.RBAC/UsersOperations.cs b/src/Common/Commands.Common.Graph.RBAC/UsersOperations.cs index c4abf66cce9b..1b6d098fb8bc 100644 --- a/src/Common/Commands.Common.Graph.RBAC/UsersOperations.cs +++ b/src/Common/Commands.Common.Graph.RBAC/UsersOperations.cs @@ -4,15 +4,11 @@ namespace Microsoft.Azure.Graph.RBAC.Version1_6 { - using Microsoft.Azure; - using Microsoft.Azure.Graph; - using Microsoft.Azure.Graph.RBAC; using Microsoft.Rest; using Microsoft.Rest.Azure; using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Network/Common.Network.Netcore.csproj b/src/Common/Commands.Common.Network/Common.Network.Netcore.csproj new file mode 100644 index 000000000000..e03b8d4dc06a --- /dev/null +++ b/src/Common/Commands.Common.Network/Common.Network.Netcore.csproj @@ -0,0 +1,53 @@ + + + + + + netcoreapp2.0 + Microsoft.Azure.Commands.Common.Network + win10-x64 + Microsoft.Azure.Commands.Common.Network + false + + + + True + True + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + TRACE;DEBUG;NETSTANDARD + false + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/src/Common/Commands.Common.Network/ILoadBalancersOperations.cs b/src/Common/Commands.Common.Network/ILoadBalancersOperations.cs index f2efbab8e18c..6f9cfdd89a13 100644 --- a/src/Common/Commands.Common.Network/ILoadBalancersOperations.cs +++ b/src/Common/Commands.Common.Network/ILoadBalancersOperations.cs @@ -4,14 +4,8 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Network/INetworkInterfacesOperations.cs b/src/Common/Commands.Common.Network/INetworkInterfacesOperations.cs index f58ca0cb8486..1d0eb020798b 100644 --- a/src/Common/Commands.Common.Network/INetworkInterfacesOperations.cs +++ b/src/Common/Commands.Common.Network/INetworkInterfacesOperations.cs @@ -4,14 +4,8 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Network/IPublicIPAddressesOperations.cs b/src/Common/Commands.Common.Network/IPublicIPAddressesOperations.cs index e9416ab5d1b5..ed657bb65a2e 100644 --- a/src/Common/Commands.Common.Network/IPublicIPAddressesOperations.cs +++ b/src/Common/Commands.Common.Network/IPublicIPAddressesOperations.cs @@ -4,14 +4,8 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/src/Common/Commands.Common.Network/LoadBalancersOperations.cs b/src/Common/Commands.Common.Network/LoadBalancersOperations.cs index 73e23b500481..adcfae057821 100644 --- a/src/Common/Commands.Common.Network/LoadBalancersOperations.cs +++ b/src/Common/Commands.Common.Network/LoadBalancersOperations.cs @@ -4,15 +4,10 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Network/NetworkInterfacesOperations.cs b/src/Common/Commands.Common.Network/NetworkInterfacesOperations.cs index faa6d54f4c8c..f1b046bfe6ca 100644 --- a/src/Common/Commands.Common.Network/NetworkInterfacesOperations.cs +++ b/src/Common/Commands.Common.Network/NetworkInterfacesOperations.cs @@ -4,15 +4,10 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Network/PublicIPAddressesOperations.cs b/src/Common/Commands.Common.Network/PublicIPAddressesOperations.cs index b1528c6035db..09e81d487c88 100644 --- a/src/Common/Commands.Common.Network/PublicIPAddressesOperations.cs +++ b/src/Common/Commands.Common.Network/PublicIPAddressesOperations.cs @@ -4,15 +4,10 @@ namespace Microsoft.Azure.Management.Internal.Network.Version2017_03_01 { - using Microsoft.Azure; - using Microsoft.Azure.Management; - using Microsoft.Azure.Management.Internal; - using Microsoft.Azure.Management.Internal.Network; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; - using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; diff --git a/src/Common/Commands.Common.Storage/Storage.Netcore.csproj b/src/Common/Commands.Common.Storage/Common.Storage.Netcore.csproj similarity index 64% rename from src/Common/Commands.Common.Storage/Storage.Netcore.csproj rename to src/Common/Commands.Common.Storage/Common.Storage.Netcore.csproj index eb0be0952c48..4766919b2a42 100644 --- a/src/Common/Commands.Common.Storage/Storage.Netcore.csproj +++ b/src/Common/Commands.Common.Storage/Common.Storage.Netcore.csproj @@ -1,8 +1,10 @@  + + netcoreapp2.0 - Storage + Microsoft.WindowsAzure.Commands.Common.Storage win10-x64 Microsoft.WindowsAzure.Commands.Common.Storage false @@ -17,27 +19,39 @@ TRACE;DEBUG;NETSTANDARD + false - - - - + + + + + + + + + + + + + + + - + diff --git a/src/Common/Commands.Common/AzureDataCmdlet.cs b/src/Common/Commands.Common/AzureDataCmdlet.cs index da3512156d8e..59574ae33385 100644 --- a/src/Common/Commands.Common/AzureDataCmdlet.cs +++ b/src/Common/Commands.Common/AzureDataCmdlet.cs @@ -92,6 +92,7 @@ public IAzureContextContainer SMProfile return result; } } +#endif protected override string DataCollectionWarning { @@ -100,7 +101,6 @@ protected override string DataCollectionWarning return Resources.ARMDataCollectionMessage; } } -#endif protected override void InitializeQosEvent() { diff --git a/src/Common/Commands.Common/Common.Netcore.csproj b/src/Common/Commands.Common/Common.Netcore.csproj index 0562c08190f6..8858929db533 100644 --- a/src/Common/Commands.Common/Common.Netcore.csproj +++ b/src/Common/Commands.Common/Common.Netcore.csproj @@ -1,11 +1,14 @@  + + netcoreapp2.0 - Common + Microsoft.WindowsAzure.Commands.Common win10-x64 Microsoft.WindowsAzure.Commands.Common false + true @@ -17,25 +20,17 @@ TRACE;DEBUG;NETSTANDARD + false - - - - - - - - - - + - + diff --git a/src/ResourceManager/Common/Commands.Common.Authentication.ResourceManager/Common.ResourceManager.Authentication.Netcore.csproj b/src/ResourceManager/Common/Commands.Common.Authentication.ResourceManager/Common.ResourceManager.Authentication.Netcore.csproj index 1f0239115ca9..d0daef625b07 100644 --- a/src/ResourceManager/Common/Commands.Common.Authentication.ResourceManager/Common.ResourceManager.Authentication.Netcore.csproj +++ b/src/ResourceManager/Common/Commands.Common.Authentication.ResourceManager/Common.ResourceManager.Authentication.Netcore.csproj @@ -1,8 +1,10 @@  + + netcoreapp2.0 - Common.ResourceManager.Authentication + Microsoft.Azure.Commands.Common.Authentication.ResourceManager win10-x64 Microsoft.Azure.Commands.Common.Authentication.ResourceManager false @@ -17,21 +19,18 @@ TRACE;DEBUG;NETSTANDARD + false - - - - - - + + diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Common.ResourceManager.Netcore.csproj b/src/ResourceManager/Common/Commands.ResourceManager.Common/Common.ResourceManager.Netcore.csproj index 5ddbe787617e..1c38b67aaa1c 100644 --- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Common.ResourceManager.Netcore.csproj +++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Common.ResourceManager.Netcore.csproj @@ -1,8 +1,10 @@  + + netcoreapp2.0 - Common.ResourceManager + Microsoft.Azure.Commands.ResourceManager.Common win10-x64 Microsoft.Azure.Commands.ResourceManager.Common false @@ -17,20 +19,17 @@ TRACE;DEBUG;NETSTANDARD + false - - - - - + diff --git a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ResourceManager.ScenarioTests.Netcore.csproj b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ResourceManager.ScenarioTests.Netcore.csproj index ad687eb60652..32d69fd9c0e7 100644 --- a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ResourceManager.ScenarioTests.Netcore.csproj +++ b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ResourceManager.ScenarioTests.Netcore.csproj @@ -1,5 +1,7 @@  + + netcoreapp2.0 win10-x64 @@ -10,6 +12,7 @@ TRACE;DEBUG;NETSTANDARD + false @@ -20,18 +23,13 @@ - - - - + - - @@ -50,8 +48,8 @@ - - + + diff --git a/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 b/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 index 523b28149e6a..46b59c5b7f70 100644 --- a/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 +++ b/src/ResourceManager/Compute/AzureRM.Compute.Netcore.psd1 @@ -54,7 +54,14 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; }) # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\AutoMapper.dll', + 'netcoreapp2.0\Microsoft.Azure.Management.Compute.dll', + 'netcoreapp2.0\Microsoft.Azure.Management.KeyVault.dll', + 'netcoreapp2.0\Microsoft.Azure.Management.Storage.dll', + 'netcoreapp2.0\Microsoft.Data.Edm.dll', + 'netcoreapp2.0\Microsoft.Data.OData.dll', + 'netcoreapp2.0\Microsoft.WindowsAzure.Storage.dll', + 'netcoreapp2.0\System.Spatial.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() @@ -75,93 +82,100 @@ FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Remove-AzureRmAvailabilitySet', 'Get-AzureRmAvailabilitySet', - 'New-AzureRmAvailabilitySet', 'Update-AzureRmAvailabilitySet', - 'Get-AzureRmVMExtensionImageType', 'Get-AzureRmVMExtensionImage', - 'Get-AzureRmVMADDomainExtension', 'Set-AzureRmVMADDomainExtension', - 'Get-AzureRmVMAEMExtension', 'Remove-AzureRmVMAEMExtension', - 'Set-AzureRmVMAEMExtension', 'Test-AzureRmVMAEMExtension', - 'Set-AzureRmVMBginfoExtension', - 'Get-AzureRmVMCustomScriptExtension', - 'Remove-AzureRmVMCustomScriptExtension', - 'Set-AzureRmVMCustomScriptExtension', - 'Get-AzureRmVMDiagnosticsExtension', - 'Remove-AzureRmVMDiagnosticsExtension', - 'Remove-AzureRmVmssDiagnosticsExtension', - 'Set-AzureRmVMDiagnosticsExtension', 'Set-AzureRmVMExtension', - 'Remove-AzureRmVMExtension', 'Get-AzureRmVMExtension', - 'Get-AzureRmVMSqlServerExtension', - 'New-AzureRmVMSqlServerAutoBackupConfig', - 'New-AzureRmVMSqlServerAutoPatchingConfig', - 'New-AzureRmVMSqlServerKeyVaultCredentialConfig', - 'Remove-AzureRmVMSqlServerExtension', - 'Set-AzureRmVMSqlServerExtension', 'Get-AzureRmVMImage', - 'Get-AzureRmVMAccessExtension', 'Remove-AzureRmVMAccessExtension', - 'Set-AzureRmVMAccessExtension', 'Get-AzureRmVMImageSku', - 'Get-AzureRmVMImagePublisher', 'Get-AzureRmVMImageOffer', - 'Get-AzureRmRemoteDesktopFile', 'Get-AzureRmVMUsage', - 'Get-AzureRmVMSize', 'Save-AzureRmVMImage', 'Set-AzureRmVM', - 'Add-AzureRmVMAdditionalUnattendContent', - 'Add-AzureRmVMSshPublicKey', 'Add-AzureRmVMSecret', - 'Remove-AzureRmVMSecret', 'Remove-AzureRmVMNetworkInterface', - 'Remove-AzureRmVMDataDisk', 'Set-AzureRmVMBootDiagnostics', - 'Set-AzureRmVMDataDisk', 'Set-AzureRmVMPlan', - 'Set-AzureRmVMSourceImage', 'Set-AzureRmVMOSDisk', - 'Get-AzureRmVMBootDiagnosticsData', 'Get-AzureRmVM', - 'Update-AzureRmVM', 'Restart-AzureRmVM', 'New-AzureRmVM', - 'Start-AzureRmVM', 'Stop-AzureRmVM', 'Remove-AzureRmVM', - 'New-AzureRmVMConfig', 'Set-AzureRmVMOperatingSystem', - 'Add-AzureRmVMDataDisk', 'Add-AzureRmVMNetworkInterface', - 'Add-AzureRmVhd', 'Save-AzureRmVhd', - 'Add-AzureRmContainerServiceAgentPoolProfile', - 'New-AzureRmContainerServiceConfig', - 'Remove-AzureRmContainerServiceAgentPoolProfile', - 'New-AzureRmContainerService', 'Update-AzureRmContainerService', - 'Remove-AzureRmContainerService', 'Get-AzureRmContainerService', - 'Get-AzureRmVmssVM', 'Set-AzureRmVmssVM', - 'Add-AzureRmVmssAdditionalUnattendContent', - 'Add-AzureRmVmssExtension', 'Add-AzureRmVmssDataDisk', - 'Add-AzureRmVmssNetworkInterfaceConfiguration', - 'Add-AzureRmVmssSecret', 'Add-AzureRmVmssSshPublicKey', - 'Add-AzureRmVmssWinRMListener', 'New-AzureRmVmssConfig', - 'New-AzureRmVmssIpConfig', 'New-AzureRmVmssVaultCertificateConfig', - 'Remove-AzureRmVmssExtension', 'Remove-AzureRmVmssDataDisk', - 'Remove-AzureRmVmssNetworkInterfaceConfiguration', - 'Set-AzureRmVmssOsProfile', 'Set-AzureRmVmssStorageProfile', - 'New-AzureRmVmss', 'Update-AzureRmVmss', 'Stop-AzureRmVmss', - 'Remove-AzureRmVmss', 'Get-AzureRmVmss', 'Get-AzureRmVmssSku', - 'Set-AzureRmVmss', 'Restart-AzureRmVmss', 'Start-AzureRmVmss', - 'Update-AzureRmVmssInstance', 'Get-AzureRmVMDscExtensionStatus', - 'Publish-AzureRmVMDscConfiguration', 'Remove-AzureRmVMDscExtension', - 'Set-AzureRmVMDscExtension', 'Get-AzureRmVMDscExtension', - 'Add-AzureRmVmssDiagnosticsExtension', 'Get-AzureRmVMChefExtension', - 'Remove-AzureRmVMChefExtension', 'Set-AzureRmVMChefExtension', - 'Remove-AzureRmVMBackup', 'Disable-AzureRmVMDiskEncryption', - 'Get-AzureRmVMDiskEncryptionStatus', - 'Remove-AzureRmVMDiskEncryptionExtension', - 'Set-AzureRmVMDiskEncryptionExtension', - 'Set-AzureRmVMBackupExtension', 'New-AzureRmDisk', - 'Update-AzureRmDisk', 'Get-AzureRmDisk', 'Remove-AzureRmDisk', - 'Grant-AzureRmDiskAccess', 'Revoke-AzureRmDiskAccess', - 'New-AzureRmDiskConfig', 'Set-AzureRmDiskDiskEncryptionKey', - 'Set-AzureRmDiskImageReference', 'Set-AzureRmDiskKeyEncryptionKey', - 'New-AzureRmDiskUpdateConfig', - 'Set-AzureRmDiskUpdateDiskEncryptionKey', - 'Set-AzureRmDiskUpdateImageReference', - 'Set-AzureRmDiskUpdateKeyEncryptionKey', 'New-AzureRmSnapshot', - 'Update-AzureRmSnapshot', 'Get-AzureRmSnapshot', - 'Remove-AzureRmSnapshot', 'Grant-AzureRmSnapshotAccess', - 'Revoke-AzureRmSnapshotAccess', 'New-AzureRmSnapshotConfig', - 'Set-AzureRmSnapshotDiskEncryptionKey', - 'Set-AzureRmSnapshotImageReference', - 'Set-AzureRmSnapshotKeyEncryptionKey', - 'New-AzureRmSnapshotUpdateConfig', - 'Set-AzureRmSnapshotUpdateDiskEncryptionKey', - 'Set-AzureRmSnapshotUpdateImageReference', - 'Set-AzureRmSnapshotUpdateKeyEncryptionKey', 'New-AzureRmImage', - 'Update-AzureRmImage', 'Get-AzureRmImage', 'Remove-AzureRmImage', - 'New-AzureRmImageConfig', 'Set-AzureRmImageOsDisk', - 'Add-AzureRmImageDataDisk', 'Remove-AzureRmImageDataDisk', - 'ConvertTo-AzureRmVMManagedDisk' + 'New-AzureRmAvailabilitySet', 'Update-AzureRmAvailabilitySet', + 'Get-AzureRmVMExtensionImageType', 'Get-AzureRmVMExtensionImage', + 'Get-AzureRmVMADDomainExtension', 'Set-AzureRmVMADDomainExtension', + 'Get-AzureRmVMAEMExtension', 'Remove-AzureRmVMAEMExtension', + 'Set-AzureRmVMAEMExtension', 'Test-AzureRmVMAEMExtension', + 'Set-AzureRmVMBginfoExtension', + 'Get-AzureRmVMCustomScriptExtension', + 'Remove-AzureRmVMCustomScriptExtension', + 'Set-AzureRmVMCustomScriptExtension', + 'Get-AzureRmVMDiagnosticsExtension', + 'Remove-AzureRmVMDiagnosticsExtension', + 'Remove-AzureRmVmssDiagnosticsExtension', + 'Set-AzureRmVMDiagnosticsExtension', 'Set-AzureRmVMExtension', + 'Remove-AzureRmVMExtension', 'Get-AzureRmVMExtension', + 'Get-AzureRmVMSqlServerExtension', + 'New-AzureRmVMSqlServerAutoBackupConfig', + 'New-AzureRmVMSqlServerAutoPatchingConfig', + 'New-AzureRmVMSqlServerKeyVaultCredentialConfig', + 'Remove-AzureRmVMSqlServerExtension', + 'Set-AzureRmVMSqlServerExtension', 'Get-AzureRmVMImage', + 'Get-AzureRmVMAccessExtension', 'Remove-AzureRmVMAccessExtension', + 'Set-AzureRmVMAccessExtension', 'Get-AzureRmVMImageSku', + 'Get-AzureRmVMImagePublisher', 'Get-AzureRmVMImageOffer', + 'Get-AzureRmRemoteDesktopFile', 'Get-AzureRmVMUsage', + 'Get-AzureRmVMSize', 'Save-AzureRmVMImage', 'Set-AzureRmVM', + 'Add-AzureRmVMAdditionalUnattendContent', + 'Add-AzureRmVMSshPublicKey', 'Add-AzureRmVMSecret', + 'Remove-AzureRmVMSecret', 'Remove-AzureRmVMNetworkInterface', + 'Remove-AzureRmVMDataDisk', 'Set-AzureRmVMBootDiagnostics', + 'Set-AzureRmVMDataDisk', 'Set-AzureRmVMPlan', + 'Set-AzureRmVMSourceImage', 'Set-AzureRmVMOSDisk', + 'Get-AzureRmVMBootDiagnosticsData', 'Get-AzureRmVM', + 'Update-AzureRmVM', 'Restart-AzureRmVM', 'New-AzureRmVM', + 'Start-AzureRmVM', 'Stop-AzureRmVM', 'Remove-AzureRmVM', + 'New-AzureRmVMConfig', 'Set-AzureRmVMOperatingSystem', + 'Add-AzureRmVMDataDisk', 'Add-AzureRmVMNetworkInterface', + 'Add-AzureRmVhd', 'Save-AzureRmVhd', + 'Add-AzureRmContainerServiceAgentPoolProfile', + 'New-AzureRmContainerServiceConfig', + 'Remove-AzureRmContainerServiceAgentPoolProfile', + 'New-AzureRmContainerService', 'Update-AzureRmContainerService', + 'Remove-AzureRmContainerService', 'Get-AzureRmContainerService', + 'Get-AzureRmVmssVM', 'Set-AzureRmVmssVM', + 'Add-AzureRmVmssAdditionalUnattendContent', + 'Add-AzureRmVmssExtension', 'Add-AzureRmVmssDataDisk', + 'Add-AzureRmVmssNetworkInterfaceConfiguration', + 'Add-AzureRmVmssSecret', 'Add-AzureRmVmssSshPublicKey', + 'Add-AzureRmVmssWinRMListener', 'New-AzureRmVmssConfig', + 'New-AzureRmVmssIpConfig', 'New-AzureRmVmssVaultCertificateConfig', + 'Remove-AzureRmVmssExtension', 'Remove-AzureRmVmssDataDisk', + 'Remove-AzureRmVmssNetworkInterfaceConfiguration', + 'Set-AzureRmVmssOsProfile', 'Set-AzureRmVmssStorageProfile', + 'New-AzureRmVmss', 'Update-AzureRmVmss', 'Stop-AzureRmVmss', + 'Remove-AzureRmVmss', 'Get-AzureRmVmss', 'Get-AzureRmVmssSku', + 'Set-AzureRmVmss', 'Restart-AzureRmVmss', 'Start-AzureRmVmss', + 'Update-AzureRmVmssInstance', 'Get-AzureRmVMDscExtensionStatus', + 'Publish-AzureRmVMDscConfiguration', 'Remove-AzureRmVMDscExtension', + 'Set-AzureRmVMDscExtension', 'Get-AzureRmVMDscExtension', + 'Add-AzureRmVmssDiagnosticsExtension', 'Get-AzureRmVMChefExtension', + 'Remove-AzureRmVMChefExtension', 'Set-AzureRmVMChefExtension', + 'Remove-AzureRmVMBackup', 'Disable-AzureRmVMDiskEncryption', + 'Get-AzureRmVMDiskEncryptionStatus', + 'Remove-AzureRmVMDiskEncryptionExtension', + 'Set-AzureRmVMDiskEncryptionExtension', + 'Set-AzureRmVMBackupExtension', 'New-AzureRmDisk', + 'Update-AzureRmDisk', 'Get-AzureRmDisk', 'Remove-AzureRmDisk', + 'Grant-AzureRmDiskAccess', 'Revoke-AzureRmDiskAccess', + 'New-AzureRmDiskConfig', 'Set-AzureRmDiskDiskEncryptionKey', + 'Set-AzureRmDiskImageReference', 'Set-AzureRmDiskKeyEncryptionKey', + 'New-AzureRmDiskUpdateConfig', + 'Set-AzureRmDiskUpdateDiskEncryptionKey', + 'Set-AzureRmDiskUpdateImageReference', + 'Set-AzureRmDiskUpdateKeyEncryptionKey', 'New-AzureRmSnapshot', + 'Update-AzureRmSnapshot', 'Get-AzureRmSnapshot', + 'Remove-AzureRmSnapshot', 'Grant-AzureRmSnapshotAccess', + 'Revoke-AzureRmSnapshotAccess', 'New-AzureRmSnapshotConfig', + 'Set-AzureRmSnapshotDiskEncryptionKey', + 'Set-AzureRmSnapshotImageReference', + 'Set-AzureRmSnapshotKeyEncryptionKey', + 'New-AzureRmSnapshotUpdateConfig', + 'Set-AzureRmSnapshotUpdateDiskEncryptionKey', + 'Set-AzureRmSnapshotUpdateImageReference', + 'Set-AzureRmSnapshotUpdateKeyEncryptionKey', 'New-AzureRmImage', + 'Update-AzureRmImage', 'Get-AzureRmImage', 'Remove-AzureRmImage', + 'New-AzureRmImageConfig', 'Set-AzureRmImageOsDisk', + 'Add-AzureRmImageDataDisk', 'Remove-AzureRmImageDataDisk', + 'ConvertTo-AzureRmVMManagedDisk', 'Set-AzureRmVmssBootDiagnostic', + 'Get-AzureRmComputeResourceSku', 'Get-AzureRmVMRunCommandDocument', + 'Invoke-AzureRmVMRunCommand', 'Start-AzureRmVmssRollingOSUpgrade', + 'Stop-AzureRmVmssRollingUpgrade', 'Get-AzureRmVmssRollingUpgrade', + 'Set-AzureRmVmssRollingUpgradePolicy', + 'Set-AzureRmVmssDiskEncryptionExtension', + 'Disable-AzureRmVmssDiskEncryption', + 'Get-AzureRmVmssDiskEncryption', 'Get-AzureRmVmssVMDiskEncryption' # Variables to export from this module # VariablesToExport = @() diff --git a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.Netcore.csproj b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.Netcore.csproj index 9239e18884c6..bec57e10c5d8 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.Netcore.csproj +++ b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.Netcore.csproj @@ -1,16 +1,20 @@  + + netcoreapp2.0 win10-x64 Microsoft.Azure.Commands.Compute Microsoft.Azure.Commands.Compute false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Compute.Netcore\ + false @@ -23,13 +27,11 @@ - - - - + + @@ -37,9 +39,8 @@ - - - + + @@ -135,10 +136,11 @@ - - + + + diff --git a/src/ResourceManager/KeyVault/AzureRM.KeyVault.Netcore.psd1 b/src/ResourceManager/KeyVault/AzureRM.KeyVault.Netcore.psd1 new file mode 100644 index 000000000000..387017d68241 --- /dev/null +++ b/src/ResourceManager/KeyVault/AzureRM.KeyVault.Netcore.psd1 @@ -0,0 +1,164 @@ +# +# Module manifest for module 'PSGet_AzureRM.KeyVault' +# +# Generated by: Microsoft Corporation +# +# Generated on: 4/3/2017 +# + +@{ + +# Script module or binary module file associated with this manifest. +# RootModule = '' + +# Version number of this module. +ModuleVersion = '0.9.6' + +# Supported PSEditions +CompatiblePSEditions = 'Core' + +# ID used to uniquely identify this module +GUID = 'cd188042-f215-4657-adfe-c17ae28cf730' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = '[PowerShell .Net Core] Microsoft Azure PowerShell - KeyVault service cmdlets for Azure Resource Manager' + +# Minimum version of the Windows PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the Windows PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the Windows PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# DotNetFrameworkVersion = '4.0' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# CLRVersion = '4.0' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.9.6'; }) + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.KeyVault.dll', + 'netcoreapp2.0\Microsoft.Azure.KeyVault.WebKey.dll', + 'netcoreapp2.0\Microsoft.Azure.Management.KeyVault.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'netcoreapp2.0\Microsoft.Azure.Commands.KeyVault.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @('netcoreapp2.0\Microsoft.Azure.Commands.KeyVault.dll') + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Add-AzureKeyVaultCertificate', + 'Set-AzureKeyVaultCertificateAttribute', + 'Stop-AzureKeyVaultCertificateOperation', + 'Get-AzureKeyVaultCertificateOperation', + 'Import-AzureKeyVaultCertificate', + 'Add-AzureKeyVaultCertificateContact', + 'Get-AzureKeyVaultCertificate', + 'Get-AzureKeyVaultCertificateContact', + 'Get-AzureKeyVaultCertificateIssuer', + 'New-AzureKeyVaultCertificatePolicy', + 'Remove-AzureKeyVaultCertificate', + 'Remove-AzureKeyVaultCertificateContact', + 'Remove-AzureKeyVaultCertificateIssuer', + 'Remove-AzureKeyVaultCertificateOperation', + 'Set-AzureKeyVaultCertificateIssuer', + 'Set-AzureKeyVaultCertificatePolicy', 'Get-AzureRmKeyVault', + 'New-AzureRmKeyVault', 'Remove-AzureRmKeyVault', + 'Undo-AzureRmKeyVaultRemoval', 'Remove-AzureRmKeyVaultAccessPolicy', + 'Set-AzureRmKeyVaultAccessPolicy', 'Backup-AzureKeyVaultKey', + 'Get-AzureKeyVaultKey', 'Get-AzureKeyVaultSecret', + 'Undo-AzureKeyVaultKeyRemoval', 'Undo-AzureKeyVaultSecretRemoval', + 'Add-AzureKeyVaultKey', 'Remove-AzureKeyVaultKey', + 'Remove-AzureKeyVaultSecret', 'Restore-AzureKeyVaultKey', + 'Set-AzureKeyVaultKeyAttribute', 'Set-AzureKeyVaultSecret', + 'Set-AzureKeyVaultSecretAttribute', + 'Get-AzureKeyVaultCertificatePolicy', + 'New-AzureKeyVaultCertificateAdministratorDetails', + 'New-AzureKeyVaultCertificateOrganizationDetails', + 'Backup-AzureKeyVaultSecret', 'Restore-AzureKeyVaultSecret', + 'Get-AzureKeyVaultManagedStorageAccount', + 'Add-AzureKeyVaultManagedStorageAccount', + 'Remove-AzureKeyVaultManagedStorageAccount', + 'Update-AzureKeyVaultManagedStorageAccount', + 'Update-AzureKeyVaultManagedStorageAccountKey', + 'Get-AzureKeyVaultManagedStorageSasDefinition', + 'Set-AzureKeyVaultManagedStorageSasDefinition', + 'Remove-AzureKeyVaultManagedStorageSasDefinition', + 'Undo-AzureKeyVaultCertificateRemoval' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Set-AzureKeyVaultKey' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','KeyVault' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website focd .netcoreapp2.0\..this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '' + + # External dependent modules of this module + # ExternalModuleDependencies = '' + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.Netcore.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.Netcore.csproj new file mode 100644 index 000000000000..2fae5748523b --- /dev/null +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.Netcore.csproj @@ -0,0 +1,76 @@ + + + + + + netcoreapp2.0 + win10-x64 + Microsoft.Azure.Commands.KeyVault + Microsoft.Azure.Commands.KeyVault + false + true + true + + + + TRACE;DEBUG;NETSTANDARD + ..\..\..\Package\Debug\ResourceManager\AzureRM.KeyVault.Netcore\ + false + + + + ..\..\..\Package\Release\ResourceManager\AzureRM.KeyVault.Netcore\ + + True + True + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + PreserveNewest + + + + \ No newline at end of file diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs index 7a9469ac2f05..90a2ec489777 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultManagementCmdletBase.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.ActiveDirectory.GraphClient; +using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory; using Microsoft.Azure.Commands.Common.Authentication; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.Azure.Commands.Common.Authentication.Models; @@ -67,9 +67,7 @@ public ActiveDirectoryClient ActiveDirectoryClient if (_activeDirectoryClient == null) { _dataServiceCredential = new DataServiceCredential(AzureSession.Instance.AuthenticationFactory, DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.Graph); - _activeDirectoryClient = new ActiveDirectoryClient(new Uri(string.Format("{0}/{1}", - DefaultProfile.DefaultContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.Graph), _dataServiceCredential.TenantId)), - () => Task.FromResult(_dataServiceCredential.GetToken())); + _activeDirectoryClient = new ActiveDirectoryClient(DefaultProfile.DefaultContext); } return this._activeDirectoryClient; } @@ -206,9 +204,7 @@ protected string GetCurrentUsersObjectId() string objectId = null; if (DefaultContext.Account.Type == AzureAccount.AccountType.User) { - var userFetcher = ActiveDirectoryClient.Me.ToUser(); - var user = userFetcher.ExecuteAsync().Result; - objectId = user.ObjectId; + objectId = ActiveDirectoryClient.GetObjectId(new ADObjectFilterOptions()).ToString(); } return objectId; @@ -229,10 +225,9 @@ private string GetObjectIdByUpn(string upn) string objId = null; if (!string.IsNullOrWhiteSpace(upn)) { - var user = ActiveDirectoryClient.Users.Where(u => u.UserPrincipalName.Equals(upn, StringComparison.OrdinalIgnoreCase)) - .ExecuteAsync().GetAwaiter().GetResult().CurrentPage.SingleOrDefault(); + var user = ActiveDirectoryClient.FilterUsers(new ADObjectFilterOptions() { SPN = upn }).SingleOrDefault(); if (user != null) - objId = user.ObjectId; + objId = user.Id.ToString(); } return objId; } @@ -242,11 +237,9 @@ private string GetObjectIdBySpn(string spn) string objId = null; if (!string.IsNullOrWhiteSpace(spn)) { - var servicePrincipal = ActiveDirectoryClient.ServicePrincipals.Where(s => - s.ServicePrincipalNames.Any(n => n.Equals(spn, StringComparison.OrdinalIgnoreCase))) - .ExecuteAsync().GetAwaiter().GetResult().CurrentPage.SingleOrDefault(); + var servicePrincipal = ActiveDirectoryClient.FilterServicePrincipals(new ADObjectFilterOptions() { SPN = spn }).SingleOrDefault(); if (servicePrincipal != null) - objId = servicePrincipal.ObjectId; + objId = servicePrincipal.Id.ToString(); } return objId; } @@ -257,12 +250,12 @@ private string GetObjectIdByEmail(string email) // In ADFS, Graph cannot handle this particular combination of filters. if (!DefaultProfile.DefaultContext.Environment.OnPremise && !string.IsNullOrWhiteSpace(email)) { - var users = ActiveDirectoryClient.Users.Where(FilterByEmail(email)).ExecuteAsync().GetAwaiter().GetResult().CurrentPage; + var users = ActiveDirectoryClient.FilterUsers(new ADObjectFilterOptions() { Mail = email }); if (users != null) { ThrowIfMultipleObjectIds(users, email); var user = users.FirstOrDefault(); - objId = user?.ObjectId; + objId = user?.Id.ToString(); } } return objId; @@ -273,7 +266,7 @@ private bool ValidateObjectId(string objId) bool isValid = false; if (!string.IsNullOrWhiteSpace(objId)) { - var objectCollection = ActiveDirectoryClient.GetObjectsByObjectIdsAsync(new[] { objId }, new string[] { }).GetAwaiter().GetResult(); + var objectCollection = ActiveDirectoryClient.GetObjectsByObjectId(new List { objId }); if (objectCollection.Any()) { isValid = true; @@ -340,12 +333,6 @@ protected bool IsValidObjectIdSyntax(string objectId) return IsValidGUid(objectId); } - private Expression> FilterByEmail(string email) - { - return u => u.Mail.Equals(email, StringComparison.OrdinalIgnoreCase) || - u.OtherMails.Any(m => m.Equals(email, StringComparison.OrdinalIgnoreCase)); - } - protected readonly string[] DefaultPermissionsToKeys = { KeyPerms.Get, diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/ModelExtensions.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/ModelExtensions.cs index e924e04a0568..2e4c33f6fc0a 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/ModelExtensions.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/ModelExtensions.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.ActiveDirectory.GraphClient; +using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory; using Microsoft.WindowsAzure.Commands.Utilities.Common; using System; using System.Collections.Generic; @@ -97,19 +97,19 @@ public static string GetDisplayNameForADObject(string objectId, ActiveDirectoryC try { - var obj = adClient.GetObjectsByObjectIdsAsync(new[] { objectId }, new string[] { }).GetAwaiter().GetResult().FirstOrDefault(); + var obj = adClient.GetObjectsByObjectId(new List { objectId }).FirstOrDefault(); if (obj != null) { - if (obj.ObjectType.Equals("user", StringComparison.InvariantCultureIgnoreCase)) + if (obj.Type.Equals("user", StringComparison.InvariantCultureIgnoreCase)) { - var user = adClient.Users.GetByObjectId(objectId).ExecuteAsync().GetAwaiter().GetResult(); + var user = adClient.FilterUsers(new ADObjectFilterOptions { Id = objectId }).FirstOrDefault(); displayName = user.DisplayName; upnOrSpn = user.UserPrincipalName; } - else if (obj.ObjectType.Equals("serviceprincipal", StringComparison.InvariantCultureIgnoreCase)) + else if (obj.Type.Equals("serviceprincipal", StringComparison.InvariantCultureIgnoreCase)) { - var servicePrincipal = adClient.ServicePrincipals.GetByObjectId(objectId).ExecuteAsync().GetAwaiter().GetResult(); - displayName = servicePrincipal.AppDisplayName; + var servicePrincipal = adClient.FilterServicePrincipals(new ADObjectFilterOptions { Id = objectId }).FirstOrDefault(); + displayName = servicePrincipal.DisplayName; upnOrSpn = servicePrincipal.ServicePrincipalNames.FirstOrDefault(); } } diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVault.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVault.cs index ceedfd29789d..6549954daca1 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVault.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVault.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.ActiveDirectory.GraphClient; +using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory; using Microsoft.Azure.Commands.ResourceManager.Common.Tags; using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; using Microsoft.Azure.Management.KeyVault.Models; diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVaultAccessPolicy.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVaultAccessPolicy.cs index 30fe062240ed..2892e23401de 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVaultAccessPolicy.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSVaultAccessPolicy.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.ActiveDirectory.GraphClient; +using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory; using System; using System.Collections.Generic; using KeyVaultManagement = Microsoft.Azure.Management.KeyVault; diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/VaultManagementClient.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/VaultManagementClient.cs index 19e7dd35ec27..8cdf5002fb4d 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/VaultManagementClient.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/VaultManagementClient.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.ActiveDirectory.GraphClient; +using Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory; using Microsoft.Azure.Commands.Common.Authentication; using Microsoft.Azure.Commands.Common.Authentication.Models; using Microsoft.Azure.Commands.ResourceManager.Common.Tags; diff --git a/src/ResourceManager/Network/AzureRM.Network.Netcore.psd1 b/src/ResourceManager/Network/AzureRM.Network.Netcore.psd1 index 3d1285d4eb05..83f963b7fd0c 100644 --- a/src/ResourceManager/Network/AzureRM.Network.Netcore.psd1 +++ b/src/ResourceManager/Network/AzureRM.Network.Netcore.psd1 @@ -54,7 +54,8 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; }) # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\AutoMapper.dll', + 'netcoreapp2.0\Microsoft.Azure.Management.Network.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. ScriptsToProcess = @('netcoreapp2.0\AzureRmNetworkStartup.ps1') @@ -73,232 +74,240 @@ FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Add-AzureRmApplicationGatewayAuthenticationCertificate', - 'Get-AzureRmApplicationGatewayAuthenticationCertificate', - 'New-AzureRmApplicationGatewayAuthenticationCertificate', - 'Remove-AzureRmApplicationGatewayAuthenticationCertificate', - 'Set-AzureRmApplicationGatewayAuthenticationCertificate', - 'Get-AzureRmApplicationGatewayAvailableWafRuleSets', - 'Add-AzureRmApplicationGatewayBackendAddressPool', - 'Get-AzureRmApplicationGatewayBackendAddressPool', - 'New-AzureRmApplicationGatewayBackendAddressPool', - 'Remove-AzureRmApplicationGatewayBackendAddressPool', - 'Set-AzureRmApplicationGatewayBackendAddressPool', - 'Add-AzureRmApplicationGatewayBackendHttpSettings', - 'Get-AzureRmApplicationGatewayBackendHttpSettings', - 'New-AzureRmApplicationGatewayBackendHttpSettings', - 'Remove-AzureRmApplicationGatewayBackendHttpSettings', - 'Set-AzureRmApplicationGatewayBackendHttpSettings', - 'Get-AzureRmApplicationGatewayConnectionDraining', - 'New-AzureRmApplicationGatewayConnectionDraining', - 'Remove-AzureRmApplicationGatewayConnectionDraining', - 'Set-AzureRmApplicationGatewayConnectionDraining', - 'Get-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', - 'New-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', - 'Set-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', - 'New-AzureRmApplicationGatewayFirewallDisabledRuleGroupConfig', - 'Add-AzureRmApplicationGatewayFrontendIPConfig', - 'Get-AzureRmApplicationGatewayFrontendIPConfig', - 'New-AzureRmApplicationGatewayFrontendIPConfig', - 'Remove-AzureRmApplicationGatewayFrontendIPConfig', - 'Set-AzureRmApplicationGatewayFrontendIPConfig', - 'Add-AzureRmApplicationGatewayFrontendPort', - 'Get-AzureRmApplicationGatewayFrontendPort', - 'New-AzureRmApplicationGatewayFrontendPort', - 'Remove-AzureRmApplicationGatewayFrontendPort', - 'Set-AzureRmApplicationGatewayFrontendPort', - 'Add-AzureRmApplicationGatewayIPConfiguration', - 'Get-AzureRmApplicationGatewayIPConfiguration', - 'New-AzureRmApplicationGatewayIPConfiguration', - 'Remove-AzureRmApplicationGatewayIPConfiguration', - 'Set-AzureRmApplicationGatewayIPConfiguration', - 'Get-AzureRmApplicationGatewayBackendHealth', - 'Get-AzureRmApplicationGateway', - 'Add-AzureRmApplicationGatewayHttpListener', - 'Get-AzureRmApplicationGatewayHttpListener', - 'New-AzureRmApplicationGatewayHttpListener', - 'Remove-AzureRmApplicationGatewayHttpListener', - 'Set-AzureRmApplicationGatewayHttpListener', - 'New-AzureRmApplicationGateway', - 'New-AzureRmApplicationGatewayPathRuleConfig', - 'Add-AzureRmApplicationGatewayProbeConfig', - 'Get-AzureRmApplicationGatewayProbeConfig', - 'New-AzureRmApplicationGatewayProbeConfig', - 'Remove-AzureRmApplicationGatewayProbeConfig', - 'Set-AzureRmApplicationGatewayProbeConfig', - 'Remove-AzureRmApplicationGateway', - 'Add-AzureRmApplicationGatewayRequestRoutingRule', - 'Get-AzureRmApplicationGatewayRequestRoutingRule', - 'New-AzureRmApplicationGatewayRequestRoutingRule', - 'Remove-AzureRmApplicationGatewayRequestRoutingRule', - 'Set-AzureRmApplicationGatewayRequestRoutingRule', - 'Set-AzureRmApplicationGateway', 'Get-AzureRmApplicationGatewaySku', - 'New-AzureRmApplicationGatewaySku', - 'Set-AzureRmApplicationGatewaySku', - 'Add-AzureRmApplicationGatewaySslCertificate', - 'Get-AzureRmApplicationGatewaySslCertificate', - 'New-AzureRmApplicationGatewaySslCertificate', - 'Remove-AzureRmApplicationGatewaySslCertificate', - 'Set-AzureRmApplicationGatewaySslCertificate', - 'Get-AzureRmApplicationGatewaySslPolicy', - 'New-AzureRmApplicationGatewaySslPolicy', - 'Remove-AzureRmApplicationGatewaySslPolicy', - 'Set-AzureRmApplicationGatewaySslPolicy', - 'Start-AzureRmApplicationGateway', 'Stop-AzureRmApplicationGateway', - 'Add-AzureRmApplicationGatewayUrlPathMapConfig', - 'Get-AzureRmApplicationGatewayUrlPathMapConfig', - 'New-AzureRmApplicationGatewayUrlPathMapConfig', - 'Remove-AzureRmApplicationGatewayUrlPathMapConfig', - 'Set-AzureRmApplicationGatewayUrlPathMapConfig', - 'Add-AzureRmExpressRouteCircuitAuthorization', - 'Get-AzureRmExpressRouteCircuitAuthorization', - 'New-AzureRmExpressRouteCircuitAuthorization', - 'Remove-AzureRmExpressRouteCircuitAuthorization', - 'Move-AzureRmExpressRouteCircuit', - 'Get-AzureRmExpressRouteCircuitARPTable', - 'Get-AzureRmExpressRouteCircuitRouteTable', - 'Get-AzureRmExpressRouteCircuitRouteTableSummary', - 'Get-AzureRmExpressRouteCircuitStats', - 'Add-AzureRmLoadBalancerInboundNatPoolConfig', - 'Get-AzureRmLoadBalancerInboundNatPoolConfig', - 'New-AzureRmLoadBalancerInboundNatPoolConfig', - 'Remove-AzureRmLoadBalancerInboundNatPoolConfig', - 'Set-AzureRmLoadBalancerInboundNatPoolConfig', - 'Get-AzureRmExpressRouteCircuit', 'New-AzureRmExpressRouteCircuit', - 'Add-AzureRmExpressRouteCircuitPeeringConfig', - 'Get-AzureRmExpressRouteCircuitPeeringConfig', - 'New-AzureRmExpressRouteCircuitPeeringConfig', - 'Remove-AzureRmExpressRouteCircuitPeeringConfig', - 'Set-AzureRmExpressRouteCircuitPeeringConfig', - 'Remove-AzureRmExpressRouteCircuit', - 'Set-AzureRmExpressRouteCircuit', - 'Get-AzureRmEffectiveNetworkSecurityGroup', - 'Get-AzureRmEffectiveRouteTable', - 'Add-AzureRmNetworkInterfaceIpConfig', - 'Get-AzureRmNetworkInterfaceIpConfig', - 'New-AzureRmNetworkInterfaceIpConfig', - 'Remove-AzureRmNetworkInterfaceIpConfig', - 'Set-AzureRmNetworkInterfaceIpConfig', 'New-AzureRmNetworkWatcher', - 'Get-AzureRmNetworkWatcher', 'Remove-AzureRmNetworkWatcher', - 'New-AzureRmNetworkWatcherPacketCapture', - 'Get-AzureRmNetworkWatcherPacketCapture', - 'Stop-AzureRmNetworkWatcherPacketCapture', - 'Remove-AzureRmNetworkWatcherPacketCapture', - 'New-AzureRmPacketCaptureFilterConfig', - 'Get-AzureRmNetworkWatcherTopology', - 'Get-AzureRmNetworkWatcherSecurityGroupView', - 'Test-AzureRmNetworkWatcherIPFlow', - 'Get-AzureRmNetworkWatcherNextHop', - 'Start-AzureRmNetworkWatcherResourceTroubleshooting', - 'Get-AzureRmNetworkWatcherTroubleshootingResult', - 'Get-AzureRmNetworkWatcherFlowLogStatus', - 'Set-AzureRmNetworkWatcherConfigFlowLog', - 'Test-AzureRmNetworkWatcherConnectivity', - 'Get-AzureRmExpressRouteServiceProvider', - 'Test-AzureRmPrivateIPAddressAvailability', - 'Get-AzureRmPublicIpAddress', 'New-AzureRmPublicIpAddress', - 'Remove-AzureRmPublicIpAddress', 'Set-AzureRmPublicIpAddress', - 'Get-AzureRmRouteTable', 'New-AzureRmRouteTable', - 'Remove-AzureRmRouteTable', 'Add-AzureRmRouteConfig', - 'Get-AzureRmRouteConfig', 'New-AzureRmRouteConfig', - 'Remove-AzureRmRouteConfig', 'Set-AzureRmRouteConfig', - 'Set-AzureRmRouteTable', 'Set-AzureRmVirtualNetworkGateway', - 'Get-AzureRmVirtualNetworkGateway', - 'New-AzureRmVirtualNetworkGateway', - 'Get-AzureRmVpnClientRootCertificate', - 'Get-AzureRmVpnClientRevokedCertificate', - 'Add-AzureRmVpnClientRootCertificate', - 'Add-AzureRmVpnClientRevokedCertificate', - 'New-AzureRmVpnClientRootCertificate', - 'New-AzureRmVpnClientRevokedCertificate', - 'Resize-AzureRmVirtualNetworkGateway', - 'Remove-AzureRmVpnClientRevokedCertificate', - 'Remove-AzureRmVpnClientRootCertificate', - 'Set-AzureRmVirtualNetworkGatewayVpnClientConfig', - 'Get-AzureRmVpnClientPackage', - 'New-AzureRmVpnClientConfiguration', - 'Get-AzureRmVpnClientConfiguration', - 'New-AzureRmVirtualNetworkGatewayIpConfig', - 'Add-AzureRmVirtualNetworkGatewayIpConfig', - 'Remove-AzureRmVirtualNetworkGatewayIpConfig', - 'Remove-AzureRmVirtualNetworkGateway', - 'Reset-AzureRmVirtualNetworkGateway', - 'Set-AzureRmVirtualNetworkGatewayDefaultSite', - 'Remove-AzureRmVirtualNetworkGatewayDefaultSite', - 'Remove-AzureRmLocalNetworkGateway', - 'Get-AzureRmLocalNetworkGateway', 'New-AzureRmLocalNetworkGateway', - 'Set-AzureRmLocalNetworkGateway', - 'Get-AzureRmVirtualNetworkGatewayConnection', - 'Get-AzureRmVirtualNetworkGatewayConnectionSharedKey', - 'New-AzureRmVirtualNetworkGatewayConnection', - 'Remove-AzureRmVirtualNetworkGatewayConnection', - 'Reset-AzureRmVirtualNetworkGatewayConnectionSharedKey', - 'Set-AzureRmVirtualNetworkGatewayConnectionSharedKey', - 'Set-AzureRmVirtualNetworkGatewayConnection', - 'New-AzureRmIpsecPolicy', - 'Get-AzureRmLoadBalancerBackendAddressPoolConfig', - 'Add-AzureRmLoadBalancerBackendAddressPoolConfig', - 'New-AzureRmLoadBalancerBackendAddressPoolConfig', - 'Remove-AzureRmLoadBalancerBackendAddressPoolConfig', - 'Set-AzureRmLoadBalancerFrontendIpConfig', - 'Get-AzureRmLoadBalancerFrontendIpConfig', - 'Add-AzureRmLoadBalancerFrontendIpConfig', - 'New-AzureRmLoadBalancerFrontendIpConfig', - 'Remove-AzureRmLoadBalancerFrontendIpConfig', - 'Get-AzureRmLoadBalancer', - 'Set-AzureRmLoadBalancerInboundNatRuleConfig', - 'Get-AzureRmLoadBalancerInboundNatRuleConfig', - 'Add-AzureRmLoadBalancerInboundNatRuleConfig', - 'New-AzureRmLoadBalancerInboundNatRuleConfig', - 'Remove-AzureRmLoadBalancerInboundNatRuleConfig', - 'Get-AzureRmBgpServiceCommunity', 'Get-AzureRmRouteFilter', - 'Set-AzureRmRouteFilter', 'Remove-AzureRmRouteFilter', - 'New-AzureRmRouteFilter', 'Get-AzureRmRouteFilterRuleConfig', - 'Add-AzureRmRouteFilterRuleConfig', - 'Remove-AzureRmRouteFilterRuleConfig', - 'Set-AzureRmRouteFilterRuleConfig', - 'New-AzureRmRouteFilterRuleConfig', - 'Set-AzureRmLoadBalancerRuleConfig', - 'Get-AzureRmLoadBalancerRuleConfig', - 'Add-AzureRmLoadBalancerRuleConfig', - 'New-AzureRmLoadBalancerRuleConfig', - 'Remove-AzureRmLoadBalancerRuleConfig', 'New-AzureRmLoadBalancer', - 'Set-AzureRmLoadBalancerProbeConfig', - 'Get-AzureRmLoadBalancerProbeConfig', - 'Add-AzureRmLoadBalancerProbeConfig', - 'New-AzureRmLoadBalancerProbeConfig', - 'Remove-AzureRmLoadBalancerProbeConfig', - 'Remove-AzureRmLoadBalancer', 'Set-AzureRmLoadBalancer', - 'Remove-AzureRmNetworkInterface', 'Get-AzureRmNetworkInterface', - 'New-AzureRmNetworkInterface', 'Set-AzureRmNetworkInterface', - 'Get-AzureRmNetworkSecurityGroup', - 'New-AzureRmNetworkSecurityRuleConfig', - 'Get-AzureRmNetworkSecurityRuleConfig', - 'Remove-AzureRmNetworkSecurityRuleConfig', - 'Set-AzureRmNetworkSecurityRuleConfig', - 'Add-AzureRmNetworkSecurityRuleConfig', - 'New-AzureRmNetworkSecurityGroup', - 'Remove-AzureRmNetworkSecurityGroup', - 'Set-AzureRmNetworkSecurityGroup', 'Test-AzureRmDnsAvailability', - 'Add-AzureRmVirtualNetworkPeering', - 'Get-AzureRmVirtualNetworkPeering', - 'Remove-AzureRmVirtualNetworkPeering', - 'Set-AzureRmVirtualNetworkPeering', 'Remove-AzureRmVirtualNetwork', - 'Set-AzureRmVirtualNetwork', - 'Remove-AzureRmVirtualNetworkSubnetConfig', - 'Set-AzureRmVirtualNetworkSubnetConfig', - 'Get-AzureRmVirtualNetworkSubnetConfig', - 'Add-AzureRmVirtualNetworkSubnetConfig', - 'New-AzureRmVirtualNetworkSubnetConfig', - 'Get-AzureRmVirtualNetwork', 'New-AzureRmVirtualNetwork', - 'Get-AzureRmVirtualNetworkGatewayBgpPeerStatus', - 'Get-AzureRmVirtualNetworkGatewayAdvertisedRoute', - 'Get-AzureRmVirtualNetworkGatewayLearnedRoute', - 'Get-AzureRmNetworkUsage', - 'Get-AzureRmVirtualNetworkGatewaySupportedVpnDevice', - 'Get-AzureRmVirtualNetworkGatewayConnectionVpnDeviceConfigScript', - 'New-AzureRmApplicationSecurityGroup', - 'Remove-AzureRmApplicationSecurityGroup', - 'Get-AzureRmApplicationSecurityGroup' +'Get-AzureRmApplicationGatewayAuthenticationCertificate', +'New-AzureRmApplicationGatewayAuthenticationCertificate', +'Remove-AzureRmApplicationGatewayAuthenticationCertificate', +'Set-AzureRmApplicationGatewayAuthenticationCertificate', +'Get-AzureRmApplicationGatewayAvailableWafRuleSets', +'Get-AzureRmApplicationGatewayAvailableSslOptions', +'Add-AzureRmApplicationGatewayBackendAddressPool', +'Get-AzureRmApplicationGatewayBackendAddressPool', +'New-AzureRmApplicationGatewayBackendAddressPool', +'Remove-AzureRmApplicationGatewayBackendAddressPool', +'Set-AzureRmApplicationGatewayBackendAddressPool', +'Add-AzureRmApplicationGatewayBackendHttpSettings', +'Get-AzureRmApplicationGatewayBackendHttpSettings', +'New-AzureRmApplicationGatewayBackendHttpSettings', +'Remove-AzureRmApplicationGatewayBackendHttpSettings', +'Set-AzureRmApplicationGatewayBackendHttpSettings', +'Get-AzureRmApplicationGatewayConnectionDraining', +'New-AzureRmApplicationGatewayConnectionDraining', +'Remove-AzureRmApplicationGatewayConnectionDraining', +'Set-AzureRmApplicationGatewayConnectionDraining', +'Get-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', +'New-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', +'Set-AzureRmApplicationGatewayWebApplicationFirewallConfiguration', +'New-AzureRmApplicationGatewayFirewallDisabledRuleGroupConfig', +'Add-AzureRmApplicationGatewayFrontendIPConfig', +'Get-AzureRmApplicationGatewayFrontendIPConfig', +'New-AzureRmApplicationGatewayFrontendIPConfig', +'Remove-AzureRmApplicationGatewayFrontendIPConfig', +'Set-AzureRmApplicationGatewayFrontendIPConfig', +'Add-AzureRmApplicationGatewayFrontendPort', +'Get-AzureRmApplicationGatewayFrontendPort', +'New-AzureRmApplicationGatewayFrontendPort', +'Remove-AzureRmApplicationGatewayFrontendPort', +'Set-AzureRmApplicationGatewayFrontendPort', +'Add-AzureRmApplicationGatewayIPConfiguration', +'Get-AzureRmApplicationGatewayIPConfiguration', +'New-AzureRmApplicationGatewayIPConfiguration', +'Remove-AzureRmApplicationGatewayIPConfiguration', +'Set-AzureRmApplicationGatewayIPConfiguration', +'Get-AzureRmApplicationGatewayBackendHealth', +'Get-AzureRmApplicationGateway', +'Add-AzureRmApplicationGatewayHttpListener', +'Get-AzureRmApplicationGatewayHttpListener', +'New-AzureRmApplicationGatewayHttpListener', +'Remove-AzureRmApplicationGatewayHttpListener', +'Set-AzureRmApplicationGatewayHttpListener', +'New-AzureRmApplicationGateway', +'New-AzureRmApplicationGatewayPathRuleConfig', +'Add-AzureRmApplicationGatewayProbeConfig', +'Get-AzureRmApplicationGatewayProbeConfig', +'New-AzureRmApplicationGatewayProbeConfig', +'Remove-AzureRmApplicationGatewayProbeConfig', +'Set-AzureRmApplicationGatewayProbeConfig', +'New-AzureRmApplicationGatewayProbeHealthResponseMatch', +'Remove-AzureRmApplicationGateway', +'Add-AzureRmApplicationGatewayRequestRoutingRule', +'Get-AzureRmApplicationGatewayRequestRoutingRule', +'New-AzureRmApplicationGatewayRequestRoutingRule', +'Remove-AzureRmApplicationGatewayRequestRoutingRule', +'Set-AzureRmApplicationGatewayRequestRoutingRule', +'Add-AzureRmApplicationGatewayRedirectConfiguration', +'Get-AzureRmApplicationGatewayRedirectConfiguration', +'New-AzureRmApplicationGatewayRedirectConfiguration', +'Remove-AzureRmApplicationGatewayRedirectConfiguration', +'Set-AzureRmApplicationGatewayRedirectConfiguration', +'Set-AzureRmApplicationGateway', 'Get-AzureRmApplicationGatewaySku', +'New-AzureRmApplicationGatewaySku', +'Set-AzureRmApplicationGatewaySku', +'Add-AzureRmApplicationGatewaySslCertificate', +'Get-AzureRmApplicationGatewaySslCertificate', +'New-AzureRmApplicationGatewaySslCertificate', +'Remove-AzureRmApplicationGatewaySslCertificate', +'Set-AzureRmApplicationGatewaySslCertificate', +'Get-AzureRmApplicationGatewaySslPolicy', +'New-AzureRmApplicationGatewaySslPolicy', +'Remove-AzureRmApplicationGatewaySslPolicy', +'Set-AzureRmApplicationGatewaySslPolicy', +'Get-AzureRmApplicationGatewaySslPredefinedPolicy', +'Start-AzureRmApplicationGateway', 'Stop-AzureRmApplicationGateway', +'Add-AzureRmApplicationGatewayUrlPathMapConfig', +'Get-AzureRmApplicationGatewayUrlPathMapConfig', +'New-AzureRmApplicationGatewayUrlPathMapConfig', +'Remove-AzureRmApplicationGatewayUrlPathMapConfig', +'Set-AzureRmApplicationGatewayUrlPathMapConfig', +'Add-AzureRmExpressRouteCircuitAuthorization', +'Get-AzureRmExpressRouteCircuitAuthorization', +'New-AzureRmExpressRouteCircuitAuthorization', +'Remove-AzureRmExpressRouteCircuitAuthorization', +'Move-AzureRmExpressRouteCircuit', +'Get-AzureRmExpressRouteCircuitARPTable', +'Get-AzureRmExpressRouteCircuitRouteTable', +'Get-AzureRmExpressRouteCircuitRouteTableSummary', +'Get-AzureRmExpressRouteCircuitStats', +'Add-AzureRmLoadBalancerInboundNatPoolConfig', +'Get-AzureRmLoadBalancerInboundNatPoolConfig', +'New-AzureRmLoadBalancerInboundNatPoolConfig', +'Remove-AzureRmLoadBalancerInboundNatPoolConfig', +'Set-AzureRmLoadBalancerInboundNatPoolConfig', +'Get-AzureRmExpressRouteCircuit', 'New-AzureRmExpressRouteCircuit', +'Add-AzureRmExpressRouteCircuitPeeringConfig', +'Get-AzureRmExpressRouteCircuitPeeringConfig', +'New-AzureRmExpressRouteCircuitPeeringConfig', +'Remove-AzureRmExpressRouteCircuitPeeringConfig', +'Set-AzureRmExpressRouteCircuitPeeringConfig', +'Remove-AzureRmExpressRouteCircuit', +'Set-AzureRmExpressRouteCircuit', +'Get-AzureRmEffectiveNetworkSecurityGroup', +'Get-AzureRmEffectiveRouteTable', +'Add-AzureRmNetworkInterfaceIpConfig', +'Get-AzureRmNetworkInterfaceIpConfig', +'New-AzureRmNetworkInterfaceIpConfig', +'Remove-AzureRmNetworkInterfaceIpConfig', +'Set-AzureRmNetworkInterfaceIpConfig', 'New-AzureRmNetworkWatcher', +'Get-AzureRmNetworkWatcher', 'Remove-AzureRmNetworkWatcher', +'New-AzureRmNetworkWatcherPacketCapture', +'Get-AzureRmNetworkWatcherPacketCapture', +'Stop-AzureRmNetworkWatcherPacketCapture', +'Remove-AzureRmNetworkWatcherPacketCapture', +'New-AzureRmPacketCaptureFilterConfig', +'Get-AzureRmNetworkWatcherTopology', +'Get-AzureRmNetworkWatcherSecurityGroupView', +'Test-AzureRmNetworkWatcherIPFlow', +'Get-AzureRmNetworkWatcherNextHop', +'Start-AzureRmNetworkWatcherResourceTroubleshooting', +'Get-AzureRmNetworkWatcherTroubleshootingResult', +'Get-AzureRmNetworkWatcherFlowLogStatus', +'Set-AzureRmNetworkWatcherConfigFlowLog', +'Test-AzureRmNetworkWatcherConnectivity', +'Get-AzureRmExpressRouteServiceProvider', +'Test-AzureRmPrivateIPAddressAvailability', +'Get-AzureRmPublicIpAddress', 'New-AzureRmPublicIpAddress', +'Remove-AzureRmPublicIpAddress', 'Set-AzureRmPublicIpAddress', +'Get-AzureRmRouteTable', 'New-AzureRmRouteTable', +'Remove-AzureRmRouteTable', 'Add-AzureRmRouteConfig', +'Get-AzureRmRouteConfig', 'New-AzureRmRouteConfig', +'Remove-AzureRmRouteConfig', 'Set-AzureRmRouteConfig', +'Set-AzureRmRouteTable', 'Set-AzureRmVirtualNetworkGateway', +'Get-AzureRmVirtualNetworkGateway', +'New-AzureRmVirtualNetworkGateway', +'Get-AzureRmVpnClientRootCertificate', +'Get-AzureRmVpnClientRevokedCertificate', +'Add-AzureRmVpnClientRootCertificate', +'Add-AzureRmVpnClientRevokedCertificate', +'New-AzureRmVpnClientRootCertificate', +'New-AzureRmVpnClientRevokedCertificate', +'Resize-AzureRmVirtualNetworkGateway', +'Remove-AzureRmVpnClientRevokedCertificate', +'Remove-AzureRmVpnClientRootCertificate', +'Set-AzureRmVirtualNetworkGatewayVpnClientConfig', +'Get-AzureRmVpnClientPackage', 'New-AzureRmVpnClientConfiguration', +'Get-AzureRmVpnClientConfiguration', +'New-AzureRmVirtualNetworkGatewayIpConfig', +'Add-AzureRmVirtualNetworkGatewayIpConfig', +'Remove-AzureRmVirtualNetworkGatewayIpConfig', +'Remove-AzureRmVirtualNetworkGateway', +'Reset-AzureRmVirtualNetworkGateway', +'Set-AzureRmVirtualNetworkGatewayDefaultSite', +'Remove-AzureRmVirtualNetworkGatewayDefaultSite', +'Remove-AzureRmLocalNetworkGateway', +'Get-AzureRmLocalNetworkGateway', 'New-AzureRmLocalNetworkGateway', +'Set-AzureRmLocalNetworkGateway', +'Get-AzureRmVirtualNetworkGatewayConnection', +'Get-AzureRmVirtualNetworkGatewayConnectionSharedKey', +'New-AzureRmVirtualNetworkGatewayConnection', +'Remove-AzureRmVirtualNetworkGatewayConnection', +'Reset-AzureRmVirtualNetworkGatewayConnectionSharedKey', +'Set-AzureRmVirtualNetworkGatewayConnectionSharedKey', +'Set-AzureRmVirtualNetworkGatewayConnection', +'New-AzureRmIpsecPolicy', +'Get-AzureRmLoadBalancerBackendAddressPoolConfig', +'Add-AzureRmLoadBalancerBackendAddressPoolConfig', +'New-AzureRmLoadBalancerBackendAddressPoolConfig', +'Remove-AzureRmLoadBalancerBackendAddressPoolConfig', +'Set-AzureRmLoadBalancerFrontendIpConfig', +'Get-AzureRmLoadBalancerFrontendIpConfig', +'Add-AzureRmLoadBalancerFrontendIpConfig', +'New-AzureRmLoadBalancerFrontendIpConfig', +'Remove-AzureRmLoadBalancerFrontendIpConfig', +'Get-AzureRmLoadBalancer', +'Set-AzureRmLoadBalancerInboundNatRuleConfig', +'Get-AzureRmLoadBalancerInboundNatRuleConfig', +'Add-AzureRmLoadBalancerInboundNatRuleConfig', +'New-AzureRmLoadBalancerInboundNatRuleConfig', +'Remove-AzureRmLoadBalancerInboundNatRuleConfig', +'Get-AzureRmBgpServiceCommunity', 'Get-AzureRmRouteFilter', +'Set-AzureRmRouteFilter', 'Remove-AzureRmRouteFilter', +'New-AzureRmRouteFilter', 'Get-AzureRmRouteFilterRuleConfig', +'Add-AzureRmRouteFilterRuleConfig', +'Remove-AzureRmRouteFilterRuleConfig', +'Set-AzureRmRouteFilterRuleConfig', +'New-AzureRmRouteFilterRuleConfig', +'Set-AzureRmLoadBalancerRuleConfig', +'Get-AzureRmLoadBalancerRuleConfig', +'Add-AzureRmLoadBalancerRuleConfig', +'New-AzureRmLoadBalancerRuleConfig', +'Remove-AzureRmLoadBalancerRuleConfig', 'New-AzureRmLoadBalancer', +'Set-AzureRmLoadBalancerProbeConfig', +'Get-AzureRmLoadBalancerProbeConfig', +'Add-AzureRmLoadBalancerProbeConfig', +'New-AzureRmLoadBalancerProbeConfig', +'Remove-AzureRmLoadBalancerProbeConfig', +'Remove-AzureRmLoadBalancer', 'Set-AzureRmLoadBalancer', +'Remove-AzureRmNetworkInterface', 'Get-AzureRmNetworkInterface', +'New-AzureRmNetworkInterface', 'Set-AzureRmNetworkInterface', +'Get-AzureRmNetworkSecurityGroup', +'New-AzureRmNetworkSecurityRuleConfig', +'Get-AzureRmNetworkSecurityRuleConfig', +'Remove-AzureRmNetworkSecurityRuleConfig', +'Set-AzureRmNetworkSecurityRuleConfig', +'Add-AzureRmNetworkSecurityRuleConfig', +'New-AzureRmNetworkSecurityGroup', +'Remove-AzureRmNetworkSecurityGroup', +'Set-AzureRmNetworkSecurityGroup', 'Test-AzureRmDnsAvailability', +'Add-AzureRmVirtualNetworkPeering', +'Get-AzureRmVirtualNetworkPeering', +'Remove-AzureRmVirtualNetworkPeering', +'Set-AzureRmVirtualNetworkPeering', 'Remove-AzureRmVirtualNetwork', +'Set-AzureRmVirtualNetwork', +'Remove-AzureRmVirtualNetworkSubnetConfig', +'Set-AzureRmVirtualNetworkSubnetConfig', +'Get-AzureRmVirtualNetworkSubnetConfig', +'Add-AzureRmVirtualNetworkSubnetConfig', +'New-AzureRmVirtualNetworkSubnetConfig', +'Get-AzureRmVirtualNetwork', 'New-AzureRmVirtualNetwork', +'Get-AzureRmVirtualNetworkGatewayBgpPeerStatus', +'Get-AzureRmVirtualNetworkGatewayAdvertisedRoute', +'Get-AzureRmVirtualNetworkGatewayLearnedRoute', +'Get-AzureRmNetworkUsage', 'Get-AzureRmVirtualNetworkUsageList', +'Get-AzureRmVirtualNetworkAvailableEndpointService', +'Get-AzureRmVirtualNetworkGatewaySupportedVpnDevice', +'Get-AzureRmVirtualNetworkGatewayConnectionVpnDeviceConfigScript', +'New-AzureRmApplicationSecurityGroup', +'Remove-AzureRmApplicationSecurityGroup', +'Get-AzureRmApplicationSecurityGroup' # Variables to export from this module # VariablesToExport = @() diff --git a/src/ResourceManager/Network/Commands.Network/Commands.Network.Netcore.csproj b/src/ResourceManager/Network/Commands.Network/Commands.Network.Netcore.csproj index ad57997293d6..f7418df9b811 100644 --- a/src/ResourceManager/Network/Commands.Network/Commands.Network.Netcore.csproj +++ b/src/ResourceManager/Network/Commands.Network/Commands.Network.Netcore.csproj @@ -1,16 +1,20 @@ + + netcoreapp2.0 win10-x64 Microsoft.Azure.Commands.Network Microsoft.Azure.Commands.Network false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Network.Netcore\ + false @@ -23,18 +27,14 @@ - - - + - - @@ -44,7 +44,8 @@ - + + diff --git a/src/ResourceManager/Network/Stack/Commands.Network/Commands.Network.Netcore.csproj b/src/ResourceManager/Network/Stack/Commands.Network/Commands.Network.Netcore.csproj index ad57997293d6..45c4f97f036f 100644 --- a/src/ResourceManager/Network/Stack/Commands.Network/Commands.Network.Netcore.csproj +++ b/src/ResourceManager/Network/Stack/Commands.Network/Commands.Network.Netcore.csproj @@ -1,5 +1,7 @@ + + netcoreapp2.0 win10-x64 @@ -23,8 +25,6 @@ - - @@ -33,8 +33,6 @@ - - @@ -44,7 +42,7 @@ - + diff --git a/src/ResourceManager/Profile/AzureRM.Profile.Netcore.psd1 b/src/ResourceManager/Profile/AzureRM.Profile.Netcore.psd1 index 0f63148cf242..a70a047478fd 100644 --- a/src/ResourceManager/Profile/AzureRM.Profile.Netcore.psd1 +++ b/src/ResourceManager/Profile/AzureRM.Profile.Netcore.psd1 @@ -54,13 +54,32 @@ PowerShellVersion = '5.1' # RequiredModules = @() # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Authentication.Abstractions.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Authentication.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Authentication.ResourceManager.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Authorization.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Graph.RBAC.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Network.dll', + 'netcoreapp2.0\Microsoft.Azure.Commands.ResourceManager.Common.dll', + 'netcoreapp2.0\Microsoft.WindowsAzure.Commands.Common.dll', + 'netcoreapp2.0\Microsoft.WindowsAzure.Commands.Common.Storage.dll', + 'netcoreapp2.0\Hyak.Common.dll', + 'netcoreapp2.0\Microsoft.ApplicationInsights.dll', + 'netcoreapp2.0\Microsoft.Azure.Common.dll', + 'netcoreapp2.0\Microsoft.IdentityModel.Clients.ActiveDirectory.dll', + 'netcoreapp2.0\Microsoft.Rest.ClientRuntime.dll', + 'netcoreapp2.0\Microsoft.Rest.ClientRuntime.Azure.dll', + 'netcoreapp2.0\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll', + 'netcoreapp2.0\Microsoft.Threading.Tasks.dll', + 'netcoreapp2.0\Microsoft.Threading.Tasks.Extensions.dll', + 'netcoreapp2.0\Microsoft.Threading.Tasks.Extensions.Desktop.dll', + 'netcoreapp2.0\Newtonsoft.Json.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @('.\netcoreapp2.0\AzureRmProfileStartup.ps1') +ScriptsToProcess = @('netcoreapp2.0\AzureRmProfileStartup.ps1') # Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() +TypesToProcess = 'netcoreapp2.0\Microsoft.Azure.Commands.Profile.types.ps1xml' # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = 'netcoreapp2.0\Microsoft.Azure.Commands.Profile.format.ps1xml' @@ -72,19 +91,24 @@ NestedModules = @('netcoreapp2.0\Microsoft.Azure.Commands.Profile.dll') FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = 'Disable-AzureRmDataCollection', 'Enable-AzureRmDataCollection', +CmdletsToExport = 'Disable-AzureRmDataCollection', 'Disable-AzureRmContextAutosave', + 'Enable-AzureRmDataCollection', 'Enable-AzureRmContextAutosave', 'Remove-AzureRmEnvironment', 'Get-AzureRmEnvironment', 'Set-AzureRmEnvironment', 'Add-AzureRmEnvironment', 'Get-AzureRmSubscription', 'Add-AzureRmAccount', 'Get-AzureRmContext', 'Set-AzureRmContext', 'Import-AzureRmContext', 'Save-AzureRmContext', 'Get-AzureRmTenant', 'Send-Feedback', 'Resolve-AzureRmError', + 'Select-AzureRmContext', 'Rename-AzureRmContext', + 'Remove-AzureRmContext', 'Clear-AzureRmContext', + 'Remove-AzureRmAccount', 'Get-AzureRmContextAutosaveSetting', 'Set-AzureRmDefault', 'Get-AzureRmDefault', 'Clear-AzureRmDefault' # Variables to export from this module # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = 'Login-AzureRmAccount', 'Select-AzureRmSubscription', 'Resolve-Error' +AliasesToExport = 'Login-AzureRmAccount', 'Select-AzureRmSubscription', 'Resolve-Error', +'Logout-AzAccount', 'Logout-AzureRmAccount', 'Login-AzAccount' # DSC resources to export from this module # DscResourcesToExport = @() diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.Netcore.csproj b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.Netcore.csproj index 4f56e781431e..743c8c5a4d4c 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.Netcore.csproj +++ b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.Netcore.csproj @@ -1,5 +1,7 @@  + + netcoreapp2.0 win10-x64 @@ -10,6 +12,7 @@ TRACE;DEBUG;NETSTANDARD + false @@ -20,24 +23,19 @@ - - - - + - - - - + + @@ -45,8 +43,8 @@ - - + + diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/EnvironmentCmdletTests.cs b/src/ResourceManager/Profile/Commands.Profile.Test/EnvironmentCmdletTests.cs index f11b772dd9e4..2f717b85f847 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/EnvironmentCmdletTests.cs +++ b/src/ResourceManager/Profile/Commands.Profile.Test/EnvironmentCmdletTests.cs @@ -102,7 +102,11 @@ public void AddsAzureEnvironmentUsingAPublicRMEndpoint() Mock envHelperMock = new Mock(); +#if NETSTANDARD + envHelperMock.Setup(f => f.RetrieveMetaDataEndpoints(It.IsAny())).ReturnsAsync(() => null); +#else envHelperMock.Setup(f => f.RetrieveMetaDataEndpoints(It.IsAny())).ReturnsAsync(null); +#endif envHelperMock.Setup(f => f.RetrieveDomain(It.IsAny())).Returns("domain"); cmdlet.EnvHelper = envHelperMock.Object; cmdlet.SetParameterSet("ARMEndpoint"); diff --git a/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.Netcore.csproj b/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.Netcore.csproj index 831fceb2bf36..d48ac694b6c3 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.Netcore.csproj +++ b/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.Netcore.csproj @@ -1,16 +1,20 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.Profile win10-x64 Microsoft.Azure.Commands.Profile false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Profile.Netcore\ + false @@ -23,14 +27,7 @@ - - - - - - - @@ -39,10 +36,19 @@ + + + + + - - + + + + + + @@ -72,6 +78,9 @@ PreserveNewest + + PreserveNewest + \ No newline at end of file diff --git a/src/ResourceManager/Resources/AzureRM.Resources.Netcore.psd1 b/src/ResourceManager/Resources/AzureRM.Resources.Netcore.psd1 index df659c934ef5..43318c6f3d61 100644 --- a/src/ResourceManager/Resources/AzureRM.Resources.Netcore.psd1 +++ b/src/ResourceManager/Resources/AzureRM.Resources.Netcore.psd1 @@ -54,10 +54,10 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; }) # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.Management.ResourceManager.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. -ScriptsToProcess = @('netcoreapp2.0\ResourceManagerStartup.ps1') +ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module TypesToProcess = 'netcoreapp2.0\Microsoft.Azure.Commands.ResourceManager.Cmdlets.Types.ps1xml' @@ -74,42 +74,50 @@ FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-AzureRmProviderOperation', 'Remove-AzureRmRoleAssignment', - 'Get-AzureRmRoleAssignment', 'New-AzureRmRoleAssignment', - 'Get-AzureRmRoleDefinition', 'New-AzureRmRoleDefinition', - 'Set-AzureRmRoleDefinition', 'Remove-AzureRmRoleDefinition', - 'Get-AzureRmADAppCredential', 'Get-AzureRmADApplication', - 'Get-AzureRmADGroupMember', 'Get-AzureRmADGroup', - 'Get-AzureRmADServicePrincipal', 'Get-AzureRmADSpCredential', - 'Get-AzureRmADUser', 'New-AzureRmADAppCredential', - 'New-AzureRmADSpCredential', 'New-AzureRmADUser', - 'Remove-AzureRmADAppCredential', 'Remove-AzureRmADApplication', - 'New-AzureRmADApplication', 'Remove-AzureRmADServicePrincipal', - 'New-AzureRmADServicePrincipal', 'Remove-AzureRmADSpCredential', - 'Remove-AzureRmADUser', 'Set-AzureRmADApplication', - 'Set-AzureRmADServicePrincipal', 'Set-AzureRmADUser', - 'Remove-AzureRmResourceGroup', 'Get-AzureRmProviderFeature', - 'Register-AzureRmProviderFeature', 'Get-AzureRmLocation', - 'Find-AzureRmResourceGroup', 'Export-AzureRmResourceGroup', - 'Get-AzureRmResourceProvider', 'Register-AzureRmResourceProvider', - 'Unregister-AzureRmResourceProvider', - 'Get-AzureRmResourceGroupDeployment', - 'New-AzureRmResourceGroupDeployment', - 'Remove-AzureRmResourceGroupDeployment', - 'Stop-AzureRmResourceGroupDeployment', - 'Test-AzureRmResourceGroupDeployment', 'Set-AzureRmResourceGroup', - 'New-AzureRmResourceGroup', 'Get-AzureRmResourceGroup', - 'Save-AzureRmResourceGroupDeploymentTemplate', - 'Get-AzureRmResourceGroupDeploymentOperation', - 'Get-AzureRmResourceLock', 'Invoke-AzureRmResourceAction', - 'Find-AzureRmResource', 'Move-AzureRmResource', - 'New-AzureRmResourceLock', 'Get-AzureRmPolicyAssignment', - 'Get-AzureRmPolicyDefinition', 'New-AzureRmPolicyAssignment', - 'New-AzureRmPolicyDefinition', 'Remove-AzureRmPolicyAssignment', - 'Remove-AzureRmPolicyDefinition', 'Set-AzureRmPolicyAssignment', - 'Set-AzureRmPolicyDefinition', 'Remove-AzureRmResource', - 'Remove-AzureRmResourceLock', 'Set-AzureRmResource', - 'New-AzureRmResource', 'Set-AzureRmResourceLock', - 'Get-AzureRmResource' + 'Get-AzureRmRoleAssignment', 'New-AzureRmRoleAssignment', + 'Get-AzureRmRoleDefinition', 'New-AzureRmRoleDefinition', + 'Set-AzureRmRoleDefinition', 'Remove-AzureRmRoleDefinition', + 'Get-AzureRmADAppCredential', 'Get-AzureRmADApplication', + 'Get-AzureRmADGroupMember', 'Get-AzureRmADGroup', + 'Get-AzureRmADServicePrincipal', 'Get-AzureRmADSpCredential', + 'Get-AzureRmADUser', 'New-AzureRmADAppCredential', + 'New-AzureRmADSpCredential', 'New-AzureRmADUser', + 'Remove-AzureRmADAppCredential', 'Remove-AzureRmADApplication', + 'New-AzureRmADApplication', 'Remove-AzureRmADServicePrincipal', + 'New-AzureRmADServicePrincipal', 'Remove-AzureRmADSpCredential', + 'Remove-AzureRmADUser', 'Set-AzureRmADApplication', + 'Set-AzureRmADServicePrincipal', 'Set-AzureRmADUser', + 'Remove-AzureRmResourceGroup', 'Get-AzureRmProviderFeature', + 'Register-AzureRmProviderFeature', 'Get-AzureRmLocation', + 'Find-AzureRmResourceGroup', 'Export-AzureRmResourceGroup', + 'Get-AzureRmResourceProvider', 'Register-AzureRmResourceProvider', + 'Unregister-AzureRmResourceProvider', + 'Get-AzureRmResourceGroupDeployment', + 'New-AzureRmResourceGroupDeployment', + 'Remove-AzureRmResourceGroupDeployment', + 'Stop-AzureRmResourceGroupDeployment', + 'Test-AzureRmResourceGroupDeployment', 'Set-AzureRmResourceGroup', + 'New-AzureRmResourceGroup', 'Get-AzureRmResourceGroup', + 'Save-AzureRmResourceGroupDeploymentTemplate', + 'Get-AzureRmResourceGroupDeploymentOperation', + 'Get-AzureRmResourceLock', 'Invoke-AzureRmResourceAction', + 'Find-AzureRmResource', 'Move-AzureRmResource', + 'New-AzureRmResourceLock', 'Get-AzureRmPolicyAssignment', + 'Get-AzureRmPolicyDefinition', 'Get-AzureRmPolicySetDefinition', + 'New-AzureRmPolicyAssignment', 'New-AzureRmPolicyDefinition', + 'New-AzureRmPolicySetDefinition', 'Remove-AzureRmPolicyAssignment', + 'Remove-AzureRmPolicyDefinition', + 'Remove-AzureRmPolicySetDefinition', 'Set-AzureRmPolicyAssignment', + 'Set-AzureRmPolicyDefinition', 'Set-AzureRmPolicySetDefinition', + 'Remove-AzureRmResource', 'Remove-AzureRmResourceLock', + 'Set-AzureRmResource', 'New-AzureRmResource', + 'Set-AzureRmResourceLock', 'Get-AzureRmResource', + 'Get-AzureRmManagedApplicationDefinition', + 'New-AzureRmManagedApplicationDefinition', + 'Set-AzureRmManagedApplicationDefinition', + 'Remove-AzureRmManagedApplicationDefinition', + 'Get-AzureRmManagedApplication', 'New-AzureRmManagedApplication', + 'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication' # Variables to export from this module # VariablesToExport = @() diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.Netcore.csproj b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.Netcore.csproj index 81b3506e7f39..ce90ffb28aad 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.Netcore.csproj +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.Netcore.csproj @@ -1,11 +1,14 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.ResourceManager.Cmdlets win10-x64 Microsoft.Azure.Commands.ResourceManager.Cmdlets false + true @@ -17,12 +20,10 @@ TRACE;DEBUG;NETSTANDARD + false - - - @@ -30,12 +31,10 @@ - - - + diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ProviderTests.ps1 b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ProviderTests.ps1 index 6d8a609badba..c712b883a3a5 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ProviderTests.ps1 +++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ProviderTests.ps1 @@ -141,7 +141,7 @@ function Test-AzureProviderOperation Assert-True { $action.Length -eq 0 } # Get operations for non-existing provider - $exceptionMessage = "ProviderNotFound: Provider NonExistentProvider not found."; + $exceptionMessage = "Provider NonExistentProvider not found."; Assert-Throws { Get-AzureRmProviderOperation NonExistentProvider/* } $exceptionMessage # Get operations for non-existing provider diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.Netcore.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.Netcore.csproj index 44863da515b8..e92077beea36 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.Netcore.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.Netcore.csproj @@ -1,5 +1,7 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.Resources @@ -11,6 +13,7 @@ TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Resources.Netcore\ + false @@ -23,9 +26,6 @@ - - - @@ -34,8 +34,6 @@ - - @@ -51,11 +49,13 @@ - + + + @@ -77,9 +77,6 @@ PreserveNewest - - PreserveNewest - \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index ae5afc12a130..ce5548a99f78 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -48,9 +48,21 @@ false + + ..\..\..\packages\Microsoft.Azure.Management.ResourceManager.1.6.0-preview\lib\net452\Microsoft.Azure.Management.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.6\lib\net45\Microsoft.Rest.ClientRuntime.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll + True + + @@ -188,13 +200,10 @@ - - - - + + + + \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/Extensions/ResourceExtensions.cs b/src/ResourceManager/Resources/Commands.Resources/Extensions/ResourceExtensions.cs index 65c2f44f629b..5bc21c91ef13 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Extensions/ResourceExtensions.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Extensions/ResourceExtensions.cs @@ -15,65 +15,13 @@ using System.Collections.Generic; using System; -#if !NETSTANDARD -using Microsoft.Azure.Management.Resources; -using Microsoft.Azure.Management.Resources.Models; -#else using Microsoft.Azure.Management.ResourceManager; using Microsoft.Azure.Management.ResourceManager.Models; -#endif namespace Microsoft.Azure.Commands.Resources.Models { public static class ResourceExtensions { -#if !NETSTANDARD - public static DeploymentExtended Deployment(this DeploymentGetResult deployment) - { - return deployment.Deployment; - } - - public static IList Operations(this DeploymentOperationsListResult result) - { - return result.Operations; - } - - public static string NextLink(this DeploymentOperationsListResult result) - { - return result.NextLink; - } - - public static bool Exists(this DeploymentExistsResult result) - { - return result.Exists; - } - - public static DeploymentMode Mode(this DeploymentPropertiesExtended deploymentProperties) - { - return deploymentProperties.Mode; - } - - public static DateTime Timestamp(this DeploymentPropertiesExtended deploymentProperties) - { - return deploymentProperties.Timestamp; - } - - public static DeploymentDebugSetting DebugSetting(this DeploymentPropertiesExtended deploymentProperties) - { - return deploymentProperties.DebugSettingResponse; - } - - public static string DetailLevel(this DeploymentDebugSetting settings) - { - return settings.DeploymentDebugDetailLevel; - } - - public static IEnumerable Locations(this Subscriptions.Models.LocationListResult locations) - { - return locations.Locations; - } - -#else public static IEnumerable Locations(this IEnumerable locations) { return locations; @@ -124,9 +72,8 @@ public static bool Exists(this bool value) { return value; } -#endif } -#if NETSTANDARD + public static class ProvisioningState { public const string Accepted = "Accepted"; @@ -141,5 +88,4 @@ public static class ProvisioningState public const string Running = "Running"; public const string Succeeded = "Succeeded"; } -#endif } diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/PSResourceGroupDeployment.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/PSResourceGroupDeployment.cs index 7736365d98df..fc6896159e17 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/PSResourceGroupDeployment.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/PSResourceGroupDeployment.cs @@ -15,11 +15,7 @@ using System; using System.Collections.Generic; -#if !NETSTANDARD -using Microsoft.Azure.Management.Resources.Models; -#else using Microsoft.Azure.Management.ResourceManager.Models; -#endif namespace Microsoft.Azure.Commands.Resources.Models { diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.ResourceManager.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.ResourceManager.cs index 29cad756eaf2..be99f97865de 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.ResourceManager.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.ResourceManager.cs @@ -19,13 +19,8 @@ using Microsoft.Azure.Commands.ResourceManager.Common.Tags; using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources; -#if !NETSTANDARD -using Microsoft.Azure.Management.Resources; -using Microsoft.Azure.Management.Resources.Models; -#else using Microsoft.Azure.Management.ResourceManager; using Microsoft.Azure.Management.ResourceManager.Models; -#endif namespace Microsoft.Azure.Commands.Resources.Models { @@ -47,55 +42,6 @@ public partial class ResourcesClient /// /// The get parameters /// List of resources -#if !NETSTANDARD - public virtual List FilterPSResources(BasePSResourceParameters parameters) - { - List resources = new List(); - - if (!string.IsNullOrEmpty(parameters.Name)) - { - ResourceIdentity resourceIdentity = parameters.ToResourceIdentity(); - - ResourceGetResult getResult; - - try - { - getResult = ResourceManagementClient.Resources.Get(parameters.ResourceGroupName, resourceIdentity); - } - catch (CloudException) - { - throw new ArgumentException(ProjectResources.ResourceDoesntExists); - } - - resources.Add(getResult.Resource.ToPSResource(this, false)); - } - else - { - PSTagValuePair tagValuePair = new PSTagValuePair(); - if (parameters.Tag != null && parameters.Tag.Length == 1 && parameters.Tag[0] != null) - { - tagValuePair = TagsConversionHelper.Create(parameters.Tag[0]); - if (tagValuePair == null) - { - throw new ArgumentException(ProjectResources.InvalidTagFormat); - } - } - ResourceListResult listResult = ResourceManagementClient.Resources.List(new ResourceListParameters - { - ResourceGroupName = parameters.ResourceGroupName, - ResourceType = parameters.ResourceType, - TagName = tagValuePair.Name, - TagValue = tagValuePair.Value - }); - - if (listResult.Resources != null) - { - resources.AddRange(listResult.Resources.Select(r => r.ToPSResource(this, false))); - } - } - return resources; - } -#else public virtual List FilterPSResources(BasePSResourceParameters parameters) { List resources = new List(); @@ -151,6 +97,5 @@ public virtual List FilterPSResources(BasePSResourceParameters param } return resources; } -#endif } } diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs index f1dffda94e02..3b1abca56567 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs @@ -27,9 +27,9 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using Microsoft.Azure.Management.Resources; -using Microsoft.Azure.Management.Resources.Models; -using RMProviderOperationsMetadata = Microsoft.Azure.Management.Resources.Models.ProviderOperationsMetadata; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Rest.Azure; namespace Microsoft.Azure.Commands.Resources.Models { @@ -54,7 +54,9 @@ public partial class ResourcesClient public IAuthorizationManagementClient AuthorizationManagementClient { get; set; } +#if !NETSTANDARD public GalleryTemplatesClient GalleryTemplatesClient { get; set; } +#endif public Action VerboseLogger { get; set; } @@ -68,8 +70,10 @@ public partial class ResourcesClient /// Profile containing resources to manipulate public ResourcesClient(IAzureContext context) : this( - AzureSession.Instance.ClientFactory.CreateClient(context, AzureEnvironment.Endpoint.ResourceManager), + AzureSession.Instance.ClientFactory.CreateArmClient(context, AzureEnvironment.Endpoint.ResourceManager), +#if !NETSTANDARD new GalleryTemplatesClient(context), +#endif AzureSession.Instance.ClientFactory.CreateArmClient(context, AzureEnvironment.Endpoint.ResourceManager)) { @@ -83,10 +87,14 @@ public ResourcesClient(IAzureContext context) /// The management client instance public ResourcesClient( IResourceManagementClient resourceManagementClient, +#if !NETSTANDARD GalleryTemplatesClient galleryTemplatesClient, +#endif IAuthorizationManagementClient authorizationManagementClient) { +#if !NETSTANDARD GalleryTemplatesClient = galleryTemplatesClient; +#endif AuthorizationManagementClient = authorizationManagementClient; this.ResourceManagementClient = resourceManagementClient; } @@ -218,7 +226,7 @@ private void WriteDeploymentProgress(string resourceGroup, string deploymentName public static string ParseErrorMessage(string statusMessage) { - CloudError error = CloudException.ParseXmlOrJsonError(statusMessage); + Hyak.Common.CloudError error = Hyak.Common.CloudException.ParseXmlOrJsonError(statusMessage); if (error.Message == null) { return error.OriginalMessage; @@ -322,16 +330,10 @@ private List GetNewOperations(List old return newOperations; } - public RMProviderOperationsMetadata GetProviderOperationsMetadata(string providerNamespace) - { - ProviderOperationsMetadataGetResult result = this.ResourceManagementClient.ProviderOperationsMetadata.Get(providerNamespace); - return result.Provider; - } + public ProviderOperationsMetadata GetProviderOperationsMetadata(string providerNamespace) => + this.AuthorizationManagementClient.ProviderOperationsMetadata.Get(providerNamespace, "2015-07-01"); - public IList ListProviderOperationsMetadata() - { - ProviderOperationsMetadataListResult result = this.ResourceManagementClient.ProviderOperationsMetadata.List(); - return result.Providers; - } + public IPage ListProviderOperationsMetadata() => + this.AuthorizationManagementClient.ProviderOperationsMetadata.List("2015-07-01"); } } \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs index 4fd1c607f89e..7fbfeaae4ad3 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs @@ -28,10 +28,12 @@ public abstract class ResourcesBaseCmdlet : AzureRMCmdlet /// private ResourcesClient resourcesClient; +#if !NETSTANDARD /// /// Field that holds the gallery templates client instance /// private GalleryTemplatesClient galleryTemplatesClient; +#endif /// /// Field that holds the policies client instance @@ -65,6 +67,7 @@ public ResourcesClient ResourcesClient set { this.resourcesClient = value; } } +#if !NETSTANDARD /// /// Gets or sets the gallery templates client /// @@ -84,6 +87,7 @@ public GalleryTemplatesClient GalleryTemplatesClient set { this.galleryTemplatesClient = value; } } +#endif /// /// Gets or sets the policies client diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs index 26124bcc883f..41d8365856fa 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs @@ -25,17 +25,17 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Newtonsoft.Json; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Commands.Resources.Models.Gallery; -#if !NETSTANDARD -using Microsoft.Azure.Management.Resources.Models; -#else using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Commands.Resources.Models; +#if !NETSTANDARD +using Microsoft.Azure.Commands.Resources.Models.Gallery; #endif namespace Microsoft.Azure.Commands.Resources.Models { public static class ResourcesExtensions { +#if !NETSTANDARD public static PSGalleryItem ToPSGalleryItem(this GalleryItem gallery) { PSGalleryItem psGalleryItem = new PSGalleryItem(); @@ -46,8 +46,9 @@ public static PSGalleryItem ToPSGalleryItem(this GalleryItem gallery) return psGalleryItem; } +#endif - public static PSResource ToPSResource(this GenericResourceExtended resource, ResourcesClient client, bool minimal) + public static PSResource ToPSResource(this GenericResource resource, ResourcesClient client, bool minimal) { ResourceIdentifier identifier = new ResourceIdentifier(resource.Id); return new PSResource @@ -57,8 +58,8 @@ public static PSResource ToPSResource(this GenericResourceExtended resource, Res ResourceType = identifier.ResourceType, ResourceGroupName = identifier.ResourceGroupName, ParentResource = identifier.ParentResource, - Properties = JsonUtilities.DeserializeJson(resource.Properties), - PropertiesText = resource.Properties, + Properties = JsonUtilities.DeserializeJson(resource.Properties?.ToString()), + PropertiesText = resource.Properties?.ToString(), Tags = TagsConversionHelper.CreateTagHashtable(resource.Tags), Permissions = minimal ? null : client.GetResourcePermissions(identifier), ResourceId = identifier.ToString() diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/SubscriptionsClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/SubscriptionsClient.cs index ec55108c432e..10358ed89159 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/SubscriptionsClient.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/SubscriptionsClient.cs @@ -16,14 +16,8 @@ using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.Azure.Commands.Common.Authentication.Models; using System.Collections.Generic; - -#if !NETSTANDARD -using Microsoft.Azure.Subscriptions; -using Microsoft.Azure.Subscriptions.Models; -#else using Microsoft.Azure.Management.ResourceManager; using Microsoft.Azure.Management.ResourceManager.Models; -#endif namespace Microsoft.Azure.Commands.Resources.Models { @@ -36,11 +30,7 @@ public class SubscriptionsClient /// /// Profile containing resources to manipulate public SubscriptionsClient(IAzureContext context) -#if !NETSTANDARD - : this(AzureSession.Instance.ClientFactory.CreateClient(context, AzureEnvironment.Endpoint.ResourceManager)) -#else : this(AzureSession.Instance.ClientFactory.CreateArmClient(context, AzureEnvironment.Endpoint.ResourceManager)) -#endif { } diff --git a/src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureProviderOperationCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureProviderOperationCmdlet.cs index 259b45df62ed..bb99acaa5424 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureProviderOperationCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureProviderOperationCmdlet.cs @@ -20,8 +20,9 @@ namespace Microsoft.Azure.Commands.Resources using System.Linq; using System.Management.Automation; using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources; - using Microsoft.Azure.Management.Resources; - using Microsoft.Azure.Management.Resources.Models; + using Microsoft.Azure.Management.ResourceManager; + using Microsoft.Azure.Management.ResourceManager.Models; + using Microsoft.Azure.Management.Authorization.Version2015_07_01.Models; /// /// Get an existing resource. @@ -90,7 +91,7 @@ private List ProcessProviderOperationsWithWildCard( // Filter the list of all operation names to what matches the wildcard WildcardPattern wildcard = new WildcardPattern(actionSearchString, WildcardOptions.IgnoreCase | WildcardOptions.Compiled); - List providers = new List(); + var providers = new List(); string provider = this.OperationSearchString.Split(Separator).First(); if (provider.Equals(WildCardCharacter)) { @@ -132,11 +133,11 @@ private static IEnumerable GetPSOperationsFromProvi return operations; } - private static bool IsUserOperation(Operation operation) + private static bool IsUserOperation(ProviderOperation operation) { return operation.Origin == null || operation.Origin.Contains("user"); } - private static PSResourceProviderOperation ToPSResourceProviderOperation(Operation operation, string provider, string resource = null) + private static PSResourceProviderOperation ToPSResourceProviderOperation(ProviderOperation operation, string provider, string resource = null) { PSResourceProviderOperation psOperation = new PSResourceProviderOperation(); psOperation.Operation = operation.Name; diff --git a/src/ResourceManager/Resources/Commands.Resources/packages.config b/src/ResourceManager/Resources/Commands.Resources/packages.config index ca9cf748494f..4bfd32717ca3 100644 --- a/src/ResourceManager/Resources/Commands.Resources/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources/packages.config @@ -1,4 +1,8 @@  + - + + + + \ No newline at end of file diff --git a/src/ResourceManager/Storage/AzureRM.Storage.Netcore.psd1 b/src/ResourceManager/Storage/AzureRM.Storage.Netcore.psd1 index 9edf690e8bdd..d4788bb06bff 100644 --- a/src/ResourceManager/Storage/AzureRM.Storage.Netcore.psd1 +++ b/src/ResourceManager/Storage/AzureRM.Storage.Netcore.psd1 @@ -54,7 +54,11 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; }) # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.Management.Storage.dll', + 'netcoreapp2.0\Microsoft.Data.Edm.dll', + 'netcoreapp2.0\Microsoft.Data.OData.dll', + 'netcoreapp2.0\Microsoft.WindowsAzure.Storage.dll', + 'netcoreapp2.0\System.Spatial.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() @@ -73,15 +77,15 @@ FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey', - 'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey', - 'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount', - 'Set-AzureRmStorageAccount', - 'Get-AzureRmStorageAccountNameAvailability', - 'Get-AzureRmStorageUsage', - 'Update-AzureRmStorageAccountNetworkACL', - 'Get-AzureRmStorageAccountNetworkACL', - 'Add-AzureRmStorageAccountNetworkACLRule', - 'Remove-AzureRmStorageAccountNetworkACLRule' + 'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey', + 'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount', + 'Set-AzureRmStorageAccount', + 'Get-AzureRmStorageAccountNameAvailability', + 'Get-AzureRmStorageUsage', + 'Update-AzureRmStorageAccountNetworkRuleSet', + 'Get-AzureRmStorageAccountNetworkRuleSet', + 'Add-AzureRmStorageAccountNetworkRule', + 'Remove-AzureRmStorageAccountNetworkRule' # Variables to export from this module # VariablesToExport = @() diff --git a/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Storage.Netcore.csproj b/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Storage.Netcore.csproj index b003acd6424e..c766ac3bd677 100644 --- a/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Storage.Netcore.csproj +++ b/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Storage.Netcore.csproj @@ -1,15 +1,19 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.Management.Storage win10-x64 false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Storage.Netcore\ + false @@ -22,9 +26,6 @@ - - - @@ -32,8 +33,6 @@ - - @@ -51,8 +50,8 @@ - - + + diff --git a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.Netcore.csproj b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.Netcore.csproj index 429972267824..56b7d03c9db0 100644 --- a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.Netcore.csproj +++ b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.Netcore.csproj @@ -1,16 +1,20 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.Tags win10-x64 Microsoft.Azure.Commands.Tags false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Tags.Netcore\ + false @@ -23,17 +27,12 @@ - - - - - @@ -43,7 +42,7 @@ - + diff --git a/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 b/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 index 31ebdaead52a..1b81a27838eb 100644 --- a/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 +++ b/src/ResourceManager/Websites/AzureRM.Websites.Netcore.psd1 @@ -54,7 +54,7 @@ PowerShellVersion = '5.1' RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; }) # Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() +RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.Management.Websites.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. ScriptsToProcess = @('netcoreapp2.0\WebsitesStartup.ps1') diff --git a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.Netcore.csproj b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.Netcore.csproj index 63255be47e7c..e24f6f63527c 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.Netcore.csproj +++ b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.Netcore.csproj @@ -1,16 +1,20 @@  + + netcoreapp2.0 Microsoft.Azure.Commands.Websites win10-x64 Microsoft.Azure.Commands.WebApps false + true TRACE;DEBUG;NETSTANDARD ..\..\..\Package\Debug\ResourceManager\AzureRM.Websites.Netcore\ + false @@ -23,9 +27,6 @@ - - - @@ -33,8 +34,6 @@ - - @@ -44,7 +43,7 @@ - + diff --git a/tools/Common.Netcore.Dependencies.targets b/tools/Common.Netcore.Dependencies.targets new file mode 100644 index 000000000000..82bef18160b8 --- /dev/null +++ b/tools/Common.Netcore.Dependencies.targets @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tools/InstallationTests/NetcoreTests/Common.ps1 b/tools/InstallationTests/NetcoreTests/Common.ps1 index 99becfbfcf1a..24a18bf8612d 100644 --- a/tools/InstallationTests/NetcoreTests/Common.ps1 +++ b/tools/InstallationTests/NetcoreTests/Common.ps1 @@ -351,7 +351,7 @@ Gets valid resource group name #> function Get-ResourceGroupName { - return "some-unique-rg-name" + return "rg$(Get-RandomLetters)" } <# @@ -360,7 +360,7 @@ Gets valid resource name #> function Get-ResourceName { - return "some-unique-rg-name" + return "some-unique-res-name" } <# diff --git a/tools/InstallationTests/NetcoreTests/NetcoreTests.ps1 b/tools/InstallationTests/NetcoreTests/NetcoreTests.ps1 index 846e23798f96..12bcbe60cade 100644 --- a/tools/InstallationTests/NetcoreTests/NetcoreTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/NetcoreTests.ps1 @@ -1,151 +1,215 @@ -. "./Common.ps1" -. "./Assert.ps1" -# Profile tests -. "./Profile/SubscriptionCmdletTests.ps1" -# Resources tests -. "./Resources/ActiveDirectoryTests.ps1" -. "./Resources/AuthorizationTests.ps1" -. "./Resources/DeploymentTests.ps1" -. "./Resources/LocationTests.ps1" -. "./Resources/MoveResourceTest.ps1" -. "./Resources/PolicyTests.ps1" -. "./Resources/ProviderTests.ps1" -. "./Resources/ResourceGroupTests.ps1" -. "./Resources/ResourceLockTests.ps1" -. "./Resources/ResourceTests.ps1" -. "./Resources/RoleAssignmentTests.ps1" -. "./Resources/RoleDefinitionTests.ps1" -. "./Compute/ComputeTestCommon.ps1" -. "./Compute/VirtualMachineTests.ps1" -. "./Websites/Common.ps1" -. "./Websites/WebAppTests.ps1" - -$global:totalCount = 0; -$global:passedCount = 0; -$global:passedTests = @() -$global:failedTests = @() -$global:times = @{} +# Set script preferences. + $VerbosePreference = "SilentlyContinue" +$ErrorActionPreference = "Stop" -function Run-TestProtected +# Results object to pass to jobs. + +$results = @{ + totalCount = 0; + passedCount = 0; + passedTests = @(); + failedTests = @(); + times = @{}; + startTime = Get-Date; +} +function Run-TestProtectedAsJob { - param([ScriptBlock]$script, [string] $testName) - $testStart = Get-Date - try - { - Write-Host -ForegroundColor Green ===================================== - Write-Host -ForegroundColor Green "Running test $testName" - Write-Host -ForegroundColor Green ===================================== - Write-Host - &$script > $null - $global:passedCount = $global:passedCount + 1 - Write-Host - Write-Host -ForegroundColor Green ===================================== - Write-Host -ForegroundColor Green "Test Passed" - Write-Host -ForegroundColor Green ===================================== - Write-Host - $global:passedTests += $testName - } - catch - { - Out-String -InputObject $_.Exception | Write-Host -ForegroundColor Red - Write-Host - Write-Host -ForegroundColor Red ===================================== - Write-Host -ForegroundColor Red "Test Failed" - Write-Host -ForegroundColor Red ===================================== - Write-Host - $global:failedTests += $testName - } - finally - { - $testEnd = Get-Date - $testElapsed = $testEnd - $testStart - $global:times[$testName] = $testElapsed - $global:totalCount = $global:totalCount + 1 - } + param($script, $testName) + + $job = Start-Job -Name $testName -ScriptBlock { + param($script, $testName, $results, $dir) + + Import-AzureRmContext -Path azpsTestContext.json > $null + + $VerbosePreference = "SilentlyContinue" + $ErrorActionPreference = "Stop" + function Run-TestProtected + { + param($script, $testName, $results) + + $testStart = Get-Date + try + { + Write-Host -ForegroundColor Green ===================================== + Write-Host -ForegroundColor Green "Running test $testName" + Write-Host -ForegroundColor Green ===================================== + Write-Host + & $script > $null + $results.passedCount = $results.passedCount + 1 + Write-Host + Write-Host -ForegroundColor Green ===================================== + Write-Host -ForegroundColor Green "Test Passed" + Write-Host -ForegroundColor Green ===================================== + Write-Host + $results.passedTests += $testName + } + catch + { + Out-String -InputObject $_.Exception | Write-Host -ForegroundColor Red + Write-Host + Write-Host -ForegroundColor Red ===================================== + Write-Host -ForegroundColor Red "Test Failed" + Write-Host -ForegroundColor Red ===================================== + Write-Host + $results.failedTests += $testName + } + finally + { + $testEnd = Get-Date + $testElapsed = $testEnd - $testStart + $results.times[$testName] = $testElapsed + $results.totalCount = $results.totalCount + 1 + } + + return $results + } + + # Test helpers. + . "$dir/Common.ps1" + . "$dir/Assert.ps1" + + # Profile tests. + . "$dir/Profile/SubscriptionCmdletTests.ps1" + + # Resources tests. + . "$dir/Resources/ActiveDirectoryTests.ps1" + . "$dir/Resources/AuthorizationTests.ps1" + . "$dir/Resources/DeploymentTests.ps1" + . "$dir/Resources/LocationTests.ps1" + . "$dir/Resources/MoveResourceTest.ps1" + . "$dir/Resources/PolicyTests.ps1" + . "$dir/Resources/ProviderTests.ps1" + . "$dir/Resources/ResourceGroupTests.ps1" + . "$dir/Resources/ResourceLockTests.ps1" + . "$dir/Resources/ResourceTests.ps1" + . "$dir/Resources/RoleAssignmentTests.ps1" + . "$dir/Resources/RoleDefinitionTests.ps1" + . "$dir/Compute/ComputeTestCommon.ps1" + . "$dir/Compute/VirtualMachineTests.ps1" + . "$dir/Websites/Common.ps1" + . "$dir/Websites/WebAppTests.ps1" + + $block = [Scriptblock]::Create($script) + + return Run-TestProtected $block $testName $results + } -ArgumentList ($script, $testName, $results, $pwd) + + return $job } -Login-AzureRmAccount -Select-AzureRmSubscription -SubscriptionId 00977cdb-163f-435f-9c32-39ec8ae61f4d +# Login or skip if the context exists. +if(!(Test-Path azpsTestContext.json)) { + Login-AzureRmAccount > $null + Select-AzureRmSubscription -SubscriptionId c9cbd920-c00c-427c-852b-8aaf38badaeb > $null + Save-AzureRmContext -Path azpsTestContext.json > $null +} + +# Start jobs and add to array. + +$jobs = @( + + #Proflie tests. + (Run-TestProtectedAsJob { Test-GetSubscriptionsEndToEnd } "Test-GetSubscriptionsEndToEnd"), + (Run-TestProtectedAsJob { Test-PipingWithContext } "Test-PipingWithContext")#, + (Run-TestProtectedAsJob { Test-SetAzureRmContextEndToEnd } "Test-SetAzureRmContextEndToEnd"), + (Run-TestProtectedAsJob { Test-SetAzureRmContextWithoutSubscription } "Test-SetAzureRmContextWithoutSubscription"), + + # Resource Groups tests. + (Run-TestProtectedAsJob { Test-CreatesNewSimpleResourceGroup } "Test-CreatesNewSimpleResourceGroup"), + (Run-TestProtectedAsJob { Test-UpdatesExistingResourceGroup} "Test-UpdatesExistingResourceGroup"), + (Run-TestProtectedAsJob { Test-AzureTagsEndToEnd } "Test-AzureTagsEndToEnd"), + (Run-TestProtectedAsJob { Test-RemoveDeployment } "Test-RemoveDeployment"), + (Run-TestProtectedAsJob { Test-MoveAzureResource } "Test-MoveAzureResource"), + + # Active Directory tests. + (Run-TestProtectedAsJob { Test-GetADGroupWithSearchString "Azure DevEx Powershell team" } "Test-GetADGroupWithSearchString"), + (Run-TestProtectedAsJob { Test-GetADGroupWithBadSearchString } "Test-GetADGroupWithBadSearchString"), + (Run-TestProtectedAsJob { Test-GetADGroupWithObjectId "25cda556-8965-4159-aea3-a9391398cc7a" } "Test-GetADGroupWithObjectId"), + (Run-TestProtectedAsJob { Test-GetADServicePrincipalWithObjectId "00901ac3-b9b7-4f5e-b89e-178c9266894b" } "Test-GetADServicePrincipalWithObjectId"), + (Run-TestProtectedAsJob { Test-GetADUserWithSearchString "Hovsep Mkrtchyan" } "Test-GetADUserWithSearchString"), + + # Authorization tests. + (Run-TestProtectedAsJob { Test-AuthorizationEndToEnd } "Test-AuthorizationEndToEnd"), + + # Resource Group Deployment tests. + (Run-TestProtectedAsJob { Test-CrossResourceGroupDeploymentFromTemplateFile } "Test-CrossResourceGroupDeploymentFromTemplateFile"), + + # Locations tests. + (Run-TestProtectedAsJob { Test-AzureLocation } "Test-AzureLocation"), + + # Policy tests. + (Run-TestProtectedAsJob { Test-PolicyDefinitionCRUD } "Test-PolicyDefinitionCRUD"), + (Run-TestProtectedAsJob { Test-PolicyAssignmentCRUD } "Test-PolicyAssignmentCRUD"), + + # RoleDefinition tests. + (Run-TestProtectedAsJob { Test-RoleDefinitionCreateTests } "Test-RoleDefinitionCreateTests"), + + # Compute tests. + (Run-TestProtectedAsJob { Test-VirtualMachine $null $true } "Test-VirtualMachine With Managed Disks"), + (Run-TestProtectedAsJob { Test-VirtualMachine $null } "Test-VirtualMachine"), + + # WebApp tests. + (Run-TestProtectedAsJob { Test-GetWebApp } "Test-GetWebApp"), + (Run-TestProtectedAsJob { Test-GetWebAppMetrics } "Test-GetWebAppMetrics"), + (Run-TestProtectedAsJob { Test-StartStopRestartWebApp } "Test-StartStopRestartWebApp"), + (Run-TestProtectedAsJob { Test-CloneNewWebAppAndDeploymentSlots } "Test-CloneNewWebAppAndDeploymentSlots"), + (Run-TestProtectedAsJob { Test-RemoveWebApp } "Test-RemoveWebApp"), + (Run-TestProtectedAsJob { Test-SetWebApp} "Test-SetWebApp") + +) + +# Wait for all of the jobs we just created (and report progress). + +while (($jobs | Where-Object { $_.State -eq "Running" }).Count -gt 0) { + $running = @($jobs | Where-Object { $_.State -eq "Running" } | Select-Object -ExpandProperty Name) + $completed = @($jobs | Where-Object { $_.State -eq "Completed" } | Select-Object -ExpandProperty Name) + $runningString = $running -join ", " + $completedString = $completed -join ", " + + Write-Progress -Activity "Netcore Tests" -CurrentOperation "Running: $runningString" -Status "Completed: $completedString" -PercentComplete ($completed.Count * 100.0 / $jobs.Count) + + Start-Sleep 5 +} + +# Receive the jobs and compile data. + +$jobs | Receive-Job | ForEach-Object { + $results.passedTests += $_.passedTests + $results.passedCount += $_.passedCount + $results.totalCount += $_.totalCount + $results.failedTests += $_.failedTests + $results.times += $_.times +} > $null + +# Write results. -$ErrorActionPreference = "Stop" -$global:startTime = Get-Date - -#Proflie tests -Run-TestProtected { Test-GetSubscriptionsEndToEnd } "Test-GetSubscriptionsEndToEnd" -Run-TestProtected { Test-PipingWithContext } "Test-PipingWithContext" -Run-TestProtected { Test-SetAzureRmContextEndToEnd } "Test-SetAzureRmContextEndToEnd" -Run-TestProtected { Test-SetAzureRmContextWithoutSubscription } "Test-SetAzureRmContextWithoutSubscription" - -# Resource Groups tests -Run-TestProtected { Test-CreatesNewSimpleResourceGroup } "Test-CreatesNewSimpleResourceGroup" -Run-TestProtected { Test-UpdatesExistingResourceGroup} "Test-UpdatesExistingResourceGroup" -Run-TestProtected { Test-AzureTagsEndToEnd } "Test-AzureTagsEndToEnd" -Run-TestProtected { Test-RemoveDeployment } "Test-RemoveDeployment" -Run-TestProtected { Test-MoveAzureResource } "Test-MoveAzureResource" - -# Active Directory tests -Run-TestProtected { Test-GetADGroupWithSearchString "Azure DevEx Powershell team" } "Test-GetADGroupWithSearchString" -Run-TestProtected { Test-GetADGroupWithBadSearchString } "Test-GetADGroupWithBadSearchString" -Run-TestProtected { Test-GetADGroupWithObjectId "25cda556-8965-4159-aea3-a9391398cc7a" } "Test-GetADGroupWithObjectId" -Run-TestProtected { Test-GetADServicePrincipalWithObjectId "00901ac3-b9b7-4f5e-b89e-178c9266894b" } "Test-GetADServicePrincipalWithObjectId" -Run-TestProtected { Test-GetADUserWithSearchString "Hovsep Mkrtchyan" } "Test-GetADUserWithSearchString" - -# Authorization tests - Skipped in repo due to error -Run-TestProtected { Test-AuthorizationEndToEnd } "Test-AuthorizationEndToEnd" - -# Resource Group Deployment tests -Run-TestProtected { Test-CrossResourceGroupDeploymentFromTemplateFile } "Test-CrossResourceGroupDeploymentFromTemplateFile" - -# Locations tests -Run-TestProtected { Test-AzureLocation } "Test-AzureLocation" - -# Policy tests -Run-TestProtected { Test-PolicyDefinitionCRUD } "Test-PolicyDefinitionCRUD" -Run-TestProtected { Test-PolicyAssignmentCRUD } "Test-PolicyAssignmentCRUD" - -# RoleDefinition tests -Run-TestProtected { Test-RoleDefinitionCreateTests } "Test-RoleDefinitionCreateTests" - -# Compute tests -Run-TestProtected { Test-VirtualMachine $null $true } "Test-VirtualMachine With Managed Disks" -Run-TestProtected { Test-VirtualMachine $null } "Test-VirtualMachine" - -# WebApp tests -Run-TestProtected { Test-GetWebApp } "Test-GetWebApp" -Run-TestProtected { Test-GetWebAppMetrics } "Test-GetWebAppMetrics" -Run-TestProtected { Test-StartStopRestartWebApp } "Test-StartStopRestartWebApp" -Run-TestProtected { Test-CloneNewWebAppAndDeploymentSlots } "Test-CloneNewWebAppAndDeploymentSlots" -Run-TestProtected { Test-RemoveWebApp } "Test-RemoveWebApp" -Run-TestProtected { Test-SetWebApp} "Test-SetWebApp" - -# final results Write-Host -Write-Host -ForegroundColor Green "$global:passedCount / $global:totalCount E2E Scenario Tests Pass" +Write-Host -ForegroundColor Green "${$results.passedCount} / ${$results.totalCount} E2E Scenario Tests Pass" Write-Host -ForegroundColor Green "============" Write-Host -ForegroundColor Green "PASSED TESTS" Write-Host -ForegroundColor Green "============" -$global:passedTests | % { Write-Host -ForegroundColor Green "PASSED "$_": "($global:times[$_]).ToString()} +$results.passedTests | ForEach-Object { Write-Host -ForegroundColor Green "PASSED "$_": "($results.times[$_]).ToString()} Write-Host -ForegroundColor Green "============" Write-Host -if ($global:failedTests.Count -gt 0) +if ($results.failedTests.Count -gt 0) { Write-Host -ForegroundColor Red "============" Write-Host -ForegroundColor Red "FAILED TESTS" Write-Host -ForegroundColor Red "============" - $global:failedTests | % { Write-Host -ForegroundColor Red "FAILED "$_": "($global:times[$_]).ToString()} + $results.failedTests | ForEach-Object { Write-Host -ForegroundColor Red "FAILED "$_": "($results.times[$_]).ToString()} Write-Host -ForegroundColor Red "============" Write-Host } -$global:endTime = Get-Date +$results.endTime = Get-Date Write-Host -ForegroundColor Green "=======" Write-Host -ForegroundColor Green "TIMES" Write-Host -ForegroundColor Green "=======" Write-Host -Write-Host -ForegroundColor Green "Start Time: $global:startTime" -Write-Host -ForegroundColor Green "End Time: $global:endTime" -Write-Host -ForegroundColor Green "Elapsed: "($global:endTime - $global:startTime).ToString() -Write-Host "=============================================================================================" +Write-Host -ForegroundColor Green "Start Time: $($results.startTime)" +Write-Host -ForegroundColor Green "End Time: $($results.endTime)" +Write-Host -ForegroundColor Green "Elapsed: "($results.endTime - $results.startTime).ToString() +Write-Host -ForegroundColor Black "=============================================================================================" Write-Host Write-Host diff --git a/tools/InstallationTests/NetcoreTests/Profile/SubscriptionCmdletTests.ps1 b/tools/InstallationTests/NetcoreTests/Profile/SubscriptionCmdletTests.ps1 index e6b4a7f40549..3e50c13ddfa4 100644 --- a/tools/InstallationTests/NetcoreTests/Profile/SubscriptionCmdletTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/Profile/SubscriptionCmdletTests.ps1 @@ -81,7 +81,7 @@ function Test-SetAzureRmContextEndToEnd $context = Get-AzureRmContext Assert-AreEqual $context.Subscription.Id $secondSubscription.Id $junkSubscriptionId = "49BC3D95-9A30-40F8-81E0-3CDEF0C3F8A5" - Assert-ThrowsContains {Set-AzureRmContext -SubscriptionId $junkSubscriptionId} "does not exist" + Assert-ThrowsContains {Set-AzureRmContext -SubscriptionId $junkSubscriptionId} "Please provide a valid tenant or a valid subscription." } function Test-SetAzureRmContextWithoutSubscription diff --git a/tools/InstallationTests/NetcoreTests/Resources/PolicyTests.ps1 b/tools/InstallationTests/NetcoreTests/Resources/PolicyTests.ps1 index 198b0e7b7ada..a332c30a4338 100644 --- a/tools/InstallationTests/NetcoreTests/Resources/PolicyTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/Resources/PolicyTests.ps1 @@ -24,12 +24,14 @@ function Test-PolicyDefinitionCRUD # Test $actual = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json + Start-Sleep 5 $expected = Get-AzureRMPolicyDefinition -Name $policyName Assert-AreEqual $expected.Name $actual.Name Assert-AreEqual $expected.PolicyDefinitionId $actual.PolicyDefinitionId Assert-NotNull($actual.Properties.PolicyRule) $actual = Set-AzureRMPolicyDefinition -Name $policyName -DisplayName testDisplay -Description testDescription -Policy SamplePolicyDefinition.json + Start-Sleep 5 $expected = Get-AzureRMPolicyDefinition -Name $policyName Assert-AreEqual $expected.Properties.DisplayName $actual.Properties.DisplayName Assert-AreEqual $expected.Properties.Description $actual.Properties.Description @@ -55,6 +57,7 @@ function Test-PolicyAssignmentCRUD $rg = New-AzureRMResourceGroup -Name $rgname -Location "west us" $policy = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json $actual = New-AzureRMPolicyAssignment -Name testPA -PolicyDefinition $policy -Scope $rg.ResourceId + Start-Sleep 5 $expected = Get-AzureRMPolicyAssignment -Name testPA -Scope $rg.ResourceId Assert-AreEqual $expected.Name $actual.Name diff --git a/tools/InstallationTests/NetcoreTests/Resources/ProviderTests.ps1 b/tools/InstallationTests/NetcoreTests/Resources/ProviderTests.ps1 index 6d8a609badba..c712b883a3a5 100644 --- a/tools/InstallationTests/NetcoreTests/Resources/ProviderTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/Resources/ProviderTests.ps1 @@ -141,7 +141,7 @@ function Test-AzureProviderOperation Assert-True { $action.Length -eq 0 } # Get operations for non-existing provider - $exceptionMessage = "ProviderNotFound: Provider NonExistentProvider not found."; + $exceptionMessage = "Provider NonExistentProvider not found."; Assert-Throws { Get-AzureRmProviderOperation NonExistentProvider/* } $exceptionMessage # Get operations for non-existing provider diff --git a/tools/InstallationTests/NetcoreTests/Resources/ResourceGroupTests.ps1 b/tools/InstallationTests/NetcoreTests/Resources/ResourceGroupTests.ps1 index 5c05fada6cec..a0149e000685 100644 --- a/tools/InstallationTests/NetcoreTests/Resources/ResourceGroupTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/Resources/ResourceGroupTests.ps1 @@ -163,16 +163,16 @@ function Test-AzureTagsEndToEnd New-AzureRmTag $tag1 value1 New-AzureRmTag $tag1 value2 - $tag = Get-AzureRmTag $tag1 - Assert-AreEqual 2 $tag.Values.Count + $tags = Get-AzureRmTag $tag1 + Assert-AreEqual 2 $tags.Values.Count # Create tag with values New-AzureRmTag $tag2 value1 New-AzureRmTag $tag2 value2 New-AzureRmTag $tag2 value3 - $tags = Get-AzureRmTag - Assert-AreEqual 2 $tag.Values.Count + $tags = Get-AzureRmTag $tag2 + Assert-AreEqual 3 $tags.Values.Count # Remove entire tag $tag = Remove-AzureRmTag $tag1 @@ -180,9 +180,6 @@ function Test-AzureTagsEndToEnd # Remove tag value $tag = Remove-AzureRmTag $tag2 value1 - $tags = Get-AzureRmTag - Assert-AreEqual 0 ([int]$tags.Count - [int]$tagInitial.Count) - # Get a non-existing tag Assert-Throws { Get-AzureRmTag "non-existing" } } diff --git a/tools/InstallationTests/NetcoreTests/Websites/Common.ps1 b/tools/InstallationTests/NetcoreTests/Websites/Common.ps1 index 69aa986c9f2f..3b7074960c55 100644 --- a/tools/InstallationTests/NetcoreTests/Websites/Common.ps1 +++ b/tools/InstallationTests/NetcoreTests/Websites/Common.ps1 @@ -12,13 +12,18 @@ # limitations under the License. # ---------------------------------------------------------------------------------- +function Get-RandomLetters +{ + return -join ((97..122) | Get-Random -Count 5 | % {[char]$_}) +} + <# .SYNOPSIS Gets a website name for testing. #> function Get-WebsiteName { - return "someuniqueWebsite" + return "someuniqueWebsite$(Get-RandomLetters)" } <# @@ -45,7 +50,7 @@ Gets a resource group name for testing. #> function Get-ResourceGroupName { - return "someuniqueRG" + return "rg$(Get-RandomLetters)" } <# diff --git a/tools/InstallationTests/NetcoreTests/Websites/WebAppTests.ps1 b/tools/InstallationTests/NetcoreTests/Websites/WebAppTests.ps1 index 8b4ae516a583..1c9ba580f679 100644 --- a/tools/InstallationTests/NetcoreTests/Websites/WebAppTests.ps1 +++ b/tools/InstallationTests/NetcoreTests/Websites/WebAppTests.ps1 @@ -308,9 +308,9 @@ function Test-CloneNewWebAppAndDeploymentSlots $resourceType = "Microsoft.Web/sites" # Destination setup - $destPlanName = "$(Get-WebHostPlanName)Destination" + $destPlanName = "$($planName)Destination" $destLocation = Get-SecondaryLocation - $destAppName = "$(Get-WebsiteName)Destination" + $destAppName = "$($appname)Destination" try {