0.8.10 release
This commit is contained in:
Родитель
dcaac6a2b9
Коммит
48bf44d6be
|
@ -168,6 +168,7 @@ ClientBin/
|
|||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
node_modules/
|
||||
.pshproj
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
@ -190,4 +191,4 @@ UpgradeLog*.htm
|
|||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
FakesAssemblies/
|
||||
|
|
|
@ -4,28 +4,25 @@
|
|||
ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<TestSettings>.\src\Local.testsettings</TestSettings>
|
||||
<TestSettings_x64>.\src\Local.x64.testsettings</TestSettings_x64>
|
||||
<ScenarioTestDebug>.\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll</ScenarioTestDebug>
|
||||
<CommonTestDebug>.\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
|
||||
<CommonTestDebug>.\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
|
||||
<SqlTestDebug>.\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll</SqlTestDebug>
|
||||
<AzureRTTestSettings>.\src\AzureRT.testsettings</AzureRTTestSettings>
|
||||
<AzureRTTestContainer>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</AzureRTTestContainer>
|
||||
<StorageScenarioTestDebug>src\ServiceManagement\Storage\Commands.Storage.ScenarioTest\bin\Debug\CLITest.dll</StorageScenarioTestDebug>
|
||||
<ManagementTestDebug>.\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll</ManagementTestDebug>
|
||||
<ResourceManagerTestDebug>.\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll</ResourceManagerTestDebug>
|
||||
<DataFactoryManagerTestDebug>.\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll</DataFactoryManagerTestDebug>
|
||||
<BatchTestDebug>.\src\ResourceManager\Batch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll</BatchTestDebug>
|
||||
<ServiceManagementTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</ServiceManagementTestDebug>
|
||||
<ServiceManagementExtensionsTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Extensions.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.Test.dll</ServiceManagementExtensionsTestDebug>
|
||||
<SqlDatabaseTestDebug>.\src\ServiceManagement\Sql\Commands.SqlDatabase.Test\bin\Debug\Microsoft.WindowsAzure.Commands.SqlDatabase.Test.dll</SqlDatabaseTestDebug>
|
||||
<HDInsightTestDebug>.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll</HDInsightTestDebug>
|
||||
<StorageTestDebug>.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll</StorageTestDebug>
|
||||
<TestFilter>"!Functional&!Scenario&!AzureRTScenario&!Sequential&!PIRTest&!Preview&!ADDomain"</TestFilter>
|
||||
<ScenarioTestFilter>All</ScenarioTestFilter>
|
||||
<MockTestFilter>CheckIn</MockTestFilter>
|
||||
<OneSDKCITFilter>"OneSDK&CIT"</OneSDKCITFilter>
|
||||
<MediaServiceBVTFilter>"MediaServices&BVT"</MediaServiceBVTFilter>
|
||||
<WebsiteBVTFilter>"Websites&BVT"</WebsiteBVTFilter>
|
||||
<CloudServiceBVTFilter>"CloudService&BVT"</CloudServiceBVTFilter>
|
||||
<StorageBVTFilter>"Storage&BVT"</StorageBVTFilter>
|
||||
<ManagementBVTFilter>"Management&BVT"</ManagementBVTFilter>
|
||||
<ManagedCacheBVTFilter>"ManagedCache&BVT"</ManagedCacheBVTFilter>
|
||||
<ServiceBusBVTFilter>"ServiceBus&BVT"</ServiceBusBVTFilter>
|
||||
<AzureRTAllTestFilter>"Functional|AzureRTScenario"</AzureRTAllTestFilter>
|
||||
<AzureRTAllTestFilter2>"Functional|AzureRTScenario|Preview"</AzureRTAllTestFilter2>
|
||||
<AzureRTAllTestFilter3>"Functional|AzureRTScenario|Sequential"</AzureRTAllTestFilter3>
|
||||
|
@ -45,18 +42,31 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="TestManagement">
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="$(ManagementTestDebug)" Html="$(TestOutputDirectory)\ManagementDebug.xunit.dll.html" Verbose="true"/>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(ManagementTestDebug)" Html="$(TestOutputDirectory)\ManagementDebug.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TestManagedCache">
|
||||
<PropertyGroup>
|
||||
<_ManagedCacheTestAssembly>.\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll</_ManagedCacheTestAssembly>
|
||||
</PropertyGroup>
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="$(_ManagedCacheTestAssembly)" Html="$(TestOutputDirectory)\ManagedCache.xunit.dll.html" Verbose="true"/>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(_ManagedCacheTestAssembly)" Html="$(TestOutputDirectory)\ManagedCache.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TestResourceManager">
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="$(ResourceManagerTestDebug)" Html="$(TestOutputDirectory)\ResourceManagerTestDebug.xunit.dll.html" Verbose="true"/>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(ResourceManagerTestDebug)" Html="$(TestOutputDirectory)\ResourceManagerTestDebug.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TestBatch">
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(BatchTestDebug)" Html="$(TestOutputDirectory)\BatchTestDebug.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TestDataFactoryManager">
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(DataFactoryManagerTestDebug)" Html="$(TestOutputDirectory)\DataFactoryManagerTestDebug.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TestServiceManagement">
|
||||
|
@ -65,6 +75,12 @@
|
|||
Projects="build.proj"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="TestServiceManagementExtensions">
|
||||
<MSBuild Targets="InvokeMSTest"
|
||||
Properties="_testAssembly=$(ServiceManagementExtensionsTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\ServiceManagementExtensionsDebug.trx"
|
||||
Projects="build.proj"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="TestSqlDatabase">
|
||||
<MSBuild Targets="InvokeMSTest"
|
||||
Properties="_testAssembly=$(SqlDatabaseTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\SqlDatabaseDebug.trx"
|
||||
|
@ -83,6 +99,14 @@
|
|||
Projects="build.proj"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="TestRecoveryServices">
|
||||
<PropertyGroup>
|
||||
<_RecoveryServicesTestAssembly>.\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll</_RecoveryServicesTestAssembly>
|
||||
</PropertyGroup>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(_RecoveryServicesTestAssembly)" Html="$(TestOutputDirectory)\RecoveryServices.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the scenario tests -->
|
||||
<Target Name="ScenarioTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running scenario tests..." />
|
||||
|
@ -97,79 +121,24 @@
|
|||
<!-- Run the common tests -->
|
||||
<Target Name="CommonTests">
|
||||
<Message Importance="high" Text="Running Common tests" />
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="$(CommonTestDebug)" Html="$(TestOutputDirectory)\CommonTests.xunit.dll.html" Verbose="true"/>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(CommonTestDebug)" Html="$(TestOutputDirectory)\CommonTests.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
|
||||
</Target>
|
||||
|
||||
<!-- Run the sql tests -->
|
||||
<Target Name="SqlTests">
|
||||
<Message Importance="high" Text="Running Sql tests" />
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(SqlTestDebug)" Html="$(TestOutputDirectory)\SqlTests.xunit.dll.html" Verbose="false"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the scenario tests with Mocks -->
|
||||
<Target Name="MockedScenarioTests">
|
||||
<Message Importance="high" Text="Running scenario tests with Mocks" />
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="$(ScenarioTestDebug)" Html="$(TestOutputDirectory)\MockedScenarioTests.xunit.dll.html" Verbose="true"/>
|
||||
<Xunit.Runner.MSBuild.xunit Assemblies="$(ScenarioTestDebug)" Html="$(TestOutputDirectory)\MockedScenarioTests.xunit.dll.html" Verbose="true"
|
||||
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the MediaService Scenario Tests -->
|
||||
<Target Name="RunMediaServiceBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Media Service Scenario tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RunMediaServiceBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(MediaServiceBVTFilter) /resultsfile:$(TestOutputDirectory)\RunMediaServiceBVTDebug.trx"
|
||||
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the CloudService Scenario Tests -->
|
||||
<Target Name="RunCloudServiceBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Cloud Service Scenario tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RunCloudServiceBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(CloudServiceBVTFilter) /resultsfile:$(TestOutputDirectory)\RunCloudServiceBVTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the Storage Scenario Tests -->
|
||||
<Target Name="RunStorageBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Storage Scenario tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RunStorageBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(StorageBVTFilter) /resultsfile:$(TestOutputDirectory)\RunStorageBVTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the Management Scenario Tests -->
|
||||
<Target Name="RunManagementBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Management Scenario tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RunManagementBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ManagementBVTFilter) /resultsfile:$(TestOutputDirectory)\RunManagementBVTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the Managed Cache Scenario Tests -->
|
||||
<Target Name="RunManagedCacheBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Managed Cache Service BVTs..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RunManagedCacheBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ManagedCacheBVTFilter) /resultsfile:$(TestOutputDirectory)\RunManagedCacheBVTDebug.trx"
|
||||
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None" />
|
||||
</Target>
|
||||
|
||||
<!-- Run the Website Scenario Tests -->
|
||||
<Target Name="RunWebsiteBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Website BVTs..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RunWebsiteBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(WebsiteBVTFilter) /resultsfile:$(TestOutputDirectory)\RunWebsiteBVTDebug.trx"
|
||||
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None"/>
|
||||
</Target>
|
||||
|
||||
<!-- Run the ServiceBus Scenario Tests -->
|
||||
<Target Name="RunServiceBusBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running Service Bus Scenario tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RunServiceBusBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ServiceBusBVTFilter) /resultsfile:$(TestOutputDirectory)\RunServiceBusBVTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
|
||||
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running CIT Scenario tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RunOneSDKCITDebug.trx" />
|
||||
|
@ -180,6 +149,14 @@
|
|||
|
||||
<!-- Run the AzureRT tests -->
|
||||
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running AzureRT BVT tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTBVTsSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running AzureRT BVT tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
|
||||
<Exec
|
||||
|
@ -187,7 +164,7 @@
|
|||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTOneTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running a specific tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
|
||||
<Exec
|
||||
|
@ -195,7 +172,7 @@
|
|||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTMultiTests" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Target Name="AzureRTMulti" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running tests:" />
|
||||
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
|
||||
<Exec
|
||||
|
@ -224,6 +201,26 @@
|
|||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running AzureRT all tests..." />
|
||||
|
||||
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
|
||||
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:Sequential /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
|
||||
ContinueOnError="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTPar" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running AzureRT all tests..." />
|
||||
|
||||
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
|
||||
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running AzureRT all tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\RTAddVhdDebug.trx" />
|
||||
|
@ -243,5 +240,25 @@
|
|||
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:Preview /resultsfile:$(TestOutputDirectory)\RTPreviewDebug.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<!-- DSC extension related targets -->
|
||||
<Target Name="TestDSCExtension_x64">
|
||||
<Message Importance="high" Text="Running DSC extension BVT x64 tests..." />
|
||||
<Delete Files="$(TestOutputDirectory)\DSCExtensionDebug_x64.trx" />
|
||||
<Exec
|
||||
Command="MSTest.exe /testcontainer:$(ServiceManagementExtensionsTestDebug) /testsettings:$(TestSettings_x64) /category:x64_only /resultsfile:$(TestOutputDirectory)\DSCExtensionDebug_x64.trx"
|
||||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<LiveTestDlls Include="$(ResourceManagerTestDebug)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="LiveTests">
|
||||
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
|
||||
<Exec Command="packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe @(LiveTestDlls) /trait "AcceptanceType=LiveBVT" /html "$(TestOutputDirectory)\Live.%(Filename).html"" />
|
||||
</Target>
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
|
|
113
ChangeLog.txt
113
ChangeLog.txt
|
@ -1,12 +1,121 @@
|
|||
2014.10.27 Version 0.8.10
|
||||
* Azure Data Factory cmdlets in AzureResourceManager mode
|
||||
* New-AzureDataFactory
|
||||
* New-AzureDataFactoryGateway
|
||||
* New-AzureDataFactoryGatewayKey
|
||||
* New-AzureDataFactoryHub
|
||||
* New-AzureDataFactoryLinkedService
|
||||
* New-AzureDataFactoryPipeline
|
||||
* New-AzureDataFactoryTable
|
||||
* New-AzureDataFactoryEncryptValue
|
||||
* Get-AzureDataFactory
|
||||
* Get-AzureDataFactoryGateway
|
||||
* Get-AzureDataFactoryHub
|
||||
* Get-AzureDataFactoryLinkedService
|
||||
* Get-AzureDataFactoryPipeline
|
||||
* Get-AzureDataFactoryRun
|
||||
* Get-AzureDataFactorySlice
|
||||
* Get-AzureDataFactoryTable
|
||||
* Remove-AzureDataFactory
|
||||
* Remove-AzureDataFactoryGateway
|
||||
* Remove-AzureDataFactoryHub
|
||||
* Remove-AzureDataFactoryLinkedService
|
||||
* Remove-AzureDataFactoryPipeline
|
||||
* Remove-AzureDataFactoryTable
|
||||
* Resume-AzureDataFactoryPipeline
|
||||
* Save-AzureDataFactoryLog
|
||||
* Set-AzureDataFactoryGateway
|
||||
* Set-AzureDataFactoryPipelineActivePeriod
|
||||
* Set-AzureDataFactorySliceStatus
|
||||
* Suspend-AzureDataFactoryPipeline
|
||||
* Azure Batch cmdlets in AzureResourceManager mode
|
||||
* Set-AzureBatchAccount
|
||||
* Remove-AzureBatchAccount
|
||||
* New-AzureBatchAccountKey
|
||||
* New-AzureBatchAccount
|
||||
* Get-AzureBatchAccountKeys
|
||||
* Get-AzureBatchAccount
|
||||
* Azure Network
|
||||
* Multi NIC support
|
||||
* Add-AzureNetworkInterfaceConfig
|
||||
* Get-AzureNetworkInterfaceConfig
|
||||
* Remove-AzureNetworkInterfaceConfig
|
||||
* Set-AzureNetworkInterfaceConfig
|
||||
* Security group support
|
||||
* Set-AzureNetworkSecurityGroupToSubnet
|
||||
* Set-AzureNetworkSecurityGroupConfig
|
||||
* Remove-AzureNetworkSecurityGroupFromSubnet
|
||||
* Remove-AzureNetworkSecurityGroupConfig
|
||||
* Remove-AzureNetworkSecurityGroup
|
||||
* New-AzureNetworkSecurityGroup
|
||||
* Get-AzureNetworkSecurityGroupForSubnet
|
||||
* Get-AzureNetworkSecurityGroupConfig
|
||||
* Get-AzureNetworkSecurityGroup
|
||||
* Azure Virtual Machine
|
||||
* Added Add PublicConfigKey and PrivateConfigKey parameters to SetAzureVMExtension
|
||||
* Azure Website
|
||||
* Set-AzureWebsite exposes new parameters and Get-AzureWebsite returns them
|
||||
* SlotStickyConnectionStringNames – connection string names not to be moved during swap operation
|
||||
* SlotStickyAppSettingNames – application settings names not to be moved during swap operation
|
||||
* AutoSwapSlotName – slot name to swap automatically with after successful deployment
|
||||
|
||||
2014.10.03 Version 0.8.9
|
||||
* Redis Cache cmdlets in AzureResourceManager mode
|
||||
* New-AzureRedisCache
|
||||
* Get-AzureRedisCache
|
||||
* Set-AzureRedisCache
|
||||
* Remove-AzureRedisCache
|
||||
* New-AzureRedisCacheKey
|
||||
* Get-AzureRedisCacheKey
|
||||
* Fixed Remove-AzureDataDisk regression
|
||||
* Fixed cloud service cmdlets to work with the latest Azure authoring tools
|
||||
* Fixed Get-AzureSubscription -ExtendedDetails regression
|
||||
* Added -CreateACSNamespace parameter to New-AzureSBNamespace cmdlet
|
||||
|
||||
2014.09.10 Version 0.8.8
|
||||
* Role-based access control support
|
||||
* Query role definition
|
||||
* Get-AzureRoleDefinition
|
||||
* Manage role assignment
|
||||
* New-AzureRoleAssignment
|
||||
* Get-AzureRoleAssignment
|
||||
* Remove-AzureRoleAssignment
|
||||
* Query Active Directory object
|
||||
* Get-AzureADUser
|
||||
* Get-AzureADGroup
|
||||
* Get-AzureADGroupMember
|
||||
* Get-AzureADServicePrincipal
|
||||
* Show user's permissions on
|
||||
* Get-AzureResourceGroup
|
||||
* Get-AzureResource
|
||||
* Active Directory service principal login support in Azure Resource Manager mode
|
||||
* Add-AzureAccount -Credential -ServicePrincipal -Tenant
|
||||
* SQL Database auditing support in Azure Resource Manager mode
|
||||
* Use-AzureSqlServerAuditingSetting
|
||||
* Set-AzureSqlServerAuditingSetting
|
||||
* Set-AzureSqlDatabaseAuditingSetting
|
||||
* Get-AzureSqlServerAuditingSetting
|
||||
* Get-AzureSqlDatabaseAuditingSetting
|
||||
* Disable-AzureSqlServerAuditing
|
||||
* Disable-AzureSqlDatabaseAuditing
|
||||
* Other improvements
|
||||
* Virtual Machine DSC extension supports PSCredential as configuration argument
|
||||
* Virtual Machine Antimalware extension supports native JSON configuration
|
||||
* Storage supports creating storage account with different geo-redundant options
|
||||
* Traffic Manager supports nesting of profiles
|
||||
* Website supports configuring x32/x64 worker process
|
||||
* -Detail parameter on Get-AzureResourceGroup to improve performance
|
||||
* Major refactoring around account and subscription management
|
||||
|
||||
2014.08.22 Version 0.8.7.1
|
||||
* AzureResourceManager
|
||||
* Update Gallery and Monitoring management clients to fix Gallery commands
|
||||
*HDInsight
|
||||
* Update Microsoft.Net API for Hadoop
|
||||
|
||||
|
||||
2014.08.18 Version 0.8.7
|
||||
* Update Newtonsoft.Json dependency to 6.0.4
|
||||
* Compute
|
||||
* Compute
|
||||
* Windows Azure Diagnostics (WAD) Version 1.2: extension cmdlets for Iaas And PaaS
|
||||
* Set-AzureVMDiagnosticsExtension
|
||||
* Get-AzureVMDiagnosticsExtension
|
||||
|
|
|
@ -158,7 +158,7 @@ You can also find the standalone installers for all the versions at [Downloads](
|
|||
|
||||
In general, following are the steps to start using Microsoft Azure PowerShell
|
||||
|
||||
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](http://www.azure.microsoft.com/en-us/manage/install-and-configure-windows-powershell/).
|
||||
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
|
||||
* Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
|
||||
* Starting from 0.8.6, you can use ``Add-AzureAccount -Credential`` to avoid the browser pop up for Organizational account.
|
||||
* Option 2: Download and import a publish settings file which contains a management certificate.
|
||||
|
|
35
build.proj
35
build.proj
|
@ -24,7 +24,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<UsingTask
|
||||
AssemblyFile="$(MSBuildProjectDirectory)\src\packages\xunit.1.9.2\lib\net20\xunit.runner.msbuild.dll"
|
||||
AssemblyFile="$(MSBuildProjectDirectory)\packages\xunit.runners.2.0.0-beta4-build2738\tools\xunit.runner.msbuild.dll"
|
||||
TaskName="Xunit.Runner.MSBuild.xunit" />
|
||||
|
||||
<!-- Clean the build in all configurations -->
|
||||
|
@ -78,9 +78,9 @@
|
|||
-->
|
||||
<Target Name="ForceRestorePackages">
|
||||
<PropertyGroup>
|
||||
<NuGetCommand>$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand>
|
||||
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
|
||||
<NuGetRestoreConfigSwitch>-ConfigFile "$(NuGetRestoreConfigFile)"</NuGetRestoreConfigSwitch>
|
||||
<NuGetCommand>$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand>
|
||||
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
|
||||
<NuGetRestoreConfigSwitch>-ConfigFile "$(NuGetRestoreConfigFile)"</NuGetRestoreConfigSwitch>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -94,12 +94,20 @@
|
|||
<WriteLinesToFile File="$(NuGetRestoreConfigFile)" Lines="<configuration></configuration>" Overwrite="true" Encoding="UTF-8" />
|
||||
<!-- Create config for user name and password for private feed access -->
|
||||
<Exec Command="$(NuGetCommand) sources add -Name AzureSdkInternal -Source "https://www.myget.org/F/azure-sdk-internal/" $(NuGetRestoreConfigSwitch)" />
|
||||
<!-- Private versions of packages are picked up from these feeds, defined with environment variables -->
|
||||
<Exec Command="$(NuGetCommand) sources add -Name PrimaryFeed -Source "$(PRIVATE_FEED_URL)" $(NuGetRestoreConfigSwitch)" Condition=" '$(PRIVATE_FEED_URL)'!='' "/>
|
||||
<Exec Command="$(NuGetCommand) sources Update -Name PrimaryFeed -UserName $(PRIVATE_FEED_USER_NAME) -Password "$(PRIVATE_FEED_PASSWORD)" $(NuGetRestoreConfigSwitch)" EchoOff="true" Condition=" '$(PRIVATE_FEED_PASSWORD)'!='' AND '$(PRIVATE_FEED_USER_NAME)'!='' "/>
|
||||
<Exec Command="$(NuGetCommand) sources add -Name SecondaryFeed -Source "$(SECONDARY_FEED_URL)" $(NuGetRestoreConfigSwitch)" Condition=" '$(SECONDARY_FEED_URL)'!='' "/>
|
||||
<Exec Command="$(NuGetCommand) sources Update -Name SecondaryFeed -UserName $(SECONDARY_FEED_USER_NAME) -Password "$(SECONDARY_FEED_PASSWORD)" $(NuGetRestoreConfigSwitch)" EchoOff="true" Condition=" '$(SECONDARY_FEED_PASSWORD)'!='' AND '$(SECONDARY_FEED_USER_NAME)'!='' "/>
|
||||
|
||||
<!-- Restore packages -->
|
||||
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\AzurePowerShell.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="ErrorAndContinue" />
|
||||
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\AzurePowerShell.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
|
||||
<!-- delete config file, don't want to leave passwords hanging around on the build server file system -->
|
||||
<Delete Files="$(NuGetRestoreConfigFile)" />
|
||||
<!--Restore the xunit runner needed to run unit tests-->
|
||||
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
|
||||
</Target>
|
||||
|
||||
|
||||
<!-- Build all flavors of the Cmdlets -->
|
||||
<Target Name="BuildCmdlets" DependsOnTargets="ForceRestorePackages">
|
||||
<Message Importance="high" Text="Building Cmdlets..." />
|
||||
|
@ -176,13 +184,17 @@
|
|||
ContinueOnError="false" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
|
||||
<XUnitExcludedTrait Condition="!$(RunTestLive)">RunType=LiveOnly</XUnitExcludedTrait>
|
||||
</PropertyGroup>
|
||||
<!-- Note: all testing related target should go to 'AzurePowershell.test.targets' file except the one used by CI run -->
|
||||
<Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>
|
||||
|
||||
<!-- Run checkin tests for each pull request -->
|
||||
<Target Name="Test" DependsOnTargets="BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running check in tests..." />
|
||||
<CallTarget Targets="CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests" />
|
||||
<CallTarget Targets="SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices"/>
|
||||
</Target>
|
||||
|
||||
<!-- Run Full switch with scenario tests -->
|
||||
|
@ -190,4 +202,13 @@
|
|||
Name="FullWithScenarioTests"
|
||||
DependsOnTargets="ForceRestorePackages;Clean;BuildDebug;BuildRelease;Test;BuildSetupDebug;BuildSetupRelease;RunOneSDKCIT" />
|
||||
|
||||
<!-- Run live tests and record mocks -->
|
||||
<Target
|
||||
Name="RunLiveTests"
|
||||
DependsOnTargets="ForceRestorePackages;Clean;BuildDebug;BuildRelease;LiveTestsFilter;BuildSetupDebug;BuildSetupRelease" />
|
||||
|
||||
<Target Name="LiveTestsFilter" DependsOnTargets="BuildDebug;BeforeRunTests">
|
||||
<Message Importance="high" Text="Running live tests..." />
|
||||
<CallTarget Targets="LiveTests"/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="xunit.runners" version="2.0.0-beta4-build2738" />
|
||||
<package id="xunit.runners" version="1.9.2" />
|
||||
</packages>
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
|
||||
<?define productName="Microsoft Azure PowerShell - September 2014" ?>
|
||||
<?define productName="Microsoft Azure PowerShell - October 2014" ?>
|
||||
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
|
||||
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
|
||||
|
||||
<?define version="0.8.8" ?>
|
||||
<?define version="0.8.10.1" ?>
|
||||
<?define versionedStartMenuFolder="Microsoft Azure" ?>
|
||||
<?define staleStartMenuFolder="Windows Azure" ?>
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
<Directory Id="StaleAzureSdkMenu" Name="$(var.staleStartMenuFolder)"/>
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
|
||||
<Property Id="POWERSHELLPATH">
|
||||
<RegistrySearch Id="POWERSHELLPATH"
|
||||
Type="raw"
|
||||
|
|
|
@ -7,7 +7,232 @@
|
|||
<Component Id="cmp96F13C307DA6E4AAC35F3D147F21553F" Guid="*">
|
||||
<File Id="fil96C82365E5F5A2F2747805236B563DF0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureResourceManager.psd1" />
|
||||
</Component>
|
||||
<Directory Id="dir2BEEAACE1371947984B11E66ADCB80DD" Name="Batch">
|
||||
<Component Id="cmp8E2BA91A40B8D59412A2943485B811AE" Guid="*">
|
||||
<File Id="fil3E9CA69732AFBF2986E7668590D4C711" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Azure.Commands.Batch.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp56ACCF91F66425C1037C7062BA383B3A" Guid="*">
|
||||
<File Id="filA475415DDE3879CB50D2D0AA94E4A0BE" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmpCD547779F6F6A3C6A4C63424758C4779" Guid="*">
|
||||
<File Id="filECDA110DA4701CD07A0CFD1F131F4727" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp41EB1BD4922D5F73CF3D111A30735FAA" Guid="*">
|
||||
<File Id="fil2E5F260A3D7FD4CC7728B4E9A061C542" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Azure.Management.Batch.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp43312667CE807A774BE498BF2F4B3591" Guid="*">
|
||||
<File Id="fil1A4EAEADD6D5C51A6D2752E49F49086D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpF0D4DCA1A233C6B0FF57EE1ECED903FF" Guid="*">
|
||||
<File Id="fil8490A1876721FDC06024B0688304BB8A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp00B8781FFCA509BA7E91A799102619B8" Guid="*">
|
||||
<File Id="fil05FA017E0D19C6DFD8FF9DD44AA7E9A7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpE45C589BDF02585850A84D19F1C64207" Guid="*">
|
||||
<File Id="fil16954B29A2BEE84B9F5435FA3F270FB7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8C936982E09C2E3DFCD8A10D48F5BEA7" Guid="*">
|
||||
<File Id="filA0C84A7EF6ACA76813D90B583D0B7C4D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp732ED6285E136B55594D7025192C1083" Guid="*">
|
||||
<File Id="filBE297BAC2F72AF992CD9635C5A1CA7A5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpF54F0C10743AA64C06DF9CA9DE890408" Guid="*">
|
||||
<File Id="fil2DBC2A6706B7F279F41B4FF9895D0B6C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.WindowsAzure.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp627116F7E1C1893C1EE04AB06317F135" Guid="*">
|
||||
<File Id="filD49E7AF8174C8245CBEB4DC7040FA8E3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.WindowsAzure.Common.NetFramework.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpDCC2D18CD2906785A9B84E415FDDF53A" Guid="*">
|
||||
<File Id="fil175B411AA6D5E213A50275AC3F300F2D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Microsoft.WindowsAzure.Management.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8405C6675181F577BECE0BC14A6B78AF" Guid="*">
|
||||
<File Id="fil02ABBD132A6F54547B0DB9CDBF08601A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\Newtonsoft.Json.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1080AE7EE64EE09F5084344782F732C4" Guid="*">
|
||||
<File Id="fil06158AAC72E98C22B26D66FC3AA5402D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\System.Net.Http.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp23BAA5F27F989B6A570DA6BAB5AF6468" Guid="*">
|
||||
<File Id="fil696569EA64AEAD96C2F6B1A67958F7D9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\System.Net.Http.Formatting.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpEE1426977F06792DC1DF6EC28AA3443B" Guid="*">
|
||||
<File Id="filF464C694C4B0CCC59A6B0ECC63E7D689" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Batch\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dirEBD7A4117888434C36B892FF6EDB3661" Name="DataFactories">
|
||||
<Component Id="cmp69B5D16DE6EF4B99D65D60F42E874739" Guid="*">
|
||||
<File Id="filFE310252466EB096CAC21C421BD762E6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Azure.Commands.DataFactories.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB64AC9D08A5FE63C06D1E33CEF7E7B9A" Guid="*">
|
||||
<File Id="fil3E17809661C4F4CB97352E5E530DED21" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Azure.Commands.DataFactories.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp1E9EDAA945A9718A74AEEE58D2995CF3" Guid="*">
|
||||
<File Id="fil84D986E6C556F2A5B6196E2AE952D138" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Azure.Commands.DataFactories.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp951B200A49755FC237755AA2C77A0E32" Guid="*">
|
||||
<File Id="filE680233863704425D29C310A831A89B0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Azure.Management.DataFactories.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1D51F57A02A3C8949E02ED001784388C" Guid="*">
|
||||
<File Id="fil1D9D6C76E1B943389910123884F80E38" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp0E60A03D189105D6E7A23E5B6943A5C4" Guid="*">
|
||||
<File Id="fil0114E75108ED068529C5ADCBB1BFD9DF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Data.Edm.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp0EE9B6E82BF354ED584258F3D7524FCC" Guid="*">
|
||||
<File Id="filF058DF83A3C7D1C1E4C33B68B512C589" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Data.OData.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3EF2308A3A5D4416CF0A37CF350381A2" Guid="*">
|
||||
<File Id="filBD789B715F4C6F58DFFACC4839072346" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Data.Services.Client.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8549E2CC25A35DDCAD1C042F4E80E254" Guid="*">
|
||||
<File Id="filF8F961D8FC629431B44B43A76538C334" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.DataFactories.Runtime.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp2E106693251FC564A4D03DA3778E26F7" Guid="*">
|
||||
<File Id="fil3F27EAE226BD87840D5E9CE662DE26F9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.DataTransfer.Gateway.Encryption.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp7BF776718E3154F969306B3FB853D175" Guid="*">
|
||||
<File Id="filE8DDA2F351E7F1B31911D503BF77AD0A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp5C0CE57E06ACF1B3E7CA7B8F63249A30" Guid="*">
|
||||
<File Id="fil5E6943D0CF72740FD64FAB8E9B9F458E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp651DD7B429A8B09A5D43100CF239BF8F" Guid="*">
|
||||
<File Id="filCFE6FEF85610CFE44653B00A52E6228B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp85AEF17DDAF661788B486FB492EA54CF" Guid="*">
|
||||
<File Id="filF00476CD93FE7C96E1B4B98546920964" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB968911FB871451CA08D9C75E232EB4F" Guid="*">
|
||||
<File Id="fil2BAF0B40F178928197483DA059D9FAFC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp560294B84C321846B8EAD5A79F702D29" Guid="*">
|
||||
<File Id="filD84039D3A094A4DED13D1F8583A14211" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Commands.Common.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3E8E747FAA6B7858FFCA940740658BD5" Guid="*">
|
||||
<File Id="fil7628CD55E7CD7C22AAA6792B2AFFE264" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Commands.Profile.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp5364EF7068CE1CD568984E413222A1B9" Guid="*">
|
||||
<File Id="fil9AF16681E67496A9343BC8228AA5759D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp667B7A1CD97B13D70F6CFA9D955799A6" Guid="*">
|
||||
<File Id="fil51C0DF0D652E5ADBF17624B351AD692B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Commands.Profile.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp3948A1023771BC2E3EC1C499E3920A56" Guid="*">
|
||||
<File Id="fil4C715467799007755D00896276090F42" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpEAB56781C9DA28C37F4D414C9E33F46B" Guid="*">
|
||||
<File Id="fil6E240C17B064EC065DDD54ADB57EB476" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Common.NetFramework.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpC8BA74B745B52059308DE7A6D162EE8F" Guid="*">
|
||||
<File Id="filFB97CF0896BE2E3AD239ECD2BEB749C2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Management.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp76BB7CDB96C84A2462BB6AE77257DDF6" Guid="*">
|
||||
<File Id="fil30E3A131129C4AFB0F4E148A582D0D86" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Management.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp5B21FDE396B40BC62C2A08FB8F9ECFFB" Guid="*">
|
||||
<File Id="filEC3C8E54DC4792DDDF0ECB7E21C5C356" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Microsoft.WindowsAzure.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp62D2C50BEF5EE702BB419A14ACC5981E" Guid="*">
|
||||
<File Id="fil3A7A9CE9EDFF14737D871BD1D69F0A9F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\Newtonsoft.Json.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8282F9914A4F7E56681C687F1D67D605" Guid="*">
|
||||
<File Id="fil6F6F514C87A7B8F4948EB56A4104F2E6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\System.Net.Http.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp2A19DE198514C78DDD94294C7681FCF5" Guid="*">
|
||||
<File Id="fil37FA4BAE4E4D5BCB8FCE6240693BCE7E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\System.Net.Http.Formatting.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpBFF3EE7A4627288C2D2424BA1DF0FCE1" Guid="*">
|
||||
<File Id="fil094ED52FC1222B3EA96BEDA2EFFFA0D0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpC04498A4FB0FD84163A4FABEFAFC86C4" Guid="*">
|
||||
<File Id="fil105666233D87C5D0098CF9541550A134" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\DataFactories\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir8CC0FAD05155C42F124B6D0BCA0E7D61" Name="RedisCache">
|
||||
<Component Id="cmp7D5E86930E84748A0DD514885305713B" Guid="*">
|
||||
<File Id="fil131E2C8103D8D211C808ED2DDD8C1973" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Azure.Commands.RedisCache.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB7F69E2328CC8CB1B9E69DAE4C52B988" Guid="*">
|
||||
<File Id="fil3245CC5C7354DEF7D00A5822BEAFE4E7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmpEEB3A1BBC45DAB3A9DF37AFE5BA15B72" Guid="*">
|
||||
<File Id="fil3EB9E8CE9A47DA1C3DEF207E61B1311A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmpFFECC72315DE4AF8E90A309B65045D14" Guid="*">
|
||||
<File Id="fil3B0E615A216A891D2FDD91C1F49190E8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Azure.Management.Redis.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp0A242CB7F78FA9A86DB05C843A7D680C" Guid="*">
|
||||
<File Id="fil26EA8FC5A561521BF650EF6D654401FD" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpE357EADF06DCA342293159E136F6353E" Guid="*">
|
||||
<File Id="fil25C8B8F745F96E4F75C2B9412F1C0CEF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8C38EE1D6EB37310BF142B965FBC21C2" Guid="*">
|
||||
<File Id="fil571550947B2C18732D7D4FA6F5489B53" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB2794F718A9476684D768A3166F0FD50" Guid="*">
|
||||
<File Id="fil04AA71D6A6B6832E8AE61AA3CBF9D716" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp899B2DCF1DF2395438CD62B9FB2EC09F" Guid="*">
|
||||
<File Id="filA8139790A4986A9A5739D775BE4A5CEE" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpEE4A2BAEC5568986667C5E556013AFAD" Guid="*">
|
||||
<File Id="filECCBF3D5C90A45EF77C9F3CEE8906CCE" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpA93566CFE9D76033607CD41BAA707D7E" Guid="*">
|
||||
<File Id="fil75585961FDA98980C706A4F208631730" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp33B9E674E25760B27008F7E0173E9BF7" Guid="*">
|
||||
<File Id="filB36BA1F89A69C85C9E1C60BFBDF2E247" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Commands.Profile.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp762502142BBFE32FEED1689641652E0C" Guid="*">
|
||||
<File Id="filEDB39D51654950F9C40DAB5687BC3691" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp4F13880335E5A945AC4D9871979DBE9D" Guid="*">
|
||||
<File Id="fil2679F8A091915C7153F1E60CA1FB5D81" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Commands.Profile.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp83B2C24E9ECCD38EFAE85B862F8BDC98" Guid="*">
|
||||
<File Id="filE4F1CB07C4C2AD46D8DD3916F528E90D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpDCD56D8B245650F0D28BE683A52ADFF6" Guid="*">
|
||||
<File Id="fil3A4EF466B0BBD4ACEF3B48F81BC7027D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Common.NetFramework.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp6BF8987BC4CDCB18EC1C7F909A830728" Guid="*">
|
||||
<File Id="fil920F92BCBBE3428A4A847A56BC91FCC6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Microsoft.WindowsAzure.Management.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp0080B0E79CF939DA491D97948DA6A045" Guid="*">
|
||||
<File Id="fil2337B04380F0A1703AD1EFFF79FC5D08" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\Newtonsoft.Json.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp0E413D6D37193329AE9010F9FA2890C5" Guid="*">
|
||||
<File Id="fil51F2FB78266A338838750DF4A03D29D7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\System.Net.Http.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB0B297F0299FD28B4E6A8D7DD9C09488" Guid="*">
|
||||
<File Id="fil5754B4F4B42FEABCCD5C6D1A12BD70BB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\System.Net.Http.Formatting.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp5213FD510F56FD8BB9F7937D8F0F4B7E" Guid="*">
|
||||
<File Id="filA285606FDF7819DFF4D2CC3872D131C8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\RedisCache\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir373C860472263629CD07E0A04D948706" Name="Resources">
|
||||
<Component Id="cmp52B4C6C34E55FFC84846006FBFF66323" Guid="*">
|
||||
<File Id="fil5CD22B4406C5EBE89BC1D35703AA94A9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.Batch.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp7F1D26F455AA981C1C86ACFA401241D3" Guid="*">
|
||||
<File Id="fil98967F85D5F46C4E51018F7E7304702C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmpBC5FC2169331517CC80DA5FEB5DE1FBA" Guid="*">
|
||||
<File Id="filE167246B00C6B04FC419FABE5D1ADC19" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp519FA93A87044E1F6B5096B295370488" Guid="*">
|
||||
<File Id="filA5A191EF8334D604B0E84AB68E089999" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.RedisCache.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp676F99A118173C700AFBDC73848BD83B" Guid="*">
|
||||
<File Id="filEA209BA4E78CB275230EFB3686205A53" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp13A9EC661F7AC7FA9D243ADFFC00A3A2" Guid="*">
|
||||
<File Id="fil9C49954FC1D7A0F8B58EBE2243987470" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp73768AE8C93638B2530E9F74B6FA5470" Guid="*">
|
||||
<File Id="fil2112A41C953308499BCC1D706AA6FC6F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Commands.Resources.dll" />
|
||||
</Component>
|
||||
|
@ -41,6 +266,12 @@
|
|||
<Component Id="cmp8FEE3315C970FDADD6195DE7DEC9F62C" Guid="*">
|
||||
<File Id="fil8AD6BBF17DBD67E48178440D5B81250E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Management.Authorization.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp42A50186F4AFE110F82ED0DBF18A271E" Guid="*">
|
||||
<File Id="fil367F9428280E404ABE5701EFB2B19614" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Management.Batch.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp7513A156C71ECD5FD6BE7BEBC3DB024B" Guid="*">
|
||||
<File Id="fil8EA604CD246FD926A5EB987107705884" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Management.Redis.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1E110B3A62CD167B9B41556BD0F2CD6F" Guid="*">
|
||||
<File Id="fil4653A5682BB54F2C6DCEA81F1A9E76A6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Management.Sql.dll" />
|
||||
</Component>
|
||||
|
@ -50,15 +281,6 @@
|
|||
<Component Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" Guid="*">
|
||||
<File Id="fil19BB25F9DA24781AACDA2274CE28507D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" Guid="*">
|
||||
<File Id="fil850F0FF63537F0428126B3E04D5A49E6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Data.Edm.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp49A15EDF3D2E72E177EF373D2E9AB2DE" Guid="*">
|
||||
<File Id="fil0C59FE29ED0B33F9B8BCA7B9EFA453C2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Data.OData.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpABB2FE63524DC4243E6F2FCDF24C7D5D" Guid="*">
|
||||
<File Id="filB09D1539CCB60FACBC1A4134C2FA31AF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Data.Services.Client.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3F61F18D6C072A4C001EB2E9AC4DA285" Guid="*">
|
||||
<File Id="fil13B48C7E8D2086EE58727B777EDCF250" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
|
@ -110,9 +332,6 @@
|
|||
<Component Id="cmp353F25E254A7722E3CADF046790D3C4D" Guid="*">
|
||||
<File Id="filBBAEBE5F5EEA3669E221D2C320887E4A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" Guid="*">
|
||||
<File Id="fil59FE45D1790EB33DE9F5C7E23E2F7100" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir70AE8239A404E2C5D5621DBCDA6733C9" Name="Sql">
|
||||
<Component Id="cmp56F52674BB946225BB64533814DCF37F" Guid="*">
|
||||
|
@ -139,6 +358,9 @@
|
|||
<Component Id="cmp0893D9E09B980CCC1BF6D135F3970613" Guid="*">
|
||||
<File Id="filB97E69B003A4696B675CDC4D63FB3D1F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpDDE620440EB1F0EF86DB62FF00D53311" Guid="*">
|
||||
<File Id="fil498485698757F335ECBE11B972950EC3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp72AD64E6E7232E9E6A1F1E4C94BC1A8E" Guid="*">
|
||||
<File Id="fil4A1BB8BEACDEB90A259392D7FFCA9375" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
|
@ -279,15 +501,6 @@
|
|||
<Component Id="cmp86A3FC330AB128431B87D9FC2A1D3109" Guid="*">
|
||||
<File Id="fil08829B0CC57BEE7E650F0AE7867D27EE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpFA26F6A2AEA6C463124B0DA5526DFA5B" Guid="*">
|
||||
<File Id="fil1C1040C024B626CA803EAE5780A35091" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Data.Edm.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3C5FF73C881AC1641C0A86BD49A82EF4" Guid="*">
|
||||
<File Id="filE68F5346B4C85A3492DE1780D39BF323" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Data.OData.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp162CBF9B2A35CD117F17E98A30510A9E" Guid="*">
|
||||
<File Id="fil2961A0CE5D9228AEC65774D44E1017D1" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Data.Services.Client.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1D87896B8DB222621598E697ABAF8676" Guid="*">
|
||||
<File Id="filEE64D33AA9FFAAD706E543ADAFA24D29" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
|
@ -324,9 +537,6 @@
|
|||
<Component Id="cmp5E7A927FFF2CD1AC2D9A4D4746132F63" Guid="*">
|
||||
<File Id="filB8CC7F54EE2670B3FC479E8BE465C61C" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpFE490B8321A94A3CE93E59ADF7BDC19F" Guid="*">
|
||||
<File Id="filC7B96AC24135FA5D3F84F35665FAB34E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir933E2F60BC4A32B6B44E2AD79A5970F7" Name="Compute">
|
||||
<Component Id="cmpD31EE6D7925E4DAECBC12F02B2C896AA" Guid="*">
|
||||
|
@ -344,6 +554,24 @@
|
|||
<Component Id="cmp28CB51C576059DF757256E5626E5A87F" Guid="*">
|
||||
<File Id="fil61E4E395AA14EDB779CCE2285055EED2" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\AzureResourceManager.psd1" />
|
||||
</Component>
|
||||
<Component Id="cmp75FC2B6D6C89E140FED596D2C4AB5D73" Guid="*">
|
||||
<File Id="fil4613EEBDCA0FD5F2C846084852517673" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp9BB704A34E478064B5AEA018BAE986CA" Guid="*">
|
||||
<File Id="filC63EB870E043EAB3E5874E4BDCC76FCF" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp54514D36BA8821CF1149D4647C9F34BA" Guid="*">
|
||||
<File Id="fil133B69D4144D718FE7E559FF1AA9673B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.Network.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp92D521CCBFF0A4064A70115D4DBE13C4" Guid="*">
|
||||
<File Id="filF6C9F9970C59B38828F1E813670BCB7F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.Network.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp9DBA37B38077942A2856B006B0D29A0A" Guid="*">
|
||||
<File Id="filB4747D5A0F54ADFA571957547041F5AD" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp0C0FC77DAEF2A45138590D65DCDD21B8" Guid="*">
|
||||
<File Id="filE55E8D836BD5E6F609EECF27B26CBB7E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp5ACBDDEE7EBFF87A502B9FCF53520122" Guid="*">
|
||||
<File Id="fil05622093B9BAD4063FDC52C4CADD209C" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\Microsoft.Azure.Commands.Resources.dll-Help.xml" />
|
||||
</Component>
|
||||
|
@ -523,15 +751,6 @@
|
|||
<Component Id="cmpAD0D6F02EBA3855DF8C31C7AC90E468C" Guid="*">
|
||||
<File Id="fil29BA7142718A57A619B702C7231C5264" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpDCDD0316B40A81BFB6A4B4E35EE34A5C" Guid="*">
|
||||
<File Id="fil59D8366C3FDA90B032A3BCF45C32E908" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\Microsoft.Data.Edm.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp7C33F84612F27F4CC833F290D0A29C09" Guid="*">
|
||||
<File Id="fil83940993A93584674B71D724D617C9D8" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\Microsoft.Data.OData.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp9C077BC01B4DF51DA54E6CD541F4CD62" Guid="*">
|
||||
<File Id="fil43A8D1245BDA5C6107D21C98C2DFDFEE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\Microsoft.Data.Services.Client.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp9E90BD9AECEF01B2B4132041FE7AEB20" Guid="*">
|
||||
<File Id="fil8EF91FDDBFE4388A86054BCBC8C68B89" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
|
@ -580,9 +799,6 @@
|
|||
<Component Id="cmpB0718E71D7A15CCA7375389A12F7D568" Guid="*">
|
||||
<File Id="fil9CF3B7FD9BFFADE7CE7C0B4B09018E8A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpA25B169536D74A1BE4AC6D9FC02B3338" Guid="*">
|
||||
<File Id="fil50F4FEF0B547CF7D2B8D7D0A998E837A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ExpressRoute\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir59C91A8ADAEBA190A387BD9805945B5D" Name="HDInsight">
|
||||
<Component Id="cmp63E7146E10A0CADBB072FDBAAEC2FDB2" Guid="*">
|
||||
|
@ -680,12 +896,24 @@
|
|||
<Component Id="cmpC110FE23081DF64903C0AE4A58BF2EE9" Guid="*">
|
||||
<File Id="fil2C426E04DBC73EA5317B1152BCFE2547" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\AzureResourceManager.psd1" />
|
||||
</Component>
|
||||
<Component Id="cmpEA34C96EF8D15E8A5D7862D7C5F18361" Guid="*">
|
||||
<File Id="filC9A8DF75BCC268D140C7CDCA92186E42" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmpFDE34E67D5969F5B0F8F5B3483E2B2B2" Guid="*">
|
||||
<File Id="filA9247B5A07B4EB9EC0C2F0E44AC100BE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp271EE413AA0CFA81047392C231D35019" Guid="*">
|
||||
<File Id="fil5A47EE549B105198DC77902E7C3B4FD7" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.ManagedCache.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpE6F2C1F15F5A672D8597DA20C7FBBEE4" Guid="*">
|
||||
<File Id="fil7F60C21D0A2F1982B6235FA72061A970" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.ManagedCache.dll-help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp320445BFD6404D5395B37391FC5BD42A" Guid="*">
|
||||
<File Id="fil446108EFB01A7AFC980B2BAAF9C7F0C0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp64030D5B6C82DAF62B9FE5045B77700C" Guid="*">
|
||||
<File Id="filDB7EAD1005C8CC8E3947AC53E7B55E14" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp5525BBDC2AFA16BA65885B77260D8AC6" Guid="*">
|
||||
<File Id="filE30599F8A678F8CE28AED9C66D974C65" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Microsoft.Azure.Commands.Resources.dll-Help.xml" />
|
||||
</Component>
|
||||
|
@ -828,6 +1056,121 @@
|
|||
<File Id="filEB2DFF7B431F3A391BD8990DCE85F5AF" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dirED6242ED1A5454A693857DC05B9D9BCF" Name="Network">
|
||||
<Component Id="cmp3C03B2095C2A69D5E6DCE437C5D2A690" Guid="*">
|
||||
<File Id="filDAE337FBE3E5DA7AB9B9C24357448F81" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\AutoMapper.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3ECF10DC0D89D53F9C58C6794E6EABE8" Guid="*">
|
||||
<File Id="filCD6CAB84B87E0DF7625E99AD143ED151" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\AutoMapper.Net4.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp58A842A5ABBE9598F160B1A7783AC260" Guid="*">
|
||||
<File Id="fil1F921EEB0D64502700FB274014AFE039" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Azure.Commands.Network.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpFDA1F5A25A639A882EB28E3221AD7DE9" Guid="*">
|
||||
<File Id="filD00F4DBD80CA97D9AEA81F8E8D382906" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Azure.Commands.Network.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp762B6053667CF7B9B230C8A1D24FA0D9" Guid="*">
|
||||
<File Id="filEC74A01AB7DEBB5774F0CA8857AF6210" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpD7E60BF6560B41E428111B86E2877786" Guid="*">
|
||||
<File Id="filC039D3F61AD887DC8EB22F9125DD44A4" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Data.Edm.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp11075FC351A7A22ED9FF2DB465B744AE" Guid="*">
|
||||
<File Id="filAE68609B4CFE20431462F0E8C6DC96DF" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Data.OData.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp512138D53CEF7A55CDC83F741D291561" Guid="*">
|
||||
<File Id="filCB202AA39D883D44970AF122CCC315CA" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Data.Services.Client.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp99E6EFD6C5345F2027EF49DC01C8D7A2" Guid="*">
|
||||
<File Id="fil40BBDB78C6B2E3816237AB02850CEA72" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpF65876F380AC9BFC04EF7E0A83D9E2EA" Guid="*">
|
||||
<File Id="fil5A33591732E00248A91493778B8937C1" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpE4AF0916E9D6C5168DB8918CDA69588A" Guid="*">
|
||||
<File Id="fil52666B878D7F4731B81553C575E2A273" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpAD101287B1EF8B771D333A9FF29C30C8" Guid="*">
|
||||
<File Id="filD24694E222A19D87EFF6CE1450E90694" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Commands.Common.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp3B09B2514E3E788BBE5D44BC3022E8B1" Guid="*">
|
||||
<File Id="filEA632A5B433E67D632B7E1540007C4D9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1C992F609F0E3E895F924EB4DDA1872C" Guid="*">
|
||||
<File Id="filF409ED28B951574DB5A63607CF42D46D" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Common.NetFramework.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp2DC40B144472AD010779DC6F0D263C32" Guid="*">
|
||||
<File Id="filCE356D3E7AEFA4E68193B74286DC5A41" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Management.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpD8BCF6F87A66E2BF3DA331CCDCE9525D" Guid="*">
|
||||
<File Id="fil3C914E453EC1005A6AABA33EA80F4320" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Management.Network.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpB382FB922425C1C446A732BD66BBEEE0" Guid="*">
|
||||
<File Id="filC3BD427E37878155D0DDCCD87A15626F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Management.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp9C36EDC63632529B78C870EF3695F0D3" Guid="*">
|
||||
<File Id="fil6BE8C2DAB2BDFE085DD230800D465D7F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Microsoft.WindowsAzure.Storage.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp12C6E2ACC51F95C3303F6486917E8E75" Guid="*">
|
||||
<File Id="filDB5B05710501E18F7BB630DA75A91B03" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\Newtonsoft.Json.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp87E83CA66DD51C9A6D61F1AC91FF683B" Guid="*">
|
||||
<File Id="filB81C05773E93D768A10E3A660379BBC7" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\System.Net.Http.Formatting.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpCC09A82900E1A278F48DB77993C40967" Guid="*">
|
||||
<File Id="filA9139A091A1470B6463953C84F7B1BF9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Network\System.Spatial.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dirE73571EA2365088BBD4338AB4D19D5AC" Name="RecoveryServices">
|
||||
<Component Id="cmpCA80C6C0F5670291AF2F3560D36B1EA3" Guid="*">
|
||||
<File Id="filE640AA6B0606E3DE6875594E25DE82D3" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Azure.Commands.RecoveryServices.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp1E1EACEE941A7D7B9B2649BB3AC9ABC3" Guid="*">
|
||||
<File Id="fil7BC44111780DA333D7D3C421E0660012" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Azure.Commands.RecoveryServices.dll-help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp6842A5697846B92CCF6ED50688A26C1A" Guid="*">
|
||||
<File Id="filFA33C5B86A806E7029B5DFF9E2F5C12B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Azure.ResourceManager.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpEFBAA8731C08B69493F16C6511A3FBC8" Guid="*">
|
||||
<File Id="filFED822B1605825095C44BD43E71EC342" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp4A98D12853680B70EA13B558FF5B66BE" Guid="*">
|
||||
<File Id="fil1F34AF5202BC985B0AB504C8C5EC7CD0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Threading.Tasks.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpFFEE4D9645AEA846AF41897FD2135E02" Guid="*">
|
||||
<File Id="fil3A2F7D5870DF95F7C639D35F6B82B96F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp2F6E4C6B8006898EFE87C88921C1B6BA" Guid="*">
|
||||
<File Id="fil81DB522582833564DCD9B09361ED93CF" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" Guid="*">
|
||||
<File Id="fil2C73256F76E79B695523A2B3C4C845E9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Commands.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" Guid="*">
|
||||
<File Id="fil528A48BB87B57E0D131C279CAD156D2B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpBE209ED6509A7E857FD9F9078051DC6A" Guid="*">
|
||||
<File Id="fil96FD7FA0CBEE96E0C0239408CD5651A9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.NetFramework.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpD7A9F76B2346156CA8F83F41A302B714" Guid="*">
|
||||
<File Id="fil0218D7505353104A9DB742A55A839351" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp4D3E383B38EF4392E70E981B7CA033D7" Guid="*">
|
||||
<File Id="fil3D6B846AC421D38C5A9CB40A58B058B6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.SiteRecovery.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp439E7C155DEEFC3877653E4ED11F66AC" Guid="*">
|
||||
<File Id="filE3D7ECC5C92739687FAA34CCE9DFB4A3" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Newtonsoft.Json.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp5278A11908DC26651A78E55522C71DF3" Guid="*">
|
||||
<File Id="fil3C9995984C13EAB542D813B85C917916" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Extensions.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp4ED39EDE761ED68263635882802FB1B5" Guid="*">
|
||||
<File Id="fil70740B1FE6589862755DC5316CE8C552" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Formatting.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp2A0B3E88742D800F88F70A714BAC94B5" Guid="*">
|
||||
<File Id="fil8B5C2678B7FAC0061799DCBFF4AFE27E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Primitives.dll" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir5A14F7172D6373ACE47493BAD054EEF3" Name="Services">
|
||||
<Component Id="cmp5F55270F607737A772BFBE2D8F6B76E4" Guid="*">
|
||||
<File Id="filF7E717D6789D9D4D072D3BA81461FCB3" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\AutoMapper.dll" />
|
||||
|
@ -841,6 +1184,18 @@
|
|||
<Component Id="cmp9BB01A9CE50D2F02F6CF08B68575CE63" Guid="*">
|
||||
<File Id="fil21EB602374E46919C900F52BD4FF9071" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\AzureResourceManager.psd1" />
|
||||
</Component>
|
||||
<Component Id="cmpFEC750EF6D159A3517BF9C8C75FF1754" Guid="*">
|
||||
<File Id="fil1E87E6693B9299E6A55B5194B7F4F899" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp074BBC4745C6E6F89A1963FD0621491A" Guid="*">
|
||||
<File Id="fil5D89E07358DF443DE63F3B50547E1EFD" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmpD403CA2620FB13B02947597F523205AB" Guid="*">
|
||||
<File Id="fil0877540B55E3E60C465C5BCF507F415F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmpCC0508ADCA3E92A67914CBF93991F25B" Guid="*">
|
||||
<File Id="fil295637A5742FD9F5D103EC30E27488BC" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp5348A71B0B8AB94A5F1E9886459B2BB5" Guid="*">
|
||||
<File Id="filE32DA7A87086B64048CA049E873DBB86" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Microsoft.Azure.Commands.Resources.dll-Help.xml" />
|
||||
</Component>
|
||||
|
@ -1293,6 +1648,18 @@
|
|||
<Component Id="cmp0E477FF2628135E33C31795B0116531C" Guid="*">
|
||||
<File Id="fil76D25A0C7DCE101C2AC94710A3C8E508" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\AzureResourceManager.psd1" />
|
||||
</Component>
|
||||
<Component Id="cmp7B389D27AE33BBC84F231F5C78BE0086" Guid="*">
|
||||
<File Id="fil62BD7239733D1BA9CB7FC9187D7F8AF8" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\Microsoft.Azure.Commands.Batch.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp94673F5DFC53857EF6527E84FE8BD30A" Guid="*">
|
||||
<File Id="filFE64B20F290A7F21CC5E9C569120CDD7" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\Microsoft.Azure.Commands.Batch.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp0768A087ABCEC038FF46A989346CD0BD" Guid="*">
|
||||
<File Id="fil406A90202B5A76E59FCB73C215C8E5E0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\Microsoft.Azure.Commands.RedisCache.dll-Help.xml" />
|
||||
</Component>
|
||||
<Component Id="cmp478C52C713BC83A1D6EF6623C1F02E9F" Guid="*">
|
||||
<File Id="filAF314457EAB56F453E80476055046524" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\Microsoft.Azure.Commands.RedisCache.format.ps1xml" />
|
||||
</Component>
|
||||
<Component Id="cmp8073B9AB5328ACDB45711FB0F9099B9E" Guid="*">
|
||||
<File Id="fil258A366784B8082541CB4E8B4AC7B8E0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\Microsoft.Azure.Commands.Resources.dll-Help.xml" />
|
||||
</Component>
|
||||
|
@ -1614,6 +1981,79 @@
|
|||
<Fragment>
|
||||
<ComponentGroup Id="azurecmdfiles">
|
||||
<ComponentRef Id="cmp96F13C307DA6E4AAC35F3D147F21553F" />
|
||||
<ComponentRef Id="cmp8E2BA91A40B8D59412A2943485B811AE" />
|
||||
<ComponentRef Id="cmp56ACCF91F66425C1037C7062BA383B3A" />
|
||||
<ComponentRef Id="cmpCD547779F6F6A3C6A4C63424758C4779" />
|
||||
<ComponentRef Id="cmp41EB1BD4922D5F73CF3D111A30735FAA" />
|
||||
<ComponentRef Id="cmp43312667CE807A774BE498BF2F4B3591" />
|
||||
<ComponentRef Id="cmpF0D4DCA1A233C6B0FF57EE1ECED903FF" />
|
||||
<ComponentRef Id="cmp00B8781FFCA509BA7E91A799102619B8" />
|
||||
<ComponentRef Id="cmpE45C589BDF02585850A84D19F1C64207" />
|
||||
<ComponentRef Id="cmp8C936982E09C2E3DFCD8A10D48F5BEA7" />
|
||||
<ComponentRef Id="cmp732ED6285E136B55594D7025192C1083" />
|
||||
<ComponentRef Id="cmpF54F0C10743AA64C06DF9CA9DE890408" />
|
||||
<ComponentRef Id="cmp627116F7E1C1893C1EE04AB06317F135" />
|
||||
<ComponentRef Id="cmpDCC2D18CD2906785A9B84E415FDDF53A" />
|
||||
<ComponentRef Id="cmp8405C6675181F577BECE0BC14A6B78AF" />
|
||||
<ComponentRef Id="cmp1080AE7EE64EE09F5084344782F732C4" />
|
||||
<ComponentRef Id="cmp23BAA5F27F989B6A570DA6BAB5AF6468" />
|
||||
<ComponentRef Id="cmpEE1426977F06792DC1DF6EC28AA3443B" />
|
||||
<ComponentRef Id="cmp69B5D16DE6EF4B99D65D60F42E874739" />
|
||||
<ComponentRef Id="cmpB64AC9D08A5FE63C06D1E33CEF7E7B9A" />
|
||||
<ComponentRef Id="cmp1E9EDAA945A9718A74AEEE58D2995CF3" />
|
||||
<ComponentRef Id="cmp951B200A49755FC237755AA2C77A0E32" />
|
||||
<ComponentRef Id="cmp1D51F57A02A3C8949E02ED001784388C" />
|
||||
<ComponentRef Id="cmp0E60A03D189105D6E7A23E5B6943A5C4" />
|
||||
<ComponentRef Id="cmp0EE9B6E82BF354ED584258F3D7524FCC" />
|
||||
<ComponentRef Id="cmp3EF2308A3A5D4416CF0A37CF350381A2" />
|
||||
<ComponentRef Id="cmp8549E2CC25A35DDCAD1C042F4E80E254" />
|
||||
<ComponentRef Id="cmp2E106693251FC564A4D03DA3778E26F7" />
|
||||
<ComponentRef Id="cmp7BF776718E3154F969306B3FB853D175" />
|
||||
<ComponentRef Id="cmp5C0CE57E06ACF1B3E7CA7B8F63249A30" />
|
||||
<ComponentRef Id="cmp651DD7B429A8B09A5D43100CF239BF8F" />
|
||||
<ComponentRef Id="cmp85AEF17DDAF661788B486FB492EA54CF" />
|
||||
<ComponentRef Id="cmpB968911FB871451CA08D9C75E232EB4F" />
|
||||
<ComponentRef Id="cmp560294B84C321846B8EAD5A79F702D29" />
|
||||
<ComponentRef Id="cmp3E8E747FAA6B7858FFCA940740658BD5" />
|
||||
<ComponentRef Id="cmp5364EF7068CE1CD568984E413222A1B9" />
|
||||
<ComponentRef Id="cmp667B7A1CD97B13D70F6CFA9D955799A6" />
|
||||
<ComponentRef Id="cmp3948A1023771BC2E3EC1C499E3920A56" />
|
||||
<ComponentRef Id="cmpEAB56781C9DA28C37F4D414C9E33F46B" />
|
||||
<ComponentRef Id="cmpC8BA74B745B52059308DE7A6D162EE8F" />
|
||||
<ComponentRef Id="cmp76BB7CDB96C84A2462BB6AE77257DDF6" />
|
||||
<ComponentRef Id="cmp5B21FDE396B40BC62C2A08FB8F9ECFFB" />
|
||||
<ComponentRef Id="cmp62D2C50BEF5EE702BB419A14ACC5981E" />
|
||||
<ComponentRef Id="cmp8282F9914A4F7E56681C687F1D67D605" />
|
||||
<ComponentRef Id="cmp2A19DE198514C78DDD94294C7681FCF5" />
|
||||
<ComponentRef Id="cmpBFF3EE7A4627288C2D2424BA1DF0FCE1" />
|
||||
<ComponentRef Id="cmpC04498A4FB0FD84163A4FABEFAFC86C4" />
|
||||
<ComponentRef Id="cmp7D5E86930E84748A0DD514885305713B" />
|
||||
<ComponentRef Id="cmpB7F69E2328CC8CB1B9E69DAE4C52B988" />
|
||||
<ComponentRef Id="cmpEEB3A1BBC45DAB3A9DF37AFE5BA15B72" />
|
||||
<ComponentRef Id="cmpFFECC72315DE4AF8E90A309B65045D14" />
|
||||
<ComponentRef Id="cmp0A242CB7F78FA9A86DB05C843A7D680C" />
|
||||
<ComponentRef Id="cmpE357EADF06DCA342293159E136F6353E" />
|
||||
<ComponentRef Id="cmp8C38EE1D6EB37310BF142B965FBC21C2" />
|
||||
<ComponentRef Id="cmpB2794F718A9476684D768A3166F0FD50" />
|
||||
<ComponentRef Id="cmp899B2DCF1DF2395438CD62B9FB2EC09F" />
|
||||
<ComponentRef Id="cmpEE4A2BAEC5568986667C5E556013AFAD" />
|
||||
<ComponentRef Id="cmpA93566CFE9D76033607CD41BAA707D7E" />
|
||||
<ComponentRef Id="cmp33B9E674E25760B27008F7E0173E9BF7" />
|
||||
<ComponentRef Id="cmp762502142BBFE32FEED1689641652E0C" />
|
||||
<ComponentRef Id="cmp4F13880335E5A945AC4D9871979DBE9D" />
|
||||
<ComponentRef Id="cmp83B2C24E9ECCD38EFAE85B862F8BDC98" />
|
||||
<ComponentRef Id="cmpDCD56D8B245650F0D28BE683A52ADFF6" />
|
||||
<ComponentRef Id="cmp6BF8987BC4CDCB18EC1C7F909A830728" />
|
||||
<ComponentRef Id="cmp0080B0E79CF939DA491D97948DA6A045" />
|
||||
<ComponentRef Id="cmp0E413D6D37193329AE9010F9FA2890C5" />
|
||||
<ComponentRef Id="cmpB0B297F0299FD28B4E6A8D7DD9C09488" />
|
||||
<ComponentRef Id="cmp5213FD510F56FD8BB9F7937D8F0F4B7E" />
|
||||
<ComponentRef Id="cmp52B4C6C34E55FFC84846006FBFF66323" />
|
||||
<ComponentRef Id="cmp7F1D26F455AA981C1C86ACFA401241D3" />
|
||||
<ComponentRef Id="cmpBC5FC2169331517CC80DA5FEB5DE1FBA" />
|
||||
<ComponentRef Id="cmp519FA93A87044E1F6B5096B295370488" />
|
||||
<ComponentRef Id="cmp676F99A118173C700AFBDC73848BD83B" />
|
||||
<ComponentRef Id="cmp13A9EC661F7AC7FA9D243ADFFC00A3A2" />
|
||||
<ComponentRef Id="cmp73768AE8C93638B2530E9F74B6FA5470" />
|
||||
<ComponentRef Id="cmp43B198DD7ECA39F95FF5CD09BD732D67" />
|
||||
<ComponentRef Id="cmpF723A612E44FEF81A6FD35D6F83156E4" />
|
||||
|
@ -1625,12 +2065,11 @@
|
|||
<ComponentRef Id="cmp1B6C63CF8B463CAEE1556B5E75652E2C" />
|
||||
<ComponentRef Id="cmp317D72948C627EE46943444F82EE25DA" />
|
||||
<ComponentRef Id="cmp8FEE3315C970FDADD6195DE7DEC9F62C" />
|
||||
<ComponentRef Id="cmp42A50186F4AFE110F82ED0DBF18A271E" />
|
||||
<ComponentRef Id="cmp7513A156C71ECD5FD6BE7BEBC3DB024B" />
|
||||
<ComponentRef Id="cmp1E110B3A62CD167B9B41556BD0F2CD6F" />
|
||||
<ComponentRef Id="cmpE663F01DCBA794BF32541E268FA26640" />
|
||||
<ComponentRef Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" />
|
||||
<ComponentRef Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" />
|
||||
<ComponentRef Id="cmp49A15EDF3D2E72E177EF373D2E9AB2DE" />
|
||||
<ComponentRef Id="cmpABB2FE63524DC4243E6F2FCDF24C7D5D" />
|
||||
<ComponentRef Id="cmp3F61F18D6C072A4C001EB2E9AC4DA285" />
|
||||
<ComponentRef Id="cmpE7396D3C1C29168AEE4870C9146437BD" />
|
||||
<ComponentRef Id="cmpEFA6723DE788649C36CFD4875ED618EA" />
|
||||
|
@ -1648,7 +2087,6 @@
|
|||
<ComponentRef Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" />
|
||||
<ComponentRef Id="cmp997A920A652163E94E56A412D2BEC28C" />
|
||||
<ComponentRef Id="cmp353F25E254A7722E3CADF046790D3C4D" />
|
||||
<ComponentRef Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" />
|
||||
<ComponentRef Id="cmp56F52674BB946225BB64533814DCF37F" />
|
||||
<ComponentRef Id="cmp499092B04619C0EDE4686B78E1128605" />
|
||||
<ComponentRef Id="cmp95CE3E0A8DCAF570E9BB97BACD5D3D37" />
|
||||
|
@ -1657,6 +2095,7 @@
|
|||
<ComponentRef Id="cmpD1FFC10879A7E53D48A22EEACFB20B99" />
|
||||
<ComponentRef Id="cmpBD0D767832F902CB7A4A57DBC3761E1E" />
|
||||
<ComponentRef Id="cmp0893D9E09B980CCC1BF6D135F3970613" />
|
||||
<ComponentRef Id="cmpDDE620440EB1F0EF86DB62FF00D53311" />
|
||||
<ComponentRef Id="cmp72AD64E6E7232E9E6A1F1E4C94BC1A8E" />
|
||||
<ComponentRef Id="cmpC582CC3171A287029A755EDB3AA356C2" />
|
||||
<ComponentRef Id="cmpB0094B3E1F7DF63DB03600042F8038C1" />
|
||||
|
@ -1701,9 +2140,6 @@
|
|||
<ComponentRef Id="cmp855703EFA2A131AD51B3A278DB9B705C" />
|
||||
<ComponentRef Id="cmp4EC3226B54BFE0FF4970968ABD1746E3" />
|
||||
<ComponentRef Id="cmp86A3FC330AB128431B87D9FC2A1D3109" />
|
||||
<ComponentRef Id="cmpFA26F6A2AEA6C463124B0DA5526DFA5B" />
|
||||
<ComponentRef Id="cmp3C5FF73C881AC1641C0A86BD49A82EF4" />
|
||||
<ComponentRef Id="cmp162CBF9B2A35CD117F17E98A30510A9E" />
|
||||
<ComponentRef Id="cmp1D87896B8DB222621598E697ABAF8676" />
|
||||
<ComponentRef Id="cmp69914982EC2B4590B0A7EB3CFBAB4E06" />
|
||||
<ComponentRef Id="cmpCE16EF6388EB7390B5991F43E5609278" />
|
||||
|
@ -1716,12 +2152,17 @@
|
|||
<ComponentRef Id="cmpB6773EA3F58057B9F419BA6DBF13CBED" />
|
||||
<ComponentRef Id="cmp01E003A3FA26FB81C6B89817FE7250BE" />
|
||||
<ComponentRef Id="cmp5E7A927FFF2CD1AC2D9A4D4746132F63" />
|
||||
<ComponentRef Id="cmpFE490B8321A94A3CE93E59ADF7BDC19F" />
|
||||
<ComponentRef Id="cmpD31EE6D7925E4DAECBC12F02B2C896AA" />
|
||||
<ComponentRef Id="cmpDFC157C3442E97BDF0570FFD8C7B977D" />
|
||||
<ComponentRef Id="cmp4BF22B003CB6023A1EABDD3AE357872E" />
|
||||
<ComponentRef Id="cmp51ECC6BA35E7D95A12F581DD08E66F64" />
|
||||
<ComponentRef Id="cmp28CB51C576059DF757256E5626E5A87F" />
|
||||
<ComponentRef Id="cmp75FC2B6D6C89E140FED596D2C4AB5D73" />
|
||||
<ComponentRef Id="cmp9BB704A34E478064B5AEA018BAE986CA" />
|
||||
<ComponentRef Id="cmp54514D36BA8821CF1149D4647C9F34BA" />
|
||||
<ComponentRef Id="cmp92D521CCBFF0A4064A70115D4DBE13C4" />
|
||||
<ComponentRef Id="cmp9DBA37B38077942A2856B006B0D29A0A" />
|
||||
<ComponentRef Id="cmp0C0FC77DAEF2A45138590D65DCDD21B8" />
|
||||
<ComponentRef Id="cmp5ACBDDEE7EBFF87A502B9FCF53520122" />
|
||||
<ComponentRef Id="cmpB496235CB74DCC1B3E4B9B0A4A99DB7E" />
|
||||
<ComponentRef Id="cmp958759CE2C3C0A31E905D81FB0A84070" />
|
||||
|
@ -1781,9 +2222,6 @@
|
|||
<ComponentRef Id="cmp48D635437A02076A25FC10E3123EEA84" />
|
||||
<ComponentRef Id="cmp83BF2BE446B53D1262934BEDEDCA0A49" />
|
||||
<ComponentRef Id="cmpAD0D6F02EBA3855DF8C31C7AC90E468C" />
|
||||
<ComponentRef Id="cmpDCDD0316B40A81BFB6A4B4E35EE34A5C" />
|
||||
<ComponentRef Id="cmp7C33F84612F27F4CC833F290D0A29C09" />
|
||||
<ComponentRef Id="cmp9C077BC01B4DF51DA54E6CD541F4CD62" />
|
||||
<ComponentRef Id="cmp9E90BD9AECEF01B2B4132041FE7AEB20" />
|
||||
<ComponentRef Id="cmp879BD0BC9A650B649F03FB5CB2BDAD35" />
|
||||
<ComponentRef Id="cmp610C6F4AE10BA5FCFF3E45DB2251D7DE" />
|
||||
|
@ -1800,7 +2238,6 @@
|
|||
<ComponentRef Id="cmpCCC5976D4AE7141FB6D3C6650AD0C40E" />
|
||||
<ComponentRef Id="cmp1D3D3FE8D3C4513B1536EB8B0AACEBE1" />
|
||||
<ComponentRef Id="cmpB0718E71D7A15CCA7375389A12F7D568" />
|
||||
<ComponentRef Id="cmpA25B169536D74A1BE4AC6D9FC02B3338" />
|
||||
<ComponentRef Id="cmp63E7146E10A0CADBB072FDBAAEC2FDB2" />
|
||||
<ComponentRef Id="cmpF2A2CF41D51D7B7599694EC16CFEB929" />
|
||||
<ComponentRef Id="cmpFC1978EF7F3366DA07E6556C3996E222" />
|
||||
|
@ -1832,8 +2269,12 @@
|
|||
<ComponentRef Id="cmpB47082650A3E15796EEFB9414EDA4945" />
|
||||
<ComponentRef Id="cmp8012F0215BB802A4015A5806B7E769F6" />
|
||||
<ComponentRef Id="cmpC110FE23081DF64903C0AE4A58BF2EE9" />
|
||||
<ComponentRef Id="cmpEA34C96EF8D15E8A5D7862D7C5F18361" />
|
||||
<ComponentRef Id="cmpFDE34E67D5969F5B0F8F5B3483E2B2B2" />
|
||||
<ComponentRef Id="cmp271EE413AA0CFA81047392C231D35019" />
|
||||
<ComponentRef Id="cmpE6F2C1F15F5A672D8597DA20C7FBBEE4" />
|
||||
<ComponentRef Id="cmp320445BFD6404D5395B37391FC5BD42A" />
|
||||
<ComponentRef Id="cmp64030D5B6C82DAF62B9FE5045B77700C" />
|
||||
<ComponentRef Id="cmp5525BBDC2AFA16BA65885B77260D8AC6" />
|
||||
<ComponentRef Id="cmp3B73CDB3665598A0F364C5C9F64897C5" />
|
||||
<ComponentRef Id="cmp01E6F666668B5C3F5A8C540ABB183964" />
|
||||
|
@ -1881,10 +2322,51 @@
|
|||
<ComponentRef Id="cmp55295A0B8E60D13D174BE7545CE6CC5F" />
|
||||
<ComponentRef Id="cmp7903310D9ED46439ADA5543A8B0ACF26" />
|
||||
<ComponentRef Id="cmp934EB819CA37436B5319766B852D644F" />
|
||||
<ComponentRef Id="cmp3C03B2095C2A69D5E6DCE437C5D2A690" />
|
||||
<ComponentRef Id="cmp3ECF10DC0D89D53F9C58C6794E6EABE8" />
|
||||
<ComponentRef Id="cmp58A842A5ABBE9598F160B1A7783AC260" />
|
||||
<ComponentRef Id="cmpFDA1F5A25A639A882EB28E3221AD7DE9" />
|
||||
<ComponentRef Id="cmp762B6053667CF7B9B230C8A1D24FA0D9" />
|
||||
<ComponentRef Id="cmpD7E60BF6560B41E428111B86E2877786" />
|
||||
<ComponentRef Id="cmp11075FC351A7A22ED9FF2DB465B744AE" />
|
||||
<ComponentRef Id="cmp512138D53CEF7A55CDC83F741D291561" />
|
||||
<ComponentRef Id="cmp99E6EFD6C5345F2027EF49DC01C8D7A2" />
|
||||
<ComponentRef Id="cmpF65876F380AC9BFC04EF7E0A83D9E2EA" />
|
||||
<ComponentRef Id="cmpE4AF0916E9D6C5168DB8918CDA69588A" />
|
||||
<ComponentRef Id="cmpAD101287B1EF8B771D333A9FF29C30C8" />
|
||||
<ComponentRef Id="cmp3B09B2514E3E788BBE5D44BC3022E8B1" />
|
||||
<ComponentRef Id="cmp1C992F609F0E3E895F924EB4DDA1872C" />
|
||||
<ComponentRef Id="cmp2DC40B144472AD010779DC6F0D263C32" />
|
||||
<ComponentRef Id="cmpD8BCF6F87A66E2BF3DA331CCDCE9525D" />
|
||||
<ComponentRef Id="cmpB382FB922425C1C446A732BD66BBEEE0" />
|
||||
<ComponentRef Id="cmp9C36EDC63632529B78C870EF3695F0D3" />
|
||||
<ComponentRef Id="cmp12C6E2ACC51F95C3303F6486917E8E75" />
|
||||
<ComponentRef Id="cmp87E83CA66DD51C9A6D61F1AC91FF683B" />
|
||||
<ComponentRef Id="cmpCC09A82900E1A278F48DB77993C40967" />
|
||||
<ComponentRef Id="cmpCA80C6C0F5670291AF2F3560D36B1EA3" />
|
||||
<ComponentRef Id="cmp1E1EACEE941A7D7B9B2649BB3AC9ABC3" />
|
||||
<ComponentRef Id="cmp6842A5697846B92CCF6ED50688A26C1A" />
|
||||
<ComponentRef Id="cmpEFBAA8731C08B69493F16C6511A3FBC8" />
|
||||
<ComponentRef Id="cmp4A98D12853680B70EA13B558FF5B66BE" />
|
||||
<ComponentRef Id="cmpFFEE4D9645AEA846AF41897FD2135E02" />
|
||||
<ComponentRef Id="cmp2F6E4C6B8006898EFE87C88921C1B6BA" />
|
||||
<ComponentRef Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" />
|
||||
<ComponentRef Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" />
|
||||
<ComponentRef Id="cmpBE209ED6509A7E857FD9F9078051DC6A" />
|
||||
<ComponentRef Id="cmpD7A9F76B2346156CA8F83F41A302B714" />
|
||||
<ComponentRef Id="cmp4D3E383B38EF4392E70E981B7CA033D7" />
|
||||
<ComponentRef Id="cmp439E7C155DEEFC3877653E4ED11F66AC" />
|
||||
<ComponentRef Id="cmp5278A11908DC26651A78E55522C71DF3" />
|
||||
<ComponentRef Id="cmp4ED39EDE761ED68263635882802FB1B5" />
|
||||
<ComponentRef Id="cmp2A0B3E88742D800F88F70A714BAC94B5" />
|
||||
<ComponentRef Id="cmp5F55270F607737A772BFBE2D8F6B76E4" />
|
||||
<ComponentRef Id="cmp9EF03D7C53CEE400751AD1905625B82B" />
|
||||
<ComponentRef Id="cmpC4F524A9EBF63DAC78B9678CF113D652" />
|
||||
<ComponentRef Id="cmp9BB01A9CE50D2F02F6CF08B68575CE63" />
|
||||
<ComponentRef Id="cmpFEC750EF6D159A3517BF9C8C75FF1754" />
|
||||
<ComponentRef Id="cmp074BBC4745C6E6F89A1963FD0621491A" />
|
||||
<ComponentRef Id="cmpD403CA2620FB13B02947597F523205AB" />
|
||||
<ComponentRef Id="cmpCC0508ADCA3E92A67914CBF93991F25B" />
|
||||
<ComponentRef Id="cmp5348A71B0B8AB94A5F1E9886459B2BB5" />
|
||||
<ComponentRef Id="cmp893FEE56B28C885AB3353AAF55D63AC2" />
|
||||
<ComponentRef Id="cmp7DE7895664CEA231D675C1AB05326146" />
|
||||
|
@ -2021,6 +2503,10 @@
|
|||
<ComponentRef Id="cmp65991ADC169007028A31A4F049E069EF" />
|
||||
<ComponentRef Id="cmp221C334CE6510BD95538F285D482251F" />
|
||||
<ComponentRef Id="cmp0E477FF2628135E33C31795B0116531C" />
|
||||
<ComponentRef Id="cmp7B389D27AE33BBC84F231F5C78BE0086" />
|
||||
<ComponentRef Id="cmp94673F5DFC53857EF6527E84FE8BD30A" />
|
||||
<ComponentRef Id="cmp0768A087ABCEC038FF46A989346CD0BD" />
|
||||
<ComponentRef Id="cmp478C52C713BC83A1D6EF6623C1F02E9F" />
|
||||
<ComponentRef Id="cmp8073B9AB5328ACDB45711FB0F9099B9E" />
|
||||
<ComponentRef Id="cmp55EA66AEDADDF121EA69ED386F2305D8" />
|
||||
<ComponentRef Id="cmpAB5C120DE3A82B09A13FD1F816D360E6" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
||||
|
|
|
@ -35,7 +35,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement"
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Test", "ServiceManagement\Compute\Commands.ServiceManagement.Test\Commands.ServiceManagement.Test.csproj", "{58A78F29-8C0C-4A5E-893E-3953C0F29C8A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21} = {98B10548-DF97-4FB1-8D82-2A12945D4F21}
|
||||
{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A} = {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4} = {40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {FDB897BD-FCB4-44A1-8D66-AC99F22EC737}
|
||||
{E895BBDA-0B06-46AB-B909-9B97B3ECE47E} = {E895BBDA-0B06-46AB-B909-9B97B3ECE47E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -75,6 +78,9 @@ EndProject
|
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "ResourceManager\Resources\Commands.Resources\Commands.Resources.csproj", "{E1F5201D-6067-430E-B303-4E367652991B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Test", "ResourceManager\Resources\Commands.Resources.Test\Commands.Resources.Test.csproj", "{4C2FE49A-09E1-4979-AD46-CD64FD04C8F7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{D470E50A-9607-48D6-A924-4F9F86502704} = {D470E50A-9607-48D6-A924-4F9F86502704}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager", "ServiceManagement\TrafficManager\Commands.TrafficManager\Commands.TrafficManager.csproj", "{94E96A5C-B5AD-4E10-B13A-3BC16D102AED}"
|
||||
EndProject
|
||||
|
@ -101,6 +107,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Comm
|
|||
{CD5AA507-F5EF-473D-855B-84B91A1ABE54} = {CD5AA507-F5EF-473D-855B-84B91A1ABE54}
|
||||
{E1F5201D-6067-430E-B303-4E367652991B} = {E1F5201D-6067-430E-B303-4E367652991B}
|
||||
{DDF5D225-C9C5-42B7-BDB5-2C3646E479AA} = {DDF5D225-C9C5-42B7-BDB5-2C3646E479AA}
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21} = {98B10548-DF97-4FB1-8D82-2A12945D4F21}
|
||||
{137D404A-865A-43DB-930C-6DA67DA048DF} = {137D404A-865A-43DB-930C-6DA67DA048DF}
|
||||
{4900EC4E-8DEB-4412-9108-0BC52F81D457} = {4900EC4E-8DEB-4412-9108-0BC52F81D457}
|
||||
{94E96A5C-B5AD-4E10-B13A-3BC16D102AED} = {94E96A5C-B5AD-4E10-B13A-3BC16D102AED}
|
||||
|
@ -109,12 +116,37 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Comm
|
|||
{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A} = {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}
|
||||
{C60342B1-47D3-4A0E-8081-9B97CE60B7AF} = {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}
|
||||
{E1CA72BA-8374-45F6-904D-FD34ECDF5B6F} = {E1CA72BA-8374-45F6-904D-FD34ECDF5B6F}
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4} = {40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}
|
||||
{46C06ED8-43D9-41FD-B73B-41547D9C04E1} = {46C06ED8-43D9-41FD-B73B-41547D9C04E1}
|
||||
{2493A8F7-1949-4F29-8D53-9D459046C3B8} = {2493A8F7-1949-4F29-8D53-9D459046C3B8}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Sql", "ResourceManager\Sql\Commands.Sql\Commands.Sql.csproj", "{69ED499E-6F3C-488F-86B8-B74CFDA4D47E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.DataFactories", "ResourceManager\DataFactories\Commands.DataFactories\Commands.DataFactories.csproj", "{9577252E-0A6B-4D61-86E8-95F7F309A987}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.DataFactories.Test", "ResourceManager\DataFactories\Commands.DataFactories.Test\Commands.DataFactories.Test.csproj", "{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Sql.Test", "ResourceManager\Sql\Commands.Sql.Test\Commands.Sql.Test.csproj", "{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Extensions.Test", "ServiceManagement\Compute\Commands.ServiceManagement.Extensions.Test\Commands.ServiceManagement.Extensions.Test.csproj", "{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RedisCache", "ResourceManager\RedisCache\Commands.RedisCache\Commands.RedisCache.csproj", "{C972E3EF-4461-4758-BA31-93E0947B1253}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RedisCache.Test", "ResourceManager\RedisCache\Commands.RedisCache.Test\Commands.RedisCache.Test.csproj", "{4AE5705F-62CF-461D-B72E-DD9DCD9B3609}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Batch", "ResourceManager\Batch\Commands.Batch\Commands.Batch.csproj", "{D470E50A-9607-48D6-A924-4F9F86502704}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Batch.Test", "ResourceManager\Batch\Commands.Batch.Test\Commands.Batch.Test.csproj", "{F4ABAD68-64A5-4B23-B09C-42559A7524DE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "ServiceManagement\Network\Commands.Network\Commands.Network.csproj", "{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices", "ServiceManagement\RecoveryServices\Commands.RecoveryServices\Commands.RecoveryServices.csproj", "{98B10548-DF97-4FB1-8D82-2A12945D4F21}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices.Test", "ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\Commands.RecoveryServices.Test.csproj", "{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -269,6 +301,54 @@ Global
|
|||
{69ED499E-6F3C-488F-86B8-B74CFDA4D47E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69ED499E-6F3C-488F-86B8-B74CFDA4D47E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69ED499E-6F3C-488F-86B8-B74CFDA4D47E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9577252E-0A6B-4D61-86E8-95F7F309A987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9577252E-0A6B-4D61-86E8-95F7F309A987}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9577252E-0A6B-4D61-86E8-95F7F309A987}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9577252E-0A6B-4D61-86E8-95F7F309A987}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C972E3EF-4461-4758-BA31-93E0947B1253}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C972E3EF-4461-4758-BA31-93E0947B1253}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C972E3EF-4461-4758-BA31-93E0947B1253}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C972E3EF-4461-4758-BA31-93E0947B1253}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4AE5705F-62CF-461D-B72E-DD9DCD9B3609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4AE5705F-62CF-461D-B72E-DD9DCD9B3609}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4AE5705F-62CF-461D-B72E-DD9DCD9B3609}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AE5705F-62CF-461D-B72E-DD9DCD9B3609}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D470E50A-9607-48D6-A924-4F9F86502704}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D470E50A-9607-48D6-A924-4F9F86502704}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D470E50A-9607-48D6-A924-4F9F86502704}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D470E50A-9607-48D6-A924-4F9F86502704}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -291,5 +371,12 @@ Global
|
|||
{84F99CBD-5B86-4428-B263-135B2F67F512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{7E8D2555-2DDD-4757-974F-D5FFD0647671} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{C1BDA476-A5CC-4394-914D-48B0EC31A710} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{7A9D7758-A1AB-4BE8-BD09-3FAF446314F2} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{4AE5705F-62CF-461D-B72E-DD9DCD9B3609} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{F4ABAD68-64A5-4B23-B09C-42559A7524DE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -69,20 +69,20 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.2.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -97,13 +97,13 @@
|
|||
<Reference Include="System.Data.Services.Client" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
|
|
@ -14,17 +14,31 @@ namespace Microsoft.WindowsAzure.Commands.Common.Storage
|
|||
var storageKeysResponse = storageClient.StorageAccounts.GetKeys(accountName);
|
||||
|
||||
Uri fileEndpoint = null;
|
||||
Uri blobEndpoint = null;
|
||||
Uri queueEndpoint = null;
|
||||
Uri tableEndpoint = null;
|
||||
|
||||
if (storageServiceResponse.StorageAccount.Properties.Endpoints.Count >= 4)
|
||||
{
|
||||
fileEndpoint = GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[3].ToString());
|
||||
}
|
||||
|
||||
if (storageServiceResponse.StorageAccount.Properties.Endpoints.Count >= 3)
|
||||
{
|
||||
tableEndpoint = GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[2].ToString());
|
||||
queueEndpoint = GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[1].ToString());
|
||||
}
|
||||
|
||||
if (storageServiceResponse.StorageAccount.Properties.Endpoints.Count >= 1)
|
||||
{
|
||||
blobEndpoint = GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[0].ToString());
|
||||
}
|
||||
|
||||
return new CloudStorageAccount(
|
||||
new StorageCredentials(storageServiceResponse.StorageAccount.Name, storageKeysResponse.PrimaryKey),
|
||||
GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[0].ToString()),
|
||||
GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[1].ToString()),
|
||||
GeneralUtilities.CreateHttpsEndpoint(storageServiceResponse.StorageAccount.Properties.Endpoints[2].ToString()),
|
||||
blobEndpoint,
|
||||
queueEndpoint,
|
||||
tableEndpoint,
|
||||
fileEndpoint);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,19 +33,10 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return null;
|
||||
}
|
||||
|
||||
if (storageAccountCache.ContainsKey(subscription.Id))
|
||||
using (var storageClient = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(subscription, AzureEnvironment.Endpoint.ServiceManagement))
|
||||
{
|
||||
return storageAccountCache[subscription.Id];
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var storageClient = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(subscription, AzureEnvironment.Endpoint.ServiceManagement))
|
||||
{
|
||||
storageAccountCache[subscription.Id] = StorageUtilities.GenerateCloudStorageAccount(
|
||||
storageClient, subscription.GetProperty(AzureSubscription.Property.StorageAccount));
|
||||
|
||||
return storageAccountCache[subscription.Id];
|
||||
}
|
||||
return StorageUtilities.GenerateCloudStorageAccount(
|
||||
storageClient, subscription.GetProperty(AzureSubscription.Property.StorageAccount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.4.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Storage" version="2.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
|
||||
<package id="WindowsAzure.Storage" version="4.0.0" targetFramework="net45" />
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Utilities.HttpRecorder">
|
||||
<Reference Include="Microsoft.Azure.Utilities.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Hydra.HttpRecorder.1.0.5359.24167-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll</HintPath>
|
||||
<HintPath>..\..\packages\Hydra.HttpRecorder.1.0.5406.28672-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
|
@ -66,13 +66,13 @@
|
|||
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -87,26 +87,28 @@
|
|||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.WindowsAzure.Common">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.1.3.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.WindowsAzure.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.4.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.2.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -126,13 +128,13 @@
|
|||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
@ -150,10 +152,13 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Common\AuthenticationFactoryTests.cs" />
|
||||
<Compile Include="Common\ProfileCmdltsTests.cs" />
|
||||
<Compile Include="Common\ProfileClientTests.cs" />
|
||||
<Compile Include="Common\ServicePrincipalStoreTests.cs" />
|
||||
<Compile Include="Mocks\MockAuthenticationFactory.cs" />
|
||||
<Compile Include="Mocks\MockAccessTokenProvider.cs" />
|
||||
<Compile Include="Mocks\MockTokenAuthenticationFactory.cs" />
|
||||
<Compile Include="Mocks\MockCertificateAuthenticationFactory.cs" />
|
||||
<Compile Include="Mocks\ClientMocks.cs" />
|
||||
<Compile Include="Common\GeneralUtilitiesTests.cs" />
|
||||
<Compile Include="Common\Data.cs" />
|
||||
|
@ -166,7 +171,6 @@
|
|||
<Compile Include="Mocks\MockDataStore.cs" />
|
||||
<Compile Include="Mocks\MockClientFactory.cs" />
|
||||
<Compile Include="Mocks\MockAccessToken.cs" />
|
||||
<Compile Include="Mocks\MockStorageService.cs" />
|
||||
<Compile Include="Common\PSObjectExtensions.cs" />
|
||||
<Compile Include="Common\RemoveAzurePublishSettings.cs" />
|
||||
<Compile Include="Common\SimpleServiceManagementAsyncResult.cs" />
|
||||
|
@ -174,7 +178,6 @@
|
|||
<Compile Include="Common\ConversionUtilitiesTests.cs" />
|
||||
<Compile Include="Common\Testing.cs" />
|
||||
<Compile Include="Common\TestingTracingInterceptor.cs" />
|
||||
<Compile Include="Factories\TestAuthenticationFactory.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Xunit;
|
||||
using System;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Factories;
|
||||
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
||||
{
|
||||
public class AuthenticationFactoryTests
|
||||
{
|
||||
[Fact]
|
||||
public void VerifySubscriptionTokenCacheRemove()
|
||||
{
|
||||
var authFactory = new AuthenticationFactory
|
||||
{
|
||||
TokenProvider = new MockAccessTokenProvider("testtoken", "testuser")
|
||||
};
|
||||
|
||||
var subscriptionId = Guid.NewGuid();
|
||||
|
||||
var credential = authFactory.GetSubscriptionCloudCredentials(new Models.AzureContext
|
||||
{
|
||||
Environment = AzureEnvironment.PublicEnvironments["AzureCloud"],
|
||||
Account = new AzureAccount
|
||||
{
|
||||
Id = "testuser",
|
||||
Type = AzureAccount.AccountType.User,
|
||||
Properties = new Dictionary<AzureAccount.Property, string>
|
||||
{
|
||||
{ AzureAccount.Property.Tenants, "123" }
|
||||
}
|
||||
},
|
||||
Subscription = new AzureSubscription
|
||||
{
|
||||
Id = subscriptionId,
|
||||
Properties = new Dictionary<AzureSubscription.Property, string>
|
||||
{
|
||||
{ AzureSubscription.Property.Tenants, "123"}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Assert.True(credential is AccessTokenCredential);
|
||||
Assert.Equal(subscriptionId, new Guid(((AccessTokenCredential)credential).SubscriptionId));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,9 +61,6 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
|
|||
public static string NodeWorkerRoleScaffoldingPath = Path.Combine(Resources.NodeScaffolding, RoleType.WorkerRole.ToString());
|
||||
public static string PHPWebRoleScaffoldingPath = Path.Combine(Resources.PHPScaffolding, RoleType.WebRole.ToString());
|
||||
public static string PHPWorkerRoleScaffoldingPath = Path.Combine(Resources.PHPScaffolding, RoleType.WorkerRole.ToString());
|
||||
public static string PythonWebRoleScaffoldingPath = Path.Combine(Resources.PythonScaffolding, RoleType.WebRole.ToString());
|
||||
public static string GeneralWebRoleScaffoldingPath = Path.Combine(Resources.GeneralScaffolding, RoleType.WebRole.ToString());
|
||||
public static string GeneralWorkerRoleScaffoldingPath = Path.Combine(Resources.GeneralScaffolding, RoleType.WorkerRole.ToString());
|
||||
|
||||
static Data()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
|
||||
using Microsoft.WindowsAzure.Commands.Profile;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
using Xunit;
|
||||
|
@ -27,8 +28,13 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
public class ProfileClientTests
|
||||
{
|
||||
private string oldProfileData;
|
||||
private string oldProfileDataBadSubscription;
|
||||
private string oldProfileDataCorruptedFile;
|
||||
private string oldProfileDataPath;
|
||||
private string oldProfileDataPathError;
|
||||
private string newProfileDataPath;
|
||||
private string jsonProfileWithoutAccount;
|
||||
private string jsonProfileWithBadData;
|
||||
private string defaultSubscription = "06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F";
|
||||
private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription1;
|
||||
private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription2;
|
||||
|
@ -141,6 +147,108 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
Assert.Equal(2, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].GetPropertyAsArray(AzureAccount.Property.Subscriptions).Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ProfileMigratesAccountsSkipsBadOnesAndBacksUpFile()
|
||||
{
|
||||
MockDataStore dataStore = new MockDataStore();
|
||||
dataStore.VirtualStore[oldProfileDataPath] = oldProfileDataBadSubscription;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
|
||||
// Verify Environment migration
|
||||
Assert.Equal(2, client.Profile.Environments.Count);
|
||||
|
||||
// Verify subscriptions
|
||||
Assert.Equal(3, client.Profile.Subscriptions.Count);
|
||||
Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")));
|
||||
Assert.Equal("Test Bad Management Endpoint", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Name);
|
||||
Assert.Equal(EnvironmentName.AzureCloud, client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Environment);
|
||||
Assert.Equal("Test Null Management Endpoint", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF")].Name);
|
||||
Assert.Equal(EnvironmentName.AzureCloud, client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF")].Environment);
|
||||
|
||||
Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")));
|
||||
Assert.Equal("Test Bad Cert", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Name);
|
||||
|
||||
// Verify accounts
|
||||
Assert.Equal(2, client.Profile.Accounts.Count);
|
||||
Assert.Equal("test@mail.com", client.Profile.Accounts["test@mail.com"].Id);
|
||||
Assert.Equal(AzureAccount.AccountType.User, client.Profile.Accounts["test@mail.com"].Type);
|
||||
Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
|
||||
.Contains(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F").ToString()));
|
||||
Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
|
||||
.Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
|
||||
Assert.True(client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
|
||||
.Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
|
||||
Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
|
||||
.Contains("72f988bf-86f1-41af-91ab-2d7cd011db47"));
|
||||
Assert.False(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
|
||||
.Contains("123"));
|
||||
Assert.Equal("3AF24D48B97730E5C4C9CCB12397B5E046F79E99", client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].Id);
|
||||
Assert.Equal(AzureAccount.AccountType.Certificate, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].Type);
|
||||
Assert.Equal(0, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Tenants).Length);
|
||||
Assert.Equal(1, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Subscriptions).Length);
|
||||
|
||||
// Verify backup file
|
||||
Assert.True(dataStore.FileExists(oldProfileDataPathError));
|
||||
Assert.False(dataStore.FileExists(oldProfileDataPath));
|
||||
Assert.Equal(oldProfileDataBadSubscription, dataStore.ReadFileAsText(oldProfileDataPathError));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ProfileMigratesCorruptedFileAndCreatedBackup()
|
||||
{
|
||||
MockDataStore dataStore = new MockDataStore();
|
||||
dataStore.VirtualStore[oldProfileDataPath] = oldProfileDataCorruptedFile;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
|
||||
// Verify Environment migration
|
||||
Assert.Equal(2, client.Profile.Environments.Count);
|
||||
|
||||
// Verify subscriptions
|
||||
Assert.Equal(0, client.Profile.Subscriptions.Count);
|
||||
|
||||
// Verify accounts
|
||||
Assert.Equal(0, client.Profile.Accounts.Count);
|
||||
|
||||
// Verify backup file
|
||||
Assert.True(dataStore.FileExists(oldProfileDataPathError));
|
||||
Assert.False(dataStore.FileExists(oldProfileDataPath));
|
||||
Assert.Equal(oldProfileDataCorruptedFile, dataStore.ReadFileAsText(oldProfileDataPathError));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CmdletStartsWithCorruptedJson()
|
||||
{
|
||||
MockDataStore dataStore = new MockDataStore();
|
||||
dataStore.VirtualStore[newProfileDataPath] = jsonProfileWithBadData;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
|
||||
GetAzureSubscriptionCommand cmdlt = new GetAzureSubscriptionCommand();
|
||||
|
||||
ProfileClient client = new ProfileClient();
|
||||
|
||||
Assert.Equal(0, client.Profile.Subscriptions.Count);
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
Assert.Null(AzureSession.CurrentContext.Account);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CmdletStartsWithJsonWithoutAccounts()
|
||||
{
|
||||
MockDataStore dataStore = new MockDataStore();
|
||||
dataStore.VirtualStore[newProfileDataPath] = jsonProfileWithoutAccount;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
|
||||
GetAzureSubscriptionCommand cmdlt = new GetAzureSubscriptionCommand();
|
||||
|
||||
ProfileClient client = new ProfileClient();
|
||||
|
||||
Assert.Equal(1, client.Profile.Subscriptions.Count);
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
Assert.Null(AzureSession.CurrentContext.Account);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddAzureAccountReturnsAccountWithAllSubscriptionsInRdfeMode()
|
||||
{
|
||||
|
@ -149,7 +257,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureServiceManagement;
|
||||
|
||||
var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[ EnvironmentName.AzureCloud], null);
|
||||
|
||||
|
@ -168,7 +275,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
|
||||
|
||||
|
@ -190,7 +296,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
var account = client.ListAccounts("test").ToList();
|
||||
|
||||
|
@ -212,7 +317,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
var account = client.ListAccounts("test").ToList();
|
||||
|
||||
|
@ -234,7 +338,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
var account = client.ListAccounts("test2").ToList();
|
||||
|
||||
|
@ -262,7 +365,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
};
|
||||
client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
|
||||
client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
var account = client.ListAccounts(null).ToList();
|
||||
|
||||
|
@ -290,7 +392,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
};
|
||||
client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
|
||||
client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
List<string> log = new List<string>();
|
||||
client.WarningLog = log.Add;
|
||||
|
||||
|
@ -650,7 +751,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
MockDataStore dataStore = new MockDataStore();
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
|
@ -670,7 +770,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
MockDataStore dataStore = new MockDataStore();
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
|
@ -693,7 +792,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
MockDataStore dataStore = new MockDataStore();
|
||||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
|
||||
client.Profile.Accounts[azureAccount.Id] = azureAccount;
|
||||
|
||||
|
@ -716,7 +814,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
client.AddOrSetAccount(azureAccount);
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureServiceManagement;
|
||||
|
||||
var subscriptions = client.RefreshSubscriptions(azureEnvironment);
|
||||
|
||||
|
@ -736,7 +833,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
client.AddOrSetAccount(azureAccount);
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
client.AddOrSetSubscription(azureSubscription2);
|
||||
|
@ -755,7 +851,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
ProfileClient.DataStore = dataStore;
|
||||
ProfileClient client = new ProfileClient();
|
||||
client.AddOrSetAccount(azureAccount);
|
||||
PowerShellUtilities.GetCurrentModeOverride = () => AzureModule.AzureResourceManager;
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
client.AddOrSetSubscription(azureSubscription2);
|
||||
|
@ -1032,7 +1127,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
AzureSession.ClientFactory = new MockClientFactory(new object[] { clientMocks.RdfeSubscriptionClientMock.Object,
|
||||
clientMocks.CsmSubscriptionClientMock.Object });
|
||||
|
||||
AzureSession.AuthenticationFactory = new MockAuthenticationFactory();
|
||||
AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory();
|
||||
}
|
||||
|
||||
private void SetMockData()
|
||||
|
@ -1120,6 +1215,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
};
|
||||
newProfileDataPath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.ProfileFile);
|
||||
oldProfileDataPath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFile);
|
||||
oldProfileDataPathError = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFileBackup);
|
||||
oldProfileData = @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<ProfileData xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.Commands.Utilities.Common"">
|
||||
<DefaultEnvironmentName>AzureCloud</DefaultEnvironmentName>
|
||||
|
@ -1228,6 +1324,145 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
</AzureSubscriptionData>
|
||||
</Subscriptions>
|
||||
</ProfileData>";
|
||||
|
||||
oldProfileDataBadSubscription = @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<ProfileData xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.Commands.Utilities.Common"">
|
||||
<DefaultEnvironmentName>AzureCloud</DefaultEnvironmentName>
|
||||
<Environments>
|
||||
</Environments>
|
||||
<Subscriptions>
|
||||
<AzureSubscriptionData>
|
||||
<ActiveDirectoryEndpoint i:nil=""true"" />
|
||||
<ActiveDirectoryServiceEndpointResourceId i:nil=""true"" />
|
||||
<ActiveDirectoryTenantId i:nil=""true"" />
|
||||
<ActiveDirectoryUserId i:nil=""true"" />
|
||||
<CloudStorageAccount i:nil=""true"" />
|
||||
<GalleryEndpoint i:nil=""true"" />
|
||||
<IsDefault>true</IsDefault>
|
||||
<LoginType i:nil=""true"" />
|
||||
<ManagementCertificate i:nil=""true""/>
|
||||
<ManagementEndpoint>https://management.core.windows.net/</ManagementEndpoint>
|
||||
<Name>Test Nill ID</Name>
|
||||
<RegisteredResourceProviders xmlns:d4p1=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"" />
|
||||
<ResourceManagerEndpoint i:nil=""true"" />
|
||||
<SqlDatabaseDnsSuffix>.database.windows.net</SqlDatabaseDnsSuffix>
|
||||
<SubscriptionId i:nil=""true"" />
|
||||
<TrafficManagerDnsSuffix>trafficmanager.net</TrafficManagerDnsSuffix>
|
||||
</AzureSubscriptionData>
|
||||
<AzureSubscriptionData>
|
||||
<ActiveDirectoryEndpoint i:nil=""true"" />
|
||||
<ActiveDirectoryServiceEndpointResourceId i:nil=""true"" />
|
||||
<ActiveDirectoryTenantId i:nil=""true"" />
|
||||
<ActiveDirectoryUserId>test@mail.com</ActiveDirectoryUserId>
|
||||
<CloudStorageAccount i:nil=""true"" />
|
||||
<GalleryEndpoint i:nil=""true"" />
|
||||
<IsDefault>true</IsDefault>
|
||||
<LoginType i:nil=""true"" />
|
||||
<ManagementCertificate i:nil=""true""/>
|
||||
<ManagementEndpoint>Bad Data</ManagementEndpoint>
|
||||
<Name>Test Bad Management Endpoint</Name>
|
||||
<RegisteredResourceProviders xmlns:d4p1=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"" />
|
||||
<ResourceManagerEndpoint i:nil=""true"" />
|
||||
<SqlDatabaseDnsSuffix>.database.windows.net</SqlDatabaseDnsSuffix>
|
||||
<SubscriptionId>06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F</SubscriptionId>
|
||||
<TrafficManagerDnsSuffix>trafficmanager.net</TrafficManagerDnsSuffix>
|
||||
</AzureSubscriptionData>
|
||||
<AzureSubscriptionData>
|
||||
<ActiveDirectoryEndpoint i:nil=""true"" />
|
||||
<ActiveDirectoryServiceEndpointResourceId i:nil=""true"" />
|
||||
<ActiveDirectoryTenantId i:nil=""true"" />
|
||||
<ActiveDirectoryUserId>test@mail.com</ActiveDirectoryUserId>
|
||||
<CloudStorageAccount i:nil=""true"" />
|
||||
<GalleryEndpoint i:nil=""true"" />
|
||||
<IsDefault>true</IsDefault>
|
||||
<LoginType i:nil=""true"" />
|
||||
<ManagementCertificate i:nil=""true""/>
|
||||
<ManagementEndpoint i:nil=""true""/>
|
||||
<Name>Test Null Management Endpoint</Name>
|
||||
<RegisteredResourceProviders xmlns:d4p1=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"" />
|
||||
<ResourceManagerEndpoint i:nil=""true"" />
|
||||
<SqlDatabaseDnsSuffix>.database.windows.net</SqlDatabaseDnsSuffix>
|
||||
<SubscriptionId>06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF</SubscriptionId>
|
||||
<TrafficManagerDnsSuffix>trafficmanager.net</TrafficManagerDnsSuffix>
|
||||
</AzureSubscriptionData>
|
||||
<AzureSubscriptionData>
|
||||
<ActiveDirectoryEndpoint>https://login.windows.net/</ActiveDirectoryEndpoint>
|
||||
<ActiveDirectoryServiceEndpointResourceId>https://management.core.windows.net/</ActiveDirectoryServiceEndpointResourceId>
|
||||
<ActiveDirectoryTenantId>72f988bf-86f1-41af-91ab-2d7cd011db47</ActiveDirectoryTenantId>
|
||||
<ActiveDirectoryUserId>test@mail.com</ActiveDirectoryUserId>
|
||||
<CloudStorageAccount i:nil=""true"" />
|
||||
<GalleryEndpoint i:nil=""true"" />
|
||||
<IsDefault>false</IsDefault>
|
||||
<LoginType i:nil=""true"" />
|
||||
<ManagementCertificate>3AF24D48B97730E5C4C9CCB12397B5E046F79E99</ManagementCertificate>
|
||||
<ManagementEndpoint>https://management.core.windows.net/</ManagementEndpoint>
|
||||
<Name>Test Bad Cert</Name>
|
||||
<RegisteredResourceProviders xmlns:d4p1=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"" />
|
||||
<ResourceManagerEndpoint i:nil=""true"" />
|
||||
<SqlDatabaseDnsSuffix>.database.windows.net</SqlDatabaseDnsSuffix>
|
||||
<SubscriptionId>d1e52cbc-b073-42e2-a0a0-c2f547118a6f</SubscriptionId>
|
||||
<TrafficManagerDnsSuffix>trafficmanager.net</TrafficManagerDnsSuffix>
|
||||
</AzureSubscriptionData>
|
||||
</Subscriptions>
|
||||
</ProfileData>";
|
||||
|
||||
oldProfileDataCorruptedFile = @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<ProfileData xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.Commands.Utilities.Common"">
|
||||
<DefaultEnvironmentName>AzureCloud</DefaultEnvironmentName>
|
||||
<Environments bad>
|
||||
<AzureEnvironmentData>
|
||||
<ActiveDirectoryServiceEndpointResourceId>https://management.core.windows.net/</ActiveDirectoryServiceEndpointResourceId>
|
||||
<AdTenantUrl>https://login.windows-ppe.net/</AdTenantUrl>
|
||||
<CommonTenantId>Common</CommonTenantId>
|
||||
<GalleryEndpoint>https://current.gallery.azure-test.net</GalleryEndpoint>
|
||||
<ManagementPortalUrl>http://go.microsoft.com/fwlink/?LinkId=254433</ManagementPortalUrl>
|
||||
<Name>Current</Name>
|
||||
<PublishSettingsFileUrl>d:\Code\azure.publishsettings</PublishSettingsFileUrl>
|
||||
<ResourceManagerEndpoint>https://api-current.resources.windows-int.net/</ResourceManagerEndpoint>
|
||||
<ServiceEndpoint>https://umapi.rdfetest.dnsdemo4.com:8443/</ServiceEndpoint>
|
||||
<SqlDatabaseDnsSuffix>.database.windows.net</SqlDatabaseDnsSuffix>
|
||||
<StorageEndpointSuffix i:nil=""true"" />
|
||||
<TrafficManagerDnsSuffix>trafficmanager.net</TrafficManagerDnsSuffix>
|
||||
</AzureEnvironmentData>
|
||||
<Subscriptions>
|
||||
</Subscriptions>
|
||||
</ProfileData>";
|
||||
|
||||
jsonProfileWithoutAccount = @"{
|
||||
""Environments"": [],
|
||||
""Subscriptions"": [
|
||||
{
|
||||
""Id"": ""7e11f45f-70e6-430a-a4fc-af338aa22c11"",
|
||||
""Name"": ""Test"",
|
||||
""Environment"": ""AzureCloud"",
|
||||
""Account"": ""test@mail.com"",
|
||||
""Properties"": {
|
||||
""SupportedModes"": ""AzureServiceManagement"",
|
||||
""Default"": ""True"",
|
||||
""StorageAccount"": ""rjfmmanagement""
|
||||
}
|
||||
}
|
||||
],
|
||||
""Accounts"": []
|
||||
}";
|
||||
|
||||
jsonProfileWithBadData = @"{
|
||||
""Environments"": [],
|
||||
""Subscriptions"": {
|
||||
{
|
||||
""Id"": ""7e11f45f-70e6-430a-a4fc-af338aa22c11"",
|
||||
""Name"": ""Test"",
|
||||
""Environment"": ""AzureCloud"",
|
||||
""Account"": ""test@mail.com"",
|
||||
""Properties"": {
|
||||
""SupportedModes"": ""AzureServiceManagement"",
|
||||
""Default"": ""True"",
|
||||
""StorageAccount"": ""rjfmmanagement""
|
||||
}
|
||||
}
|
||||
],
|
||||
""Accounts"": []
|
||||
}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,8 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
{
|
||||
public class ProfileCmdltsTests
|
||||
{
|
||||
private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription1;
|
||||
private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription2;
|
||||
private Azure.Subscriptions.Models.Subscription csmSubscription1;
|
||||
private Azure.Subscriptions.Models.Subscription csmSubscription1withDuplicateId;
|
||||
private Azure.Subscriptions.Models.Subscription csmSubscription2;
|
||||
private AzureSubscription azureSubscription1;
|
||||
private AzureSubscription azureSubscription2;
|
||||
private AzureSubscription azureSubscription3withoutUser;
|
||||
private AzureEnvironment azureEnvironment;
|
||||
private AzureAccount azureAccount;
|
||||
private Mock<ICommandRuntime> commandRuntimeMock;
|
||||
|
@ -365,43 +359,193 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectDefaultAzureSubscriptionByNameUpdatesProfile()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
var client = SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectDefaultSubscriptionByNameParameterSet");
|
||||
cmdlt.SubscriptionName = azureSubscription2.Name;
|
||||
cmdlt.Default = new SwitchParameter(true);
|
||||
Assert.NotEqual(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
client = new ProfileClient();
|
||||
Assert.NotNull(client.Profile.DefaultSubscription);
|
||||
Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectAzureSubscriptionByNameUpdatesProfile()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
|
||||
cmdlt.SubscriptionName = azureSubscription2.Name;
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
Assert.NotNull(AzureSession.CurrentContext.Subscription);
|
||||
Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
|
||||
}
|
||||
[Fact]
|
||||
public void SelectDefaultAzureSubscriptionByIdAndNoDefaultUpdatesProfile()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
var client = SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectDefaultSubscriptionByIdParameterSet");
|
||||
cmdlt.SubscriptionId = azureSubscription2.Id.ToString();
|
||||
cmdlt.Default = new SwitchParameter(true);
|
||||
Assert.NotEqual(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
client = new ProfileClient();
|
||||
Assert.NotNull(client.Profile.DefaultSubscription);
|
||||
Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
|
||||
|
||||
cmdlt = new SelectAzureSubscriptionCommand();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("NoDefaultSubscriptionParameterSet");
|
||||
cmdlt.NoDefault = new SwitchParameter(true);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
client = new ProfileClient();
|
||||
Assert.Null(client.Profile.DefaultSubscription);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectAzureSubscriptionByIdAndNoCurrentUpdatesProfile()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
|
||||
cmdlt.SubscriptionId = azureSubscription2.Id.ToString();
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
Assert.NotNull(AzureSession.CurrentContext.Subscription);
|
||||
Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
|
||||
|
||||
cmdlt = new SelectAzureSubscriptionCommand();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("NoCurrentSubscriptionParameterSet");
|
||||
cmdlt.NoCurrent = new SwitchParameter(true);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
cmdlt.ExecuteCmdlet();
|
||||
cmdlt.InvokeEndProcessing();
|
||||
|
||||
// Verify
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectAzureSubscriptionByInvalidIdThrowsException()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
|
||||
string invalidGuid = Guid.NewGuid().ToString();
|
||||
cmdlt.SubscriptionId = invalidGuid;
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
try
|
||||
{
|
||||
cmdlt.ExecuteCmdlet();
|
||||
Assert.True(false);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Assert.Contains(string.Format(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.InvalidSubscriptionId, invalidGuid), ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectAzureSubscriptionByInvalidGuidThrowsException()
|
||||
{
|
||||
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
|
||||
SetupDefaultProfile();
|
||||
|
||||
// Setup
|
||||
cmdlt.CommandRuntime = commandRuntimeMock.Object;
|
||||
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
|
||||
string invalidGuid = "foo";
|
||||
cmdlt.SubscriptionId = invalidGuid;
|
||||
Assert.Null(AzureSession.CurrentContext.Subscription);
|
||||
|
||||
// Act
|
||||
cmdlt.InvokeBeginProcessing();
|
||||
try
|
||||
{
|
||||
cmdlt.ExecuteCmdlet();
|
||||
Assert.True(false);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Assert.Contains(string.Format(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.InvalidGuid, invalidGuid), ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private ProfileClient SetupDefaultProfile()
|
||||
{
|
||||
ProfileClient client = new ProfileClient();
|
||||
client.AddOrSetEnvironment(azureEnvironment);
|
||||
client.AddOrSetAccount(azureAccount);
|
||||
client.AddOrSetSubscription(azureSubscription1);
|
||||
client.AddOrSetSubscription(azureSubscription2);
|
||||
client.Profile.Save();
|
||||
return client;
|
||||
}
|
||||
|
||||
private void SetMockData()
|
||||
{
|
||||
rdfeSubscription1 = new Subscriptions.Models.SubscriptionListOperationResponse.Subscription
|
||||
{
|
||||
SubscriptionId = "16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
|
||||
SubscriptionName = "RdfeSub1",
|
||||
SubscriptionStatus = Subscriptions.Models.SubscriptionStatus.Active,
|
||||
ActiveDirectoryTenantId = "Common"
|
||||
};
|
||||
rdfeSubscription2 = new Subscriptions.Models.SubscriptionListOperationResponse.Subscription
|
||||
{
|
||||
SubscriptionId = "26E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
|
||||
SubscriptionName = "RdfeSub2",
|
||||
SubscriptionStatus = Subscriptions.Models.SubscriptionStatus.Active,
|
||||
ActiveDirectoryTenantId = "Common"
|
||||
};
|
||||
csmSubscription1 = new Azure.Subscriptions.Models.Subscription
|
||||
{
|
||||
Id = "Subscriptions/36E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
|
||||
DisplayName = "CsmSub1",
|
||||
State = "Active",
|
||||
SubscriptionId = "36E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
|
||||
};
|
||||
csmSubscription1withDuplicateId = new Azure.Subscriptions.Models.Subscription
|
||||
{
|
||||
Id = "Subscriptions/16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
|
||||
DisplayName = "RdfeSub1",
|
||||
State = "Active",
|
||||
SubscriptionId = "16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
|
||||
};
|
||||
csmSubscription2 = new Azure.Subscriptions.Models.Subscription
|
||||
{
|
||||
Id = "Subscriptions/46E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
|
||||
DisplayName = "CsmSub2",
|
||||
State = "Active",
|
||||
SubscriptionId = "46E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
|
||||
};
|
||||
azureSubscription1 = new AzureSubscription
|
||||
{
|
||||
Id = new Guid("56E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"),
|
||||
|
@ -420,12 +564,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
|
|||
Environment = "Test",
|
||||
Account = "test"
|
||||
};
|
||||
azureSubscription3withoutUser = new AzureSubscription
|
||||
{
|
||||
Id = new Guid("76E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"),
|
||||
Name = "LocalSub3",
|
||||
Environment = "Test",
|
||||
};
|
||||
azureEnvironment = new AzureEnvironment
|
||||
{
|
||||
Name = "Test",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Authentication;
|
||||
using Xunit;
|
||||
using Assert = Xunit.Assert;
|
||||
|
|
|
@ -14,11 +14,9 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.WindowsAzure.Commands.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Test.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
|
||||
|
@ -60,7 +58,7 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
|
|||
}
|
||||
});
|
||||
}
|
||||
AzureSession.AuthenticationFactory = new MockAuthenticationFactory();
|
||||
AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -79,51 +79,6 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static void AssertThrows<TException, TResult>(Func<TResult> action, string expectedMessage)
|
||||
where TException : Exception
|
||||
{
|
||||
Debug.Assert(action != null);
|
||||
|
||||
try
|
||||
{
|
||||
action();
|
||||
Assert.Fail("No exception was thrown!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Assert.IsInstanceOfType(ex, typeof(TException));
|
||||
Assert.AreEqual(expectedMessage, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure an action throws a specific type of Exception.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Expected exception type.</typeparam>
|
||||
/// <param name="action">
|
||||
/// The action that should throw when executed.
|
||||
/// </param>
|
||||
/// <param name="verification">
|
||||
/// Additional verification to perform on the exception.
|
||||
/// </param>
|
||||
public static void AssertThrows<T>(Action action, Action<T> verification)
|
||||
where T : Exception
|
||||
{
|
||||
Debug.Assert(action != null);
|
||||
Debug.Assert(verification != null);
|
||||
|
||||
try
|
||||
{
|
||||
action();
|
||||
Assert.Fail("No exception was thrown!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Assert.IsInstanceOfType(ex, typeof(T));
|
||||
verification(ex as T);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the path to a file included in the test project as something to
|
||||
/// be copied on Deployment (see Local.testsettings > Deployment for
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Test.Factories
|
||||
{
|
||||
public class TestAuthenticationFactory
|
||||
{
|
||||
[Fact]
|
||||
public void GetCloudCredentialThrowsExceptionForInvalidSubscription()
|
||||
{
|
||||
//AzureSession.DataStoreInitializer = (p) => { return new MockDataStore(); };
|
||||
//AzureSession powershell = new AzureSession();
|
||||
//var id = Guid.NewGuid();
|
||||
//powershell.Profile.Subscriptions[id] = new AzureSubscription
|
||||
//{
|
||||
// Id = id,
|
||||
// Name = "Test",
|
||||
// Environment = "Test"
|
||||
//};
|
||||
//powershell.Profile.Environments["Test"] = new AzureEnvironment
|
||||
//{
|
||||
// Name = "Test"
|
||||
//};
|
||||
//Assert.Throws<ArgumentException>(() => powershell.AuthenticationFactory.GetSubscriptionCloudCredentials(Guid.NewGuid()));
|
||||
}
|
||||
|
||||
[Fact (Skip = "TODO: Implement mocks to test logic without interactive flow.")]
|
||||
public void AuthenticateReturnsSubscriptions()
|
||||
{
|
||||
//AzureSession.DataStoreInitializer = (p) => { return new MockDataStore(); };
|
||||
//AzureSession powershell = new AzureSession();
|
||||
//UserCredentials creds = new UserCredentials();
|
||||
//powershell.AuthenticationFactory.Authenticate(powershell.CurrentEnvironment, ref creds);
|
||||
//Assert.NotNull(creds.UserName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Security;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
|
||||
{
|
||||
public class MockAccessTokenProvider : ITokenProvider
|
||||
{
|
||||
private readonly IAccessToken accessToken;
|
||||
|
||||
public MockAccessTokenProvider(string token)
|
||||
: this(token, "user@live.com")
|
||||
{ }
|
||||
|
||||
public MockAccessTokenProvider(string token, string userId)
|
||||
{
|
||||
this.accessToken = new MockAccessToken()
|
||||
{
|
||||
AccessToken = token,
|
||||
UserId = userId
|
||||
};
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password,
|
||||
AzureAccount.AccountType credentialType)
|
||||
{
|
||||
return this.accessToken;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
||||
{
|
||||
public class MockCertificateAuthenticationFactory : IAuthenticationFactory
|
||||
{
|
||||
public X509Certificate2 Certificate { get; set; }
|
||||
|
||||
public MockCertificateAuthenticationFactory()
|
||||
{
|
||||
Certificate = new X509Certificate2();
|
||||
}
|
||||
|
||||
public MockCertificateAuthenticationFactory(string userId, X509Certificate2 certificate)
|
||||
{
|
||||
Certificate = certificate;
|
||||
}
|
||||
|
||||
public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
if (account.Id == null)
|
||||
{
|
||||
account.Id = "test";
|
||||
}
|
||||
|
||||
var token = new MockAccessToken
|
||||
{
|
||||
UserId = account.Id,
|
||||
LoginType = LoginType.OrgId,
|
||||
AccessToken = "123"
|
||||
};
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)
|
||||
{
|
||||
return new CertificateCloudCredentials(context.Subscription.Id.ToString(), Certificate);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,13 +26,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
{
|
||||
public class MockClientFactory : ClientFactory
|
||||
{
|
||||
private IAuthenticationFactory authenticationFactory;
|
||||
|
||||
public MockClientFactory(IAuthenticationFactory authenticationFactory)
|
||||
{
|
||||
this.authenticationFactory = authenticationFactory;
|
||||
}
|
||||
|
||||
private readonly bool throwWhenNotAvailable;
|
||||
|
||||
public List<object> ManagementClients { get; private set; }
|
||||
|
@ -56,7 +49,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
Subscription = subscription
|
||||
};
|
||||
|
||||
creds = authenticationFactory.GetSubscriptionCloudCredentials(context);
|
||||
creds = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context);
|
||||
}
|
||||
|
||||
Uri endpointUri = (new ProfileClient()).Profile.Environments[subscription.Environment].GetEndpointAsUri(endpoint);
|
||||
|
|
|
@ -40,6 +40,11 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
VirtualStore[path] = contents;
|
||||
}
|
||||
|
||||
public void WriteFile(string path, string contents, Encoding encoding)
|
||||
{
|
||||
WriteFile(path, contents);
|
||||
}
|
||||
|
||||
public void WriteFile(string path, byte[] contents)
|
||||
{
|
||||
VirtualStore[path] = Encoding.Default.GetString(contents);
|
||||
|
@ -276,6 +281,14 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
}
|
||||
}
|
||||
|
||||
public void RemoveCertificate(string thumbprint)
|
||||
{
|
||||
if (thumbprint != null && certStore.ContainsKey(thumbprint))
|
||||
{
|
||||
certStore.Remove(thumbprint);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts unix asterisk based file pattern to regex
|
||||
/// </summary>
|
||||
|
|
|
@ -1,179 +0,0 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Management.Storage;
|
||||
using Microsoft.WindowsAzure.Management.Storage.Models;
|
||||
using Moq;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
||||
{
|
||||
/// <summary>
|
||||
/// A class used to simulate the behavior of a storage account as far as existing,
|
||||
/// creation, and querying are concerned.
|
||||
/// </summary>
|
||||
public class MockStorageService
|
||||
{
|
||||
public class StorageAccountData
|
||||
{
|
||||
private string blobEndpoint;
|
||||
private string queueEndpoint;
|
||||
private string tableEndpoint;
|
||||
private string primaryKey;
|
||||
private string secondaryKey;
|
||||
|
||||
private const string defaultPrimaryKey = "MNao3bm7t7B/x+g2/ssh9HnG0mEh1QV5EHpcna8CetYn+TSRoA8/SBoH6B3Ufwtnz3jZLSw9GEUuCTr3VooBWq==";
|
||||
private const string defaultSecondaryKey = "secondaryKey";
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string BlobEndpoint
|
||||
{
|
||||
get
|
||||
{
|
||||
return blobEndpoint ?? "http://awesome.blob.windows.core.net/";
|
||||
}
|
||||
set { blobEndpoint = value; }
|
||||
}
|
||||
|
||||
public string QueueEndpoint
|
||||
{
|
||||
get { return queueEndpoint ?? "http://awesome.queue.windows.core.net/"; }
|
||||
set { queueEndpoint = value; }
|
||||
}
|
||||
|
||||
public string TableEndpoint
|
||||
{
|
||||
get { return tableEndpoint ?? "http://awesome.table.windows.core.net"; }
|
||||
set { tableEndpoint = value; }
|
||||
}
|
||||
|
||||
public string PrimaryKey
|
||||
{
|
||||
get { return primaryKey ?? defaultPrimaryKey; }
|
||||
set { primaryKey = value; }
|
||||
}
|
||||
|
||||
public string SecondaryKey
|
||||
{
|
||||
get { return secondaryKey ?? defaultSecondaryKey; }
|
||||
set { secondaryKey = value; }
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<StorageAccountData> accounts = new List<StorageAccountData>();
|
||||
|
||||
public MockStorageService Add(Action<StorageAccountData> dataSetter)
|
||||
{
|
||||
var account = new StorageAccountData();
|
||||
dataSetter(account);
|
||||
accounts.Add(account);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
accounts.Clear();
|
||||
}
|
||||
|
||||
public void InitializeMocks(Mock<StorageManagementClient> mock)
|
||||
{
|
||||
mock.Setup(c => c.StorageAccounts.GetAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()))
|
||||
.Returns((string serviceName, CancellationToken cancellationToken) => CreateGetResponse(serviceName));
|
||||
|
||||
mock.Setup(c => c.StorageAccounts.GetKeysAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()))
|
||||
.Returns((string serviceName, CancellationToken cancellationToken) => CreateGetKeysResponse(serviceName));
|
||||
|
||||
mock.Setup(c => c.StorageAccounts.CreateAsync(It.IsAny<StorageAccountCreateParameters>(), It.IsAny<CancellationToken>()))
|
||||
.Callback((StorageAccountCreateParameters createParameters, CancellationToken cancellationToken) => AddService(createParameters))
|
||||
.Returns(CreateCreateResponse);
|
||||
}
|
||||
|
||||
private Task<StorageAccountGetResponse> CreateGetResponse(string serviceName)
|
||||
{
|
||||
Task<StorageAccountGetResponse> resultTask;
|
||||
var data = accounts.FirstOrDefault(a => a.Name == serviceName);
|
||||
if (data != null)
|
||||
{
|
||||
var storageServiceGetResponse = new StorageAccountGetResponse
|
||||
{
|
||||
StorageAccount = new StorageAccount
|
||||
{
|
||||
Name = data.Name,
|
||||
Properties = new StorageAccountProperties
|
||||
{
|
||||
Endpoints =
|
||||
{
|
||||
new Uri(data.BlobEndpoint),
|
||||
new Uri(data.QueueEndpoint),
|
||||
new Uri(data.TableEndpoint)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
resultTask = Tasks.FromResult(storageServiceGetResponse);
|
||||
}
|
||||
else
|
||||
{
|
||||
resultTask = Tasks.FromException<StorageAccountGetResponse>(ClientMocks.Make404Exception());
|
||||
}
|
||||
return resultTask;
|
||||
}
|
||||
|
||||
private Task<StorageAccountGetKeysResponse> CreateGetKeysResponse(string serviceName)
|
||||
{
|
||||
Task<StorageAccountGetKeysResponse> resultTask;
|
||||
var data = accounts.FirstOrDefault(a => a.Name == serviceName);
|
||||
if (data != null)
|
||||
{
|
||||
var response = new StorageAccountGetKeysResponse
|
||||
{
|
||||
PrimaryKey = data.PrimaryKey,
|
||||
SecondaryKey = data.SecondaryKey,
|
||||
StatusCode = HttpStatusCode.OK
|
||||
};
|
||||
resultTask = Tasks.FromResult(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
resultTask = Tasks.FromException<StorageAccountGetKeysResponse>(ClientMocks.Make404Exception());
|
||||
}
|
||||
return resultTask;
|
||||
}
|
||||
|
||||
private void AddService(StorageAccountCreateParameters createParameters)
|
||||
{
|
||||
Add(a =>
|
||||
{
|
||||
a.Name = createParameters.Name;
|
||||
});
|
||||
}
|
||||
|
||||
private Task<OperationStatusResponse> CreateCreateResponse()
|
||||
{
|
||||
return Tasks.FromResult(new OperationStatusResponse
|
||||
{
|
||||
RequestId = "unused",
|
||||
StatusCode = HttpStatusCode.OK,
|
||||
Status = OperationStatus.Succeeded
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,18 +13,17 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
||||
{
|
||||
public class MockAuthenticationFactory : IAuthenticationFactory
|
||||
public class MockTokenAuthenticationFactory : IAuthenticationFactory
|
||||
{
|
||||
private const string CommonAdTenant = "Common";
|
||||
|
||||
public IAccessToken Token { get; set; }
|
||||
|
||||
public MockAuthenticationFactory()
|
||||
public MockTokenAuthenticationFactory()
|
||||
{
|
||||
Token = new MockAccessToken
|
||||
{
|
||||
|
@ -34,7 +33,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
};
|
||||
}
|
||||
|
||||
public MockAuthenticationFactory(string userId, string accessToken)
|
||||
public MockTokenAuthenticationFactory(string userId, string accessToken)
|
||||
{
|
||||
Token = new MockAccessToken
|
||||
{
|
||||
|
@ -44,8 +43,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
|
|||
};
|
||||
}
|
||||
|
||||
public IAccessToken Authenticate(ref AzureAccount account, AzureEnvironment environment, string tenant, SecureString password,
|
||||
ShowDialog promptBehavior)
|
||||
public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
if (account.Id == null)
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Hydra.HttpRecorder" version="1.0.5359.24167-prerelease" targetFramework="net45" />
|
||||
<package id="Hydra.HttpRecorder" version="1.0.5406.28672-prerelease" targetFramework="net45" />
|
||||
<package id="Microsoft.Azure.Management.Resources" version="2.7.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
|
||||
|
@ -8,14 +8,14 @@
|
|||
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.9.10826.1824" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.11.10918.1222" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.4.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Compute" version="4.2.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Storage" version="2.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
/// </summary>
|
||||
public class AdalTokenProvider : ITokenProvider
|
||||
{
|
||||
private readonly IWin32Window parentWindow;
|
||||
private readonly ITokenProvider userTokenProvider;
|
||||
private readonly ITokenProvider servicePrincipalTokenProvider;
|
||||
|
||||
|
@ -37,14 +36,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
|
||||
public AdalTokenProvider(IWin32Window parentWindow)
|
||||
{
|
||||
this.parentWindow = parentWindow;
|
||||
this.userTokenProvider = new UserTokenProvider(parentWindow);
|
||||
servicePrincipalTokenProvider = new ServicePrincipalTokenProvider(parentWindow);
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password)
|
||||
{
|
||||
return userTokenProvider.GetAccessToken(config, promptBehavior, userId, password, AzureAccount.AccountType.User);
|
||||
servicePrincipalTokenProvider = new ServicePrincipalTokenProvider();
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password,
|
||||
|
|
|
@ -23,17 +23,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
/// </summary>
|
||||
public interface ITokenProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Get a new login token for the given environment and user credentials.
|
||||
/// Assumes that credential is for a user, not a service principal.
|
||||
/// </summary>
|
||||
/// <param name="config">Configuration.</param>
|
||||
/// <param name="promptBehavior">Prompt behavior.</param>
|
||||
/// <param name="userId">User ID to get the token for.</param>
|
||||
/// <param name="password">Secure strings with password</param>
|
||||
/// <returns>An access token.</returns>
|
||||
IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password);
|
||||
|
||||
/// <summary>
|
||||
/// Get a new login token for the given environment, user credential,
|
||||
/// and credential type.
|
||||
|
|
|
@ -45,8 +45,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
// If the file is already present, it loads its content in the ADAL cache
|
||||
private ProtectedFileTokenCache()
|
||||
{
|
||||
this.AfterAccess = AfterAccessNotification;
|
||||
this.BeforeAccess = BeforeAccessNotification;
|
||||
AfterAccess = AfterAccessNotification;
|
||||
BeforeAccess = BeforeAccessNotification;
|
||||
lock (fileLock)
|
||||
{
|
||||
if (ProfileClient.DataStore.FileExists(CacheFileName))
|
||||
|
@ -54,7 +54,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
var existingData = ProfileClient.DataStore.ReadFileAsBytes(CacheFileName);
|
||||
if (existingData != null)
|
||||
{
|
||||
this.Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser));
|
||||
Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
var existingData = ProfileClient.DataStore.ReadFileAsBytes(CacheFileName);
|
||||
if (existingData != null)
|
||||
{
|
||||
this.Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser));
|
||||
Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,15 +91,15 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
void AfterAccessNotification(TokenCacheNotificationArgs args)
|
||||
{
|
||||
// if the access operation resulted in a cache update
|
||||
if (this.HasStateChanged)
|
||||
if (HasStateChanged)
|
||||
{
|
||||
lock (fileLock)
|
||||
{
|
||||
// reflect changes in the persistent store
|
||||
ProfileClient.DataStore.WriteFile(CacheFileName,
|
||||
ProtectedData.Protect(this.Serialize(), null, DataProtectionScope.CurrentUser));
|
||||
ProtectedData.Protect(Serialize(), null, DataProtectionScope.CurrentUser));
|
||||
// once the write operation took place, restore the HasStateChanged bit to false
|
||||
this.HasStateChanged = false;
|
||||
HasStateChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,216 +0,0 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that implements <see cref="System.Collections.Generic.IDictionary{String,String}"/>
|
||||
/// while storing the actual data in a Windows Registry hive.
|
||||
/// </summary>
|
||||
public class RegistryBackedDictionary : IDictionary<string, string>
|
||||
{
|
||||
private readonly RegistryKey rootKey;
|
||||
private readonly string hivePath;
|
||||
|
||||
public RegistryBackedDictionary(RegistryKey rootKey, string hivePath)
|
||||
{
|
||||
this.rootKey = rootKey;
|
||||
this.hivePath = hivePath;
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public ICollection<string> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Select(kvp => kvp.Value).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<string> Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Select(kvp => kvp.Key).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public string this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
string value;
|
||||
TryGetValue(key, out value);
|
||||
return value;
|
||||
}
|
||||
set { AddOrOverwrite(new KeyValuePair<string, string>(key, value)); }
|
||||
}
|
||||
|
||||
public bool TryGetValue(string key, out string value)
|
||||
{
|
||||
using (RegistryKey regKey = GetKey(false))
|
||||
{
|
||||
value = (string)regKey.GetValue(key);
|
||||
return value != null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(string key, string value)
|
||||
{
|
||||
Add(new KeyValuePair<string, string>(key, value));
|
||||
}
|
||||
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
EnsureNotNull("key", key);
|
||||
|
||||
using (RegistryKey regKey = GetKey(false))
|
||||
{
|
||||
return regKey.GetValueNames().Any(k => string.Compare(k, key, StringComparison.OrdinalIgnoreCase) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove(string key)
|
||||
{
|
||||
EnsureNotNull("key", key);
|
||||
|
||||
return Remove(new KeyValuePair<string, string>(key, null));
|
||||
}
|
||||
|
||||
public bool IsReadOnly { get { return false; } }
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
using (RegistryKey regKey = GetKey(false))
|
||||
{
|
||||
return regKey.ValueCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove(KeyValuePair<string, string> item)
|
||||
{
|
||||
EnsureNotNull("item.key", item.Key);
|
||||
using (RegistryKey key = GetKey(true))
|
||||
{
|
||||
key.DeleteValue(item.Key, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Contains(KeyValuePair<string, string> item)
|
||||
{
|
||||
using (RegistryKey regKey = GetKey(false))
|
||||
{
|
||||
var value = (string)regKey.GetValue(item.Key);
|
||||
if (value == null) return false;
|
||||
return string.Compare(item.Value, value, StringComparison.Ordinal) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
|
||||
{
|
||||
if (array == null)
|
||||
{
|
||||
throw new ArgumentNullException("array");
|
||||
}
|
||||
if (arrayIndex < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("arrayIndex", Resources.DictionaryCopyToArrayIndexLessThanZero);
|
||||
}
|
||||
if (arrayIndex + Count > array.Length)
|
||||
{
|
||||
throw new ArgumentException(Resources.DictionaryCopyToArrayTooShort);
|
||||
}
|
||||
|
||||
foreach (var kvp in this)
|
||||
{
|
||||
array[arrayIndex++] = kvp;
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
using (RegistryKey regKey = GetKey(true))
|
||||
{
|
||||
foreach (var value in regKey.GetValueNames())
|
||||
{
|
||||
regKey.DeleteValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(KeyValuePair<string, string> item)
|
||||
{
|
||||
if (ContainsKey(item.Key))
|
||||
{
|
||||
throw new ArgumentException(Resources.DictionaryAddAlreadyContainsKey);
|
||||
}
|
||||
AddOrOverwrite(item);
|
||||
}
|
||||
|
||||
private void AddOrOverwrite(KeyValuePair<string, string> item)
|
||||
{
|
||||
using (RegistryKey regKey = GetKey(true))
|
||||
{
|
||||
regKey.SetValue(item.Key, item.Value, RegistryValueKind.String);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
|
||||
{
|
||||
using (RegistryKey key = GetKey(false))
|
||||
{
|
||||
foreach (string valueName in key.GetValueNames())
|
||||
{
|
||||
yield return new KeyValuePair<string, string>(valueName, (string) key.GetValue(valueName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RegistryKey GetKey(bool forWriting)
|
||||
{
|
||||
RegistryKeyPermissionCheck permissions = forWriting
|
||||
? RegistryKeyPermissionCheck.ReadWriteSubTree
|
||||
: RegistryKeyPermissionCheck.Default;
|
||||
|
||||
RegistryKey key = rootKey.OpenSubKey(hivePath, permissions) ??
|
||||
rootKey.CreateSubKey(hivePath, permissions);
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
private static void EnsureNotNull(string paramName, string value)
|
||||
// ReSharper restore UnusedParameter.Local
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(paramName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Authentication
|
|||
targetName = CreateKey(appId, tenantId),
|
||||
targetAlias = null,
|
||||
comment = null,
|
||||
lastWritten = new FILETIME() {dwHighDateTime = 0, dwLowDateTime = 0},
|
||||
lastWritten = new FILETIME {dwHighDateTime = 0, dwLowDateTime = 0},
|
||||
persist = 2, // persist on local machine
|
||||
attibuteCount = 0,
|
||||
attributes = IntPtr.Zero,
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.IdentityModel.Clients.ActiveDirectory;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Authentication;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
|
@ -25,19 +24,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
{
|
||||
internal class ServicePrincipalTokenProvider : ITokenProvider
|
||||
{
|
||||
private readonly IWin32Window parentWindow;
|
||||
private static readonly TimeSpan expirationThreshold = new TimeSpan(0, 5, 0);
|
||||
|
||||
public ServicePrincipalTokenProvider(IWin32Window parentWindow)
|
||||
{
|
||||
this.parentWindow = parentWindow;
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password)
|
||||
{
|
||||
throw new InvalidOperationException(string.Format(Resources.InvalidCredentialType, "ServicePrincipal"));
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password,
|
||||
AzureAccount.AccountType credentialType)
|
||||
{
|
||||
|
|
|
@ -37,11 +37,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
this.parentWindow = parentWindow;
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password)
|
||||
{
|
||||
return GetAccessToken(config, promptBehavior, userId, password, AzureAccount.AccountType.User);
|
||||
}
|
||||
|
||||
public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password,
|
||||
AzureAccount.AccountType credentialType)
|
||||
{
|
||||
|
@ -94,43 +89,28 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
|
||||
// We have to run this in a separate thread to guarantee that it's STA. This method
|
||||
// handles the threading details.
|
||||
private AuthenticationResult AcquireToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password)
|
||||
private AuthenticationResult AcquireToken(AdalConfiguration config, ShowDialog promptBehavior, string userId,
|
||||
SecureString password)
|
||||
{
|
||||
AuthenticationResult result = null;
|
||||
Exception ex = null;
|
||||
|
||||
var thread = new Thread(() =>
|
||||
if (promptBehavior == ShowDialog.Never)
|
||||
{
|
||||
try
|
||||
result = SafeAquireToken(config, promptBehavior, userId, password, out ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
result = DoAcquireToken(config, promptBehavior, userId, password);
|
||||
}
|
||||
catch (AdalException adalEx)
|
||||
{
|
||||
if (adalEx.ErrorCode == AdalError.UserInteractionRequired ||
|
||||
adalEx.ErrorCode == AdalError.MultipleTokensMatched)
|
||||
{
|
||||
ex = new AadAuthenticationFailedWithoutPopupException(Resources.InvalidSubscriptionState, adalEx);
|
||||
}
|
||||
else if (adalEx.ErrorCode == AdalError.MissingFederationMetadataUrl)
|
||||
{
|
||||
ex = new AadAuthenticationFailedException(Resources.CredentialOrganizationIdMessage, adalEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
ex = adalEx;
|
||||
}
|
||||
}
|
||||
catch (Exception threadEx)
|
||||
{
|
||||
ex = threadEx;
|
||||
}
|
||||
});
|
||||
result = SafeAquireToken(config, promptBehavior, userId, password, out ex);
|
||||
});
|
||||
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.Name = "AcquireTokenThread";
|
||||
thread.Start();
|
||||
thread.Join();
|
||||
}
|
||||
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.Name = "AcquireTokenThread";
|
||||
thread.Start();
|
||||
thread.Join();
|
||||
if (ex != null)
|
||||
{
|
||||
var adex = ex as AdalException;
|
||||
|
@ -151,15 +131,51 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
return result;
|
||||
}
|
||||
|
||||
private AuthenticationResult DoAcquireToken(AdalConfiguration config, ShowDialog showDialog, string userId, SecureString password)
|
||||
private AuthenticationResult SafeAquireToken(
|
||||
AdalConfiguration config,
|
||||
ShowDialog showDialog,
|
||||
string userId,
|
||||
SecureString password,
|
||||
out Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
ex = null;
|
||||
var promptBehavior = (PromptBehavior)Enum.Parse(typeof(PromptBehavior), showDialog.ToString());
|
||||
|
||||
return DoAcquireToken(config, promptBehavior, userId, password);
|
||||
}
|
||||
catch (AdalException adalEx)
|
||||
{
|
||||
if (adalEx.ErrorCode == AdalError.UserInteractionRequired ||
|
||||
adalEx.ErrorCode == AdalError.MultipleTokensMatched)
|
||||
{
|
||||
ex = new AadAuthenticationFailedWithoutPopupException(Resources.InvalidSubscriptionState, adalEx);
|
||||
}
|
||||
else if (adalEx.ErrorCode == AdalError.MissingFederationMetadataUrl)
|
||||
{
|
||||
ex = new AadAuthenticationFailedException(Resources.CredentialOrganizationIdMessage, adalEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
ex = adalEx;
|
||||
}
|
||||
}
|
||||
catch (Exception threadEx)
|
||||
{
|
||||
ex = threadEx;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private AuthenticationResult DoAcquireToken(AdalConfiguration config, PromptBehavior promptBehavior, string userId,
|
||||
SecureString password)
|
||||
{
|
||||
AuthenticationResult result;
|
||||
var context = CreateContext(config);
|
||||
|
||||
if (string.IsNullOrEmpty(userId))
|
||||
{
|
||||
PromptBehavior promptBehavior = (PromptBehavior)Enum.Parse(typeof(PromptBehavior), showDialog.ToString());
|
||||
|
||||
if (promptBehavior != PromptBehavior.Never)
|
||||
{
|
||||
ClearCookies();
|
||||
|
@ -171,8 +187,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
|
|||
}
|
||||
else
|
||||
{
|
||||
PromptBehavior promptBehavior = (PromptBehavior)Enum.Parse(typeof(PromptBehavior), showDialog.ToString());
|
||||
|
||||
if (password == null)
|
||||
{
|
||||
result = context.AcquireToken(config.ResourceClientUri, config.ClientId,
|
||||
|
|
|
@ -17,6 +17,7 @@ using System.Collections.Generic;
|
|||
using Microsoft.WindowsAzure.Commands.Common.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Factories;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
|
||||
|
@ -26,15 +27,12 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
{
|
||||
static AzureSession()
|
||||
{
|
||||
SubscriptionTokenCache = new Dictionary<Tuple<Guid, string>, IAccessToken>();
|
||||
ClientFactory = new AzurePowerShellClientFactory();
|
||||
AuthenticationFactory = new AuthenticationFactory();
|
||||
CurrentContext = new AzureContext();
|
||||
CurrentContext.Environment = AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud];
|
||||
}
|
||||
|
||||
public static IDictionary<Tuple<Guid, string>, IAccessToken> SubscriptionTokenCache { get; set; }
|
||||
|
||||
public static AzureContext CurrentContext {get; private set; }
|
||||
|
||||
public static void SetCurrentContext(AzureSubscription subscription, AzureEnvironment environment, AzureAccount account)
|
||||
|
@ -67,7 +65,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Account id doesn't match one in subscription.", "account");
|
||||
throw new ArgumentException(Resources.AccountIdDoesntMatchSubscription, "account");
|
||||
}
|
||||
|
||||
subscription.Account = account.Id;
|
||||
|
@ -77,7 +75,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
|
||||
if (subscription != null && subscription.Environment != environment.Name)
|
||||
{
|
||||
throw new ArgumentException("Environment name doesn't match one in subscription.", "environment");
|
||||
throw new ArgumentException(Resources.EnvironmentNameDoesntMatchSubscription, "environment");
|
||||
}
|
||||
|
||||
CurrentContext = new AzureContext
|
||||
|
|
|
@ -63,12 +63,13 @@
|
|||
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -82,17 +83,17 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.1.3.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
|
@ -103,17 +104,17 @@
|
|||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
@ -148,7 +149,6 @@
|
|||
<Compile Include="Authentication\IAccessToken.cs" />
|
||||
<Compile Include="Authentication\ITokenProvider.cs" />
|
||||
<Compile Include="Authentication\LoginType.cs" />
|
||||
<Compile Include="Authentication\RegistryBackedDictionary.cs" />
|
||||
<Compile Include="Authentication\UserTokenProvider.cs" />
|
||||
<Compile Include="Common\ProfileClientExtensions.cs" />
|
||||
<Compile Include="Common\AzurePowerShell.cs" />
|
||||
|
@ -158,7 +158,6 @@
|
|||
<Compile Include="Common\ServiceManagementTypes.cs" />
|
||||
<Compile Include="Factories\AuthenticationFactory.cs" />
|
||||
<Compile Include="Factories\ClientFactory.cs" />
|
||||
<Compile Include="Common\AzureException.cs" />
|
||||
<Compile Include="Common\AzureModule.cs" />
|
||||
<Compile Include="Common\ChannelHelper.cs" />
|
||||
<Compile Include="Common\ClientCreatedArgs.cs" />
|
||||
|
@ -173,7 +172,6 @@
|
|||
<Compile Include="Common\SubscriptionCmdletBase.cs" />
|
||||
<Compile Include="Common\TestMockSupport.cs" />
|
||||
<Compile Include="Common\HttpClientExtensions.cs" />
|
||||
<Compile Include="Common\HttpClientHelper.cs" />
|
||||
<Compile Include="Common\HttpRestCallLogger.cs" />
|
||||
<Compile Include="Common\HttpRestMessageInspector.cs" />
|
||||
<Compile Include="Common\ManagementConstants.cs" />
|
||||
|
@ -195,7 +193,6 @@
|
|||
<Compile Include="Common\PSAzureAccount.cs" />
|
||||
<Compile Include="Models\XmlProfileSerializer.cs" />
|
||||
<Compile Include="Models\AzureSubscription.cs" />
|
||||
<Compile Include="Models\ClientTraceEventArgs.cs" />
|
||||
<Compile Include="Models\DiskDataStore.cs" />
|
||||
<Compile Include="Models\AzureEnvironment.Methods.cs" />
|
||||
<Compile Include="Models\RecordingTracingInterceptor.cs" />
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Management.Automation;
|
||||
using System.Net;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception used to wrap Azure Service Management errors before
|
||||
/// displaying them to users in PowerShell and use their text as the
|
||||
/// primary error message.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class AzureException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the AzureException.
|
||||
/// </summary>
|
||||
/// <param name="message">Azure error message.</param>
|
||||
/// <param name="innerException">The original exception.</param>
|
||||
private AzureException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrap an existing error record in one that will display the Azure
|
||||
/// service management error message.
|
||||
/// </summary>
|
||||
/// <param name="errorRecord">The existing error.</param>
|
||||
/// <returns>
|
||||
/// Either a new ErrorRecord that displays the Azure service management
|
||||
/// error message, or the existing error record if there was no Azure
|
||||
/// error to wrap.
|
||||
/// </returns>
|
||||
public static ErrorRecord WrapExistingError(ErrorRecord errorRecord)
|
||||
{
|
||||
Debug.Assert(errorRecord != null, "errorRecord cannot be null.");
|
||||
Debug.Assert(errorRecord.Exception != null, "errorRecord.Exception cannot be null.");
|
||||
|
||||
// Try to pull the actual error message out of the error's
|
||||
// exception to give the users more information about what went
|
||||
// wrong
|
||||
CommunicationException exception = errorRecord.Exception as CommunicationException;
|
||||
if (exception != null)
|
||||
{
|
||||
WebException innerException = exception.InnerException as WebException;
|
||||
if (innerException != null)
|
||||
{
|
||||
HttpWebResponse response = innerException.Response as HttpWebResponse;
|
||||
if (response != null && (int)response.StatusCode >= 400)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
|
||||
{
|
||||
// Format the response XML with proper indentation
|
||||
string responseText = reader.ReadToEnd();
|
||||
string formattedXml = XDocument.Parse(responseText).ToString();
|
||||
|
||||
// Create a new error record that wraps the old
|
||||
// error record
|
||||
string exceptionMessage = string.Format(
|
||||
Resources.
|
||||
AzureException_WrapExistingError_DetailedErrorFormat,
|
||||
formattedXml);
|
||||
errorRecord = new ErrorRecord(
|
||||
new AzureException(exceptionMessage, exception),
|
||||
errorRecord.FullyQualifiedErrorId,
|
||||
errorRecord.CategoryInfo.Category,
|
||||
errorRecord.TargetObject);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return errorRecord;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,34 +18,34 @@ using System.Management.Automation;
|
|||
using Microsoft.WindowsAzure.Commands.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using System.Linq;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Common;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
||||
{
|
||||
public abstract class AzurePSCmdlet : PSCmdlet
|
||||
{
|
||||
private readonly RecordingTracingInterceptor httpTracingInterceptor = new RecordingTracingInterceptor();
|
||||
protected ProfileClient defaultProfileClient;
|
||||
|
||||
|
||||
public AzurePSCmdlet()
|
||||
{
|
||||
defaultProfileClient = new ProfileClient();
|
||||
DefaultProfileClient = new ProfileClient();
|
||||
|
||||
if (AzureSession.CurrentContext.Subscription == null &&
|
||||
defaultProfileClient.Profile.DefaultSubscription != null)
|
||||
DefaultProfileClient.Profile.DefaultSubscription != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
AzureSession.SetCurrentContext(
|
||||
defaultProfileClient.Profile.DefaultSubscription,
|
||||
defaultProfileClient.GetEnvironmentOrDefault(defaultProfileClient.Profile.DefaultSubscription.Environment),
|
||||
defaultProfileClient.GetAccountOrNull(defaultProfileClient.Profile.DefaultSubscription.Account));
|
||||
DefaultProfileClient.Profile.DefaultSubscription,
|
||||
DefaultProfileClient.GetEnvironmentOrDefault(
|
||||
DefaultProfileClient.Profile.DefaultSubscription.Environment),
|
||||
DefaultProfileClient.GetAccountOrNull(DefaultProfileClient.Profile.DefaultSubscription.Account));
|
||||
}
|
||||
catch (ArgumentException)
|
||||
catch
|
||||
{
|
||||
// if context cannot be loaded, start with no account/subscription
|
||||
// Ignore anything at this point
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public AzureContext CurrentContext
|
||||
|
@ -58,6 +58,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
get { return AzureSession.CurrentContext.Subscription != null; }
|
||||
}
|
||||
|
||||
public ProfileClient DefaultProfileClient { get; private set; }
|
||||
|
||||
protected string CurrentPath()
|
||||
{
|
||||
// SessionState is only available within Powershell so default to
|
||||
|
|
|
@ -26,14 +26,16 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
|
||||
public const string AssemblyCopyright = "Copyright © Microsoft";
|
||||
|
||||
public const string AssemblyVersion = "0.8.8";
|
||||
public const string AssemblyVersion = "0.8.10.1";
|
||||
|
||||
public const string AssemblyFileVersion = "0.8.8";
|
||||
public const string AssemblyFileVersion = "0.8.10.1";
|
||||
|
||||
public const string ProfileFile = "AzureProfile.json";
|
||||
|
||||
public const string OldProfileFile = "WindowsAzureProfile.xml";
|
||||
|
||||
public const string OldProfileFileBackup = "WindowsAzureProfile.xml.bak";
|
||||
|
||||
public const string TokenCacheFile = "TokenCache.dat";
|
||||
|
||||
public static string ProfileDirectory = Path.Combine(
|
||||
|
|
|
@ -18,12 +18,9 @@ using Microsoft.WindowsAzure.Commands.Common.Models;
|
|||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Common;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.WindowsAzure.Management;
|
||||
using System;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Common
|
||||
{
|
||||
|
@ -54,7 +51,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Common
|
|||
/// <typeparam name="T">The client type</typeparam>
|
||||
private void RegisterResourceManagerProviders<T>(AzureContext context) where T : ServiceClient<T>
|
||||
{
|
||||
var credentials = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context);
|
||||
var providersToRegister = RequiredResourceLookup.RequiredProvidersForResourceManager<T>();
|
||||
var registeredProviders = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.RegisteredResourceProviders);
|
||||
var unregisteredProviders = providersToRegister.Where(p => !registeredProviders.Contains(p)).ToList();
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
|
||||
string certificateThumbprint = CurrentContext.Account.Id;
|
||||
Debug.Assert(defaultProfileClient.Profile.Accounts[certificateThumbprint].Type == AzureAccount.AccountType.Certificate);
|
||||
Debug.Assert(DefaultProfileClient.Profile.Accounts[certificateThumbprint].Type == AzureAccount.AccountType.Certificate);
|
||||
|
||||
return ChannelHelper.CreateServiceManagementChannel<T>(
|
||||
ServiceBinding,
|
||||
|
|
|
@ -12,11 +12,8 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data.Services.Client;
|
||||
using System.IO;
|
||||
using System.Management.Automation;
|
||||
using System.Reflection;
|
||||
|
||||
|
@ -60,16 +57,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return fullPath;
|
||||
}
|
||||
|
||||
private static Exception FindDataServiceClientException(Exception ex)
|
||||
{
|
||||
if (ex is DataServiceClientException)
|
||||
{
|
||||
return ex;
|
||||
}
|
||||
|
||||
return ex.InnerException != null ? FindDataServiceClientException(ex.InnerException) : null;
|
||||
}
|
||||
|
||||
public static List<T> ExecuteScript<T>(this PSCmdlet cmdlet, string contents)
|
||||
{
|
||||
List<T> output = new List<T>();
|
||||
|
@ -94,13 +81,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
return output;
|
||||
}
|
||||
|
||||
public static List<T> ExecuteScriptFile<T>(this PSCmdlet cmdlet, string absolutePath)
|
||||
{
|
||||
string contents = File.ReadAllText(absolutePath);
|
||||
return ExecuteScript<T>(cmdlet, contents);
|
||||
}
|
||||
|
||||
#region PowerShell Commands
|
||||
|
||||
public static void RemoveModule(this PSCmdlet cmdlet, string moduleName)
|
||||
|
@ -132,6 +112,12 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
dynMethod.Invoke(cmdlt, null);
|
||||
}
|
||||
|
||||
public static void SetParameterSet(this PSCmdlet cmdlt, string value)
|
||||
{
|
||||
FieldInfo dynField = (typeof(Cmdlet)).GetField("_parameterSetName", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
dynField.SetValue(cmdlt, value);
|
||||
}
|
||||
|
||||
public static void InvokeEndProcessing(this PSCmdlet cmdlt)
|
||||
{
|
||||
MethodInfo dynMethod = (typeof(PSCmdlet)).GetMethod("EndProcessing", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
|
|
@ -19,8 +19,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
{
|
||||
public static class ConfigurationConstants
|
||||
{
|
||||
public const string ServiceManagementEndpoint = "https://management.core.windows.net";
|
||||
|
||||
public const int MaxReceivedMessageSize = 100000000;
|
||||
|
||||
public const int MaxStringContentLength = 67108864;
|
||||
|
@ -39,16 +37,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
return binding;
|
||||
}
|
||||
|
||||
public static Binding AnonymousWebHttpBinding(int maxStringContentLength = MaxStringContentLength)
|
||||
{
|
||||
var binding = new WebHttpBinding(WebHttpSecurityMode.None);
|
||||
binding.ReaderQuotas.MaxStringContentLength = maxStringContentLength;
|
||||
|
||||
// Increasing MaxReceivedMessageSize to allow big deployments
|
||||
binding.MaxReceivedMessageSize = MaxReceivedMessageSize;
|
||||
|
||||
return binding;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -73,7 +73,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
using (var s = response.GetResponseStream())
|
||||
{
|
||||
if (s.Length == 0)
|
||||
if (s == null || s.Length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -128,9 +128,9 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
/// <returns>true if exception caused by resource not found, otherwise, false</returns>
|
||||
public static bool IsNotFoundCommunicationException(CommunicationException exception)
|
||||
{
|
||||
ServiceManagementError error = null;
|
||||
string operationId = string.Empty;
|
||||
ErrorHelper.TryGetExceptionDetails(exception, out error, out operationId);
|
||||
ServiceManagementError error;
|
||||
string operationId;
|
||||
TryGetExceptionDetails(exception, out error, out operationId);
|
||||
return error != null && error.Code == HttpStatusCode.NotFound.ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,26 +87,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
private static string GetRawBody(
|
||||
HttpClient client,
|
||||
string requestUri,
|
||||
Action<string> logger,
|
||||
Func<string, string> formatter)
|
||||
{
|
||||
AddUserAgent(client);
|
||||
LogRequest(
|
||||
HttpMethod.Get.Method,
|
||||
client.BaseAddress + requestUri,
|
||||
client.DefaultRequestHeaders,
|
||||
string.Empty,
|
||||
logger);
|
||||
HttpResponseMessage response = client.GetAsync(requestUri).Result;
|
||||
string content = response.EnsureSuccessStatusCode().Content.ReadAsStringAsync().Result;
|
||||
LogResponse(response.StatusCode.ToString(), response.Headers, formatter(content), logger);
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
private static T CallRestApiWithJsonPayload<T>(
|
||||
this HttpClient client,
|
||||
string requestUri,
|
||||
|
@ -149,19 +129,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return GetFormat<T>(client, requestUri, logger, JsonUtilities.TryFormatJson, JsonConvert.DeserializeObject<T>);
|
||||
}
|
||||
|
||||
public static string GetXml(this HttpClient client, string requestUri, Action<string> logger)
|
||||
{
|
||||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
|
||||
return GetRawBody(client, requestUri, logger, XmlUtilities.TryFormatXml);
|
||||
}
|
||||
|
||||
public static T GetXml<T>(this HttpClient client, string requestUri, Action<string> logger)
|
||||
where T: class, new()
|
||||
{
|
||||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
|
||||
return GetFormat<T>(client, requestUri, logger, XmlUtilities.TryFormatXml, XmlUtilities.DeserializeXmlString<T>);
|
||||
}
|
||||
|
||||
public static T PostJson<T>(
|
||||
this HttpClient client,
|
||||
string requestUri,
|
||||
|
@ -179,48 +146,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
{
|
||||
return CallRestApiWithJsonPayload<T>(client, requestUri, json, logger, WebRequestMethods.Http.Put);
|
||||
}
|
||||
|
||||
public static void Delete(this HttpClient client, string requestUri, Action<string> logger)
|
||||
{
|
||||
AddUserAgent(client);
|
||||
LogRequest(
|
||||
HttpMethod.Delete.Method,
|
||||
client.BaseAddress + requestUri,
|
||||
client.DefaultRequestHeaders,
|
||||
string.Empty,
|
||||
logger);
|
||||
HttpResponseMessage response = client.DeleteAsync(requestUri).Result;
|
||||
string content = response.EnsureSuccessStatusCode().Content.ReadAsStringAsync().Result;
|
||||
LogResponse(response.StatusCode.ToString(), response.Headers, content, logger);
|
||||
}
|
||||
|
||||
public static Task<HttpResponseMessage> GetAsync(this HttpClient client, string requestUri, Action<string> Logger)
|
||||
{
|
||||
AddUserAgent(client);
|
||||
LogRequest(
|
||||
HttpMethod.Get.Method,
|
||||
client.BaseAddress + requestUri,
|
||||
client.DefaultRequestHeaders,
|
||||
string.Empty,
|
||||
Logger);
|
||||
return client.GetAsync(requestUri);
|
||||
}
|
||||
|
||||
public static Task<HttpResponseMessage> PostAsJsonAsyncWithoutEnsureSuccessStatusCode(
|
||||
this HttpClient client,
|
||||
string requestUri,
|
||||
JObject json,
|
||||
Action<string> Logger)
|
||||
{
|
||||
AddUserAgent(client);
|
||||
|
||||
LogRequest(
|
||||
HttpMethod.Post.Method,
|
||||
client.BaseAddress + requestUri,
|
||||
client.DefaultRequestHeaders,
|
||||
JsonConvert.SerializeObject(json, Formatting.Indented),
|
||||
Logger);
|
||||
return client.PostAsJsonAsync(requestUri, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,15 +102,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static bool IsPunyCodeName(string name)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(name) && name.Contains(idnHostNamePrefix))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,16 +23,10 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
public const string BasicAuthorization = "Basic";
|
||||
|
||||
public const string TracingEventResponseHeaderPrefix = "TracingEvent_";
|
||||
|
||||
public const string RunningState = "Running";
|
||||
public const string StoppedState = "Stopped";
|
||||
|
||||
public const string CustomDomainsEnabledSettingsName = "CustomDomainsEnabled";
|
||||
public const string SslSupportSettingsName = "SslSupport";
|
||||
|
||||
public const string UserAgentHeaderName = "User-Agent";
|
||||
|
||||
public const string UserAgentHeaderValue = "AzurePowershell/v" + AzurePowerShell.AssemblyVersion;
|
||||
|
||||
public static ProductInfoHeaderValue UserAgentValue = new ProductInfoHeaderValue(
|
||||
"AzurePowershell",
|
||||
string.Format("v{0}", AzurePowerShell.AssemblyVersion));
|
||||
|
@ -110,18 +104,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
public const string ChinaStorageEndpointSuffix = "core.chinacloudapi.cn";
|
||||
|
||||
public const string AzureStorageBlobEndpointFormat = "{0}://{1}.blob.core.windows.net/";
|
||||
|
||||
public const string AzureStorageQueueEndpointFormat = "{0}://{1}.queue.core.windows.net/";
|
||||
|
||||
public const string AzureStorageTableEndpointFormat = "{0}://{1}.table.core.windows.net/";
|
||||
|
||||
public const string ChinaStorageBlobEndpointFormat = "{0}://{1}.blob.core.chinacloudapi.cn/";
|
||||
|
||||
public const string ChinaStorageQueueEndpointFormat = "{0}://{1}.queue.core.chinacloudapi.cn/";
|
||||
|
||||
public const string ChinaStorageTableEndpointFormat = "{0}://{1}.table.core.chinacloudapi.cn/";
|
||||
|
||||
public const string AzureSqlDatabaseDnsSuffix = ".database.windows.net";
|
||||
|
||||
public const string ChinaSqlDatabaseDnsSuffix = ".database.chinacloudapi.cn";
|
||||
|
|
|
@ -29,15 +29,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService
|
|||
public const string PackagePath = "PackagePath";
|
||||
|
||||
public const string Path = "Path";
|
||||
|
||||
public const string EnvironmentName = "EnvironmentName";
|
||||
|
||||
public const string ServiceEndpoint = "ServiceEndpoint";
|
||||
|
||||
public const string ResourceManagerEndpoint = "ResourceManagerEndpoint";
|
||||
|
||||
public const string PublishSettingsFileUrl = "PublishSettingsFileUrl";
|
||||
|
||||
public const string GalleryEndpoint = "GalleryEndpoint";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,33 +60,74 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
private static void UpgradeProfile()
|
||||
{
|
||||
string oldProfileFilePath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFile);
|
||||
string oldProfileFilePathBackup = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFileBackup);
|
||||
string newProfileFilePath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.ProfileFile);
|
||||
if (DataStore.FileExists(oldProfileFilePath))
|
||||
{
|
||||
string oldProfilePath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory,
|
||||
AzurePowerShell.OldProfileFile);
|
||||
AzureProfile oldProfile = new AzureProfile(DataStore, oldProfilePath);
|
||||
|
||||
if (DataStore.FileExists(newProfileFilePath))
|
||||
try
|
||||
{
|
||||
// Merge profile files
|
||||
AzureProfile newProfile = new AzureProfile(DataStore, newProfileFilePath);
|
||||
foreach (var environment in newProfile.Environments.Values)
|
||||
// Try to backup old profile
|
||||
try
|
||||
{
|
||||
oldProfile.Environments[environment.Name] = environment;
|
||||
DataStore.CopyFile(oldProfilePath, oldProfileFilePathBackup);
|
||||
}
|
||||
foreach (var subscription in newProfile.Subscriptions.Values)
|
||||
catch
|
||||
{
|
||||
oldProfile.Subscriptions[subscription.Id] = subscription;
|
||||
// Ignore any errors here
|
||||
}
|
||||
DataStore.DeleteFile(newProfileFilePath);
|
||||
}
|
||||
|
||||
// Save the profile to the disk
|
||||
oldProfile.Save();
|
||||
AzureProfile oldProfile = new AzureProfile(DataStore, oldProfilePath);
|
||||
|
||||
// Rename WindowsAzureProfile.xml to WindowsAzureProfile.json
|
||||
DataStore.RenameFile(oldProfilePath, newProfileFilePath);
|
||||
if (DataStore.FileExists(newProfileFilePath))
|
||||
{
|
||||
// Merge profile files
|
||||
AzureProfile newProfile = new AzureProfile(DataStore, newProfileFilePath);
|
||||
foreach (var environment in newProfile.Environments.Values)
|
||||
{
|
||||
oldProfile.Environments[environment.Name] = environment;
|
||||
}
|
||||
foreach (var subscription in newProfile.Subscriptions.Values)
|
||||
{
|
||||
oldProfile.Subscriptions[subscription.Id] = subscription;
|
||||
}
|
||||
DataStore.DeleteFile(newProfileFilePath);
|
||||
}
|
||||
|
||||
// If there were no load errors - delete backup file
|
||||
if (oldProfile.ProfileLoadErrors.Count == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataStore.DeleteFile(oldProfileFilePathBackup);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Give up
|
||||
}
|
||||
}
|
||||
|
||||
// Save the profile to the disk
|
||||
oldProfile.Save();
|
||||
|
||||
// Rename WindowsAzureProfile.xml to WindowsAzureProfile.json
|
||||
DataStore.RenameFile(oldProfilePath, newProfileFilePath);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Something really bad happened - try to delete the old profile
|
||||
try
|
||||
{
|
||||
DataStore.DeleteFile(oldProfilePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore any errors
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,9 +144,16 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
|
||||
public ProfileClient(string profilePath)
|
||||
{
|
||||
ProfileClient.UpgradeProfile();
|
||||
try
|
||||
{
|
||||
ProfileClient.UpgradeProfile();
|
||||
|
||||
Profile = new AzureProfile(DataStore, profilePath);
|
||||
Profile = new AzureProfile(DataStore, profilePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Should never fail in constructor
|
||||
}
|
||||
|
||||
WarningLog = (s) => Debug.WriteLine(s);
|
||||
}
|
||||
|
@ -124,10 +172,12 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
throw new ArgumentNullException("account");
|
||||
}
|
||||
|
||||
var subscriptionsFromServer = ListSubscriptionsFromServer(ref account, environment, password, ShowDialog.Always).ToList();
|
||||
|
||||
Debug.Assert(account != null);
|
||||
|
||||
var subscriptionsFromServer = ListSubscriptionsFromServer(
|
||||
account,
|
||||
environment,
|
||||
password,
|
||||
password == null ? ShowDialog.Always : ShowDialog.Never).ToList();
|
||||
|
||||
// If account id is null the login failed
|
||||
if (account.Id != null)
|
||||
{
|
||||
|
@ -387,7 +437,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
{
|
||||
if (!Profile.Subscriptions.ContainsKey(id))
|
||||
{
|
||||
throw new ArgumentException(Resources.SubscriptionIdNotFoundMessage, "name");
|
||||
throw new ArgumentException(string.Format(Resources.SubscriptionIdNotFoundMessage, id), "id");
|
||||
}
|
||||
|
||||
var subscription = Profile.Subscriptions[id];
|
||||
|
@ -452,7 +502,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException(Resources.SubscriptionIdNotFoundMessage, "id");
|
||||
throw new ArgumentException(string.Format(Resources.SubscriptionIdNotFoundMessage, id), "id");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -467,10 +517,22 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException(Resources.SubscriptionIdNotFoundMessage, "name");
|
||||
throw new ArgumentException(string.Format(Resources.SubscriptionNameNotFoundMessage, name), "name");
|
||||
}
|
||||
}
|
||||
|
||||
public AzureSubscription SetSubscriptionAsCurrent(Guid id, string accountName)
|
||||
{
|
||||
var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Id == id);
|
||||
|
||||
if (subscription == null)
|
||||
{
|
||||
throw new ArgumentException(string.Format(Resources.InvalidSubscriptionId, id), "id");
|
||||
}
|
||||
|
||||
return SetSubscriptionAsCurrent(subscription.Name, accountName);
|
||||
}
|
||||
|
||||
public AzureSubscription SetSubscriptionAsCurrent(string name, string accountName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
|
@ -499,6 +561,18 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
return currentSubscription;
|
||||
}
|
||||
|
||||
public AzureSubscription SetSubscriptionAsDefault(Guid id, string accountName)
|
||||
{
|
||||
var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Id == id);
|
||||
|
||||
if (subscription == null)
|
||||
{
|
||||
throw new ArgumentException(string.Format(Resources.InvalidSubscriptionId, id), "id");
|
||||
}
|
||||
|
||||
return SetSubscriptionAsDefault(subscription.Name, accountName);
|
||||
}
|
||||
|
||||
public AzureSubscription SetSubscriptionAsDefault(string name, string accountName)
|
||||
{
|
||||
AzureSubscription subscription = SetSubscriptionAsCurrent(name, accountName);
|
||||
|
@ -580,7 +654,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
|
||||
if (account.Type != AzureAccount.AccountType.Certificate)
|
||||
{
|
||||
subscriptions.AddRange(ListSubscriptionsFromServer(ref account, environment, null, ShowDialog.Never));
|
||||
subscriptions.AddRange(ListSubscriptionsFromServer(account, environment, null, ShowDialog.Never));
|
||||
}
|
||||
|
||||
AddOrSetAccount(account);
|
||||
|
@ -596,13 +670,13 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
}
|
||||
}
|
||||
|
||||
private IEnumerable<AzureSubscription> ListSubscriptionsFromServer(ref AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
private IEnumerable<AzureSubscription> ListSubscriptionsFromServer(AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!account.IsPropertySet(AzureAccount.Property.Tenants))
|
||||
{
|
||||
LoadAccountTenants(ref account, environment, password, promptBehavior);
|
||||
LoadAccountTenants(account, environment, password, promptBehavior);
|
||||
}
|
||||
}
|
||||
catch (AadAuthenticationException aadEx)
|
||||
|
@ -614,8 +688,8 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
try
|
||||
{
|
||||
List<AzureSubscription> mergedSubscriptions = MergeSubscriptions(
|
||||
ListServiceManagementSubscriptions(ref account, environment, password, ShowDialog.Never).ToList(),
|
||||
ListResourceManagerSubscriptions(ref account, environment, password, ShowDialog.Never).ToList());
|
||||
ListServiceManagementSubscriptions(account, environment, password, ShowDialog.Never).ToList(),
|
||||
ListResourceManagerSubscriptions(account, environment, password, ShowDialog.Never).ToList());
|
||||
|
||||
// Set user ID
|
||||
foreach (var subscription in mergedSubscriptions)
|
||||
|
@ -641,9 +715,9 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
}
|
||||
}
|
||||
|
||||
private void LoadAccountTenants(ref AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
private void LoadAccountTenants(AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
var commonTenantToken = AzureSession.AuthenticationFactory.Authenticate(ref account, environment,
|
||||
var commonTenantToken = AzureSession.AuthenticationFactory.Authenticate(account, environment,
|
||||
AuthenticationFactory.CommonAdTenant, password, promptBehavior);
|
||||
|
||||
if (environment.IsEndpointSet(AzureEnvironment.Endpoint.ResourceManager))
|
||||
|
@ -821,7 +895,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
return mergeAccount;
|
||||
}
|
||||
|
||||
private IEnumerable<AzureSubscription> ListResourceManagerSubscriptions(ref AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
private IEnumerable<AzureSubscription> ListResourceManagerSubscriptions(AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
List<AzureSubscription> result = new List<AzureSubscription>();
|
||||
|
||||
|
@ -834,7 +908,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
{
|
||||
try
|
||||
{
|
||||
var tenantToken = AzureSession.AuthenticationFactory.Authenticate(ref account, environment, tenant, password, ShowDialog.Never);
|
||||
var tenantToken = AzureSession.AuthenticationFactory.Authenticate(account, environment, tenant, password, ShowDialog.Never);
|
||||
|
||||
using (var subscriptionClient = AzureSession.ClientFactory.CreateCustomClient<Azure.Subscriptions.SubscriptionClient>(
|
||||
new TokenCloudCredentials(tenantToken.AccessToken),
|
||||
|
@ -852,8 +926,6 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
psSubscription.SetProperty(AzureSubscription.Property.SupportedModes, AzureModule.AzureResourceManager.ToString());
|
||||
psSubscription.SetProperty(AzureSubscription.Property.Tenants, tenant);
|
||||
|
||||
AzureSession.SubscriptionTokenCache[Tuple.Create(psSubscription.Id, account.Id)] = tenantToken;
|
||||
|
||||
result.Add(psSubscription);
|
||||
}
|
||||
}
|
||||
|
@ -871,7 +943,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
return result;
|
||||
}
|
||||
|
||||
private IEnumerable<AzureSubscription> ListServiceManagementSubscriptions(ref AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
private IEnumerable<AzureSubscription> ListServiceManagementSubscriptions(AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
List<AzureSubscription> result = new List<AzureSubscription>();
|
||||
|
||||
|
@ -884,7 +956,7 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
{
|
||||
try
|
||||
{
|
||||
var tenantToken = AzureSession.AuthenticationFactory.Authenticate(ref account, environment, tenant, password, ShowDialog.Never);
|
||||
var tenantToken = AzureSession.AuthenticationFactory.Authenticate(account, environment, tenant, password, ShowDialog.Never);
|
||||
|
||||
using (var subscriptionClient = AzureSession.ClientFactory.CreateCustomClient<WindowsAzure.Subscriptions.SubscriptionClient>(
|
||||
new TokenCloudCredentials(tenantToken.AccessToken),
|
||||
|
@ -902,8 +974,6 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
psSubscription.Properties[AzureSubscription.Property.SupportedModes] = AzureModule.AzureServiceManagement.ToString();
|
||||
psSubscription.SetProperty(AzureSubscription.Property.Tenants, subscription.ActiveDirectoryTenantId);
|
||||
|
||||
AzureSession.SubscriptionTokenCache[Tuple.Create(psSubscription.Id, account.Id)] = tenantToken;
|
||||
|
||||
result.Add(psSubscription);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common
|
||||
{
|
||||
|
|
|
@ -47,13 +47,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
[DataContract]
|
||||
public class AzureEnvironmentData
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor used by data contract serializer
|
||||
/// </summary>
|
||||
public AzureEnvironmentData()
|
||||
{
|
||||
}
|
||||
|
||||
public AzureEnvironment ToAzureEnvironment()
|
||||
{
|
||||
return new AzureEnvironment
|
||||
|
@ -127,12 +120,17 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
public AzureSubscription ToAzureSubscription(List<AzureEnvironment> envs)
|
||||
{
|
||||
AzureSubscription subscription = new AzureSubscription()
|
||||
AzureSubscription subscription = new AzureSubscription();
|
||||
try
|
||||
{
|
||||
Id = new Guid(this.SubscriptionId),
|
||||
Name = Name
|
||||
};
|
||||
|
||||
subscription.Id = new Guid(this.SubscriptionId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException("Subscription ID is not a valid GUID.", ex);
|
||||
}
|
||||
subscription.Name = Name;
|
||||
|
||||
// Logic to detect what is the subscription environment rely's on having ManagementEndpoint (i.e. RDFE endpoint) set already on the subscription
|
||||
List<AzureEnvironment> allEnvs = envs.Union(AzureEnvironment.PublicEnvironments.Values).ToList();
|
||||
AzureEnvironment env = allEnvs.FirstOrDefault(e => e.IsEndpointSetToValue(AzureEnvironment.Endpoint.ServiceManagement, this.ManagementEndpoint));
|
||||
|
|
|
@ -92,18 +92,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
return certificate;
|
||||
}
|
||||
|
||||
private static Uri GetManagementUri(PublishDataPublishProfile profile, PublishDataPublishProfileSubscription s)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s.ServiceManagementUrl))
|
||||
{
|
||||
return new Uri(s.ServiceManagementUrl);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(profile.Url))
|
||||
{
|
||||
return new Uri(profile.Url);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,9 +52,18 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
"microsoft.visualstudio",
|
||||
"microsoft.insights",
|
||||
"successbricks.cleardb",
|
||||
"microsoft.batch",
|
||||
"microsoft.cache" };
|
||||
}
|
||||
if (typeof(T).FullName.EndsWith("BatchManagementClient"))
|
||||
{
|
||||
return new[] { "microsoft.batch" };
|
||||
}
|
||||
|
||||
if (typeof(T).FullName.EndsWith("DataPipelineManagementClient"))
|
||||
{
|
||||
return new[] { "Microsoft.DataFactory" };
|
||||
}
|
||||
|
||||
|
||||
return new string[0];
|
||||
}
|
||||
|
|
|
@ -35,26 +35,11 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
#region Constants
|
||||
public static class Constants
|
||||
{
|
||||
public const string ContinuationTokenHeaderName = "x-ms-continuation-token";
|
||||
public const string SubscriptionIdsHeaderName = "x-ms-subscription-ids";
|
||||
public const string ClientRequestIdHeader = "x-ms-client-id";
|
||||
public const string OperationTrackingIdHeader = "x-ms-request-id";
|
||||
public const string PrincipalHeader = "x-ms-principal-id";
|
||||
public const string ServiceManagementNS = "http://schemas.microsoft.com/windowsazure";
|
||||
public const string VersionHeaderName = "x-ms-version";
|
||||
public readonly static string StandardTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
|
||||
// Please put the newest version outside the #endif.MSFTINTERNAL We only want the newest version to show up in what we ship publically.
|
||||
// Also, update rdfe\Utilities\Common\VersionHeaders.cs StaticSupportedVersionsList.
|
||||
public const string VersionHeaderContent20130801 = "2013-08-01";
|
||||
public const string VersionHeaderContentLatest = VersionHeaderContent20130801;
|
||||
}
|
||||
|
||||
|
||||
public static class PrincipalConstants
|
||||
{
|
||||
public const string AccountAdministrator = "AccountAdministrator";
|
||||
public const string ServiceAdministrator = "ServiceAdministrator";
|
||||
public const string CoAdministrator = "CoAdministrator";
|
||||
}
|
||||
|
||||
public static class DeploymentStatus
|
||||
|
@ -878,6 +863,31 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
this.SetValue("PublicIPs", value);
|
||||
}
|
||||
}
|
||||
[DataMember(Name = "NetworkSecurityGroup", EmitDefaultValue = false, Order = 7)]
|
||||
public string NetworkSecurityGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetValue<string>("NetworkSecurityGroup");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue("NetworkSecurityGroup", value);
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "NetworkInterfaces", EmitDefaultValue = false, Order = 7)]
|
||||
public AssignNetworkInterfaceCollection NetworkInterfaces
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetValue<AssignNetworkInterfaceCollection>("NetworkInterfaces");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue("NetworkInterfaces", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CollectionDataContract(Name = "PublicIPs", ItemName = "PublicIP", Namespace = Constants.ServiceManagementNS)]
|
||||
|
@ -904,6 +914,63 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
|
||||
}
|
||||
|
||||
[CollectionDataContract(Name = "NetworkInterfaces", ItemName = "NetworkInterface", Namespace = Constants.ServiceManagementNS)]
|
||||
public class AssignNetworkInterfaceCollection : List<AssignNetworkInterface>
|
||||
{
|
||||
public AssignNetworkInterfaceCollection()
|
||||
{
|
||||
}
|
||||
|
||||
public AssignNetworkInterfaceCollection(IEnumerable<AssignNetworkInterface> assignNetworkInterface)
|
||||
: base(assignNetworkInterface)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[DataContract(Name = "NetworkInterface", Namespace = Constants.ServiceManagementNS)]
|
||||
public class AssignNetworkInterface : Mergable<AssignNetworkInterface>
|
||||
{
|
||||
[DataMember(Name = "Name", EmitDefaultValue = false, Order = 1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember(Name = "IPConfigurations", EmitDefaultValue = false, Order = 2)]
|
||||
public AssignIPConfigurationCollection IPConfigurations
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetValue<AssignIPConfigurationCollection>("IPConfigurations");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue("IPConfigurations", value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CollectionDataContract(Name = "IPConfigurations", ItemName = "IPConfiguration", Namespace = Constants.ServiceManagementNS)]
|
||||
public class AssignIPConfigurationCollection : List<AssignIPConfiguration>
|
||||
{
|
||||
public AssignIPConfigurationCollection()
|
||||
{
|
||||
}
|
||||
|
||||
public AssignIPConfigurationCollection(IEnumerable<AssignIPConfiguration> assignIPConfigurations)
|
||||
: base(assignIPConfigurations)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[DataContract(Name = "IPConfiguration", Namespace = Constants.ServiceManagementNS)]
|
||||
public class AssignIPConfiguration
|
||||
{
|
||||
[DataMember(Name = "SubnetName", EmitDefaultValue = false, Order = 1)]
|
||||
public string SubnetName { get; set; }
|
||||
|
||||
[DataMember(Name = "StaticVirtualNetworkIPAddress", EmitDefaultValue = false, Order = 2)]
|
||||
public string StaticVirtualNetworkIPAddress { get; set; }
|
||||
}
|
||||
|
||||
[CollectionDataContract(Name = "LoadBalancedEndpointList", Namespace = Constants.ServiceManagementNS)]
|
||||
public class LoadBalancedEndpointList : List<InputEndpoint>
|
||||
{
|
||||
|
@ -1073,6 +1140,19 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
base.SetValue("IdleTimeoutInMinutes", value);
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "LoadBalancerDistribution", EmitDefaultValue = false, Order = 11)]
|
||||
public string LoadBalancerDistribution
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.GetValue<string>("LoadBalancerDistribution");
|
||||
}
|
||||
set
|
||||
{
|
||||
base.SetValue("LoadBalancerDistribution", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DataContract(Namespace = Constants.ServiceManagementNS)]
|
||||
|
@ -1424,6 +1504,20 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
this.SetValue("SourceMediaLink", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DataMember(Name = "IOType", EmitDefaultValue = false, Order = 7)]
|
||||
public string IOType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetValue<string>("IOType");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue("IOType", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -1508,6 +1602,19 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
this.SetValue("OS", value);
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "IOType", EmitDefaultValue = false, Order = 5)]
|
||||
public string IOType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetValue<string>("IOType");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetValue("IOType", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -2405,6 +2512,45 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
[CollectionDataContract(Namespace = Constants.ServiceManagementNS, Name = "NetworkInterfaces", ItemName = "NetworkInterface")]
|
||||
public class NetworkInterfaceList : List<NetworkInterface>, IExtensibleDataObject
|
||||
{
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
[DataContract(Namespace = Constants.ServiceManagementNS)]
|
||||
public class NetworkInterface : IExtensibleDataObject
|
||||
{
|
||||
[DataMember(EmitDefaultValue = false, Order = 1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember(EmitDefaultValue = false, Order = 2)]
|
||||
public string MacAddress { get; set; }
|
||||
|
||||
[DataMember(EmitDefaultValue = false, Order = 3)]
|
||||
public IPConfigurationList IpConfigurations { get; set; }
|
||||
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
[CollectionDataContract(Namespace = Constants.ServiceManagementNS, Name = "IPConfigurations", ItemName = "IPConfiguration")]
|
||||
public class IPConfigurationList : List<IPConfiguration>, IExtensibleDataObject
|
||||
{
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
[DataContract(Namespace = Constants.ServiceManagementNS)]
|
||||
public class IPConfiguration : IExtensibleDataObject
|
||||
{
|
||||
[DataMember(EmitDefaultValue = false, Order = 1)]
|
||||
public string SubnetName { get; set; }
|
||||
|
||||
[DataMember(EmitDefaultValue = false, Order = 2)]
|
||||
public string Address { get; set; }
|
||||
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
[CollectionDataContract(Namespace = Constants.ServiceManagementNS, Name = "AvailableServices", ItemName = "AvailableService")]
|
||||
public class AvailableServicesList : List<string>, IExtensibleDataObject
|
||||
{
|
||||
|
@ -2457,6 +2603,13 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
set;
|
||||
}
|
||||
|
||||
[DataMember(EmitDefaultValue = false, Order = 6)]
|
||||
public string IOType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
|
@ -2498,6 +2651,13 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
set;
|
||||
}
|
||||
|
||||
[DataMember(EmitDefaultValue = false, Order = 5)]
|
||||
public string IOType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
|
@ -4062,6 +4222,9 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
|
|||
[DataMember(Order = 4)]
|
||||
public int? IdleTimeoutInMinutes { get; set; }
|
||||
|
||||
[DataMember(Order = 5)]
|
||||
public string LoadBalancerDistribution { get; set; }
|
||||
|
||||
public ExtensionDataObject ExtensionData { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -163,15 +163,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static void IsGuid(string candidate)
|
||||
{
|
||||
if (candidate != null)
|
||||
{
|
||||
try { new Guid(candidate); }
|
||||
catch { throw new ArgumentException(Resources.SubscriptionIdNotFoundMessage); }
|
||||
}
|
||||
}
|
||||
|
||||
public static void HasWhiteCharacter(string text, string exceptionMessage = null)
|
||||
{
|
||||
if (text.Any(char.IsWhiteSpace))
|
||||
|
|
|
@ -17,9 +17,7 @@ using System.Linq;
|
|||
using System.Security;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Factories
|
||||
{
|
||||
|
@ -34,8 +32,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Factories
|
|||
|
||||
public ITokenProvider TokenProvider { get; set; }
|
||||
|
||||
public IAccessToken Authenticate(ref AzureAccount account, AzureEnvironment environment, string tenant, SecureString password,
|
||||
ShowDialog promptBehavior)
|
||||
public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
|
||||
{
|
||||
var token = TokenProvider.GetAccessToken(GetAdalConfiguration(environment, tenant), promptBehavior, account.Id, password, account.Type);
|
||||
account.Id = token.UserId;
|
||||
|
@ -48,57 +45,36 @@ namespace Microsoft.WindowsAzure.Commands.Common.Factories
|
|||
{
|
||||
throw new ApplicationException(Resources.InvalidCurrentSubscription);
|
||||
}
|
||||
|
||||
var account = context.Account;
|
||||
|
||||
if (!AzureSession.SubscriptionTokenCache.ContainsKey(Tuple.Create(context.Subscription.Id, context.Account.Id)))
|
||||
{
|
||||
// Try to re-authenticate
|
||||
var tenants = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants)
|
||||
.Intersect(context.Account.GetPropertyAsArray(AzureAccount.Property.Tenants));
|
||||
|
||||
foreach (var tenant in tenants)
|
||||
{
|
||||
try
|
||||
{
|
||||
AzureSession.SubscriptionTokenCache[Tuple.Create(context.Subscription.Id, context.Account.Id)] = Authenticate(ref account, context.Environment, tenant, null, ShowDialog.Never);
|
||||
break;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Skip
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (AzureSession.SubscriptionTokenCache.ContainsKey(Tuple.Create(context.Subscription.Id, context.Account.Id)))
|
||||
{
|
||||
return new AccessTokenCredential(context.Subscription.Id, AzureSession.SubscriptionTokenCache[Tuple.Create(context.Subscription.Id, context.Account.Id)]);
|
||||
}
|
||||
else if (account != null)
|
||||
{
|
||||
switch (account.Type)
|
||||
{
|
||||
case AzureAccount.AccountType.User:
|
||||
case AzureAccount.AccountType.ServicePrincipal:
|
||||
if (!AzureSession.SubscriptionTokenCache.ContainsKey(Tuple.Create(context.Subscription.Id, account.Id)))
|
||||
{
|
||||
throw new ArgumentException(Resources.InvalidSubscriptionState);
|
||||
}
|
||||
return new AccessTokenCredential(context.Subscription.Id, AzureSession.SubscriptionTokenCache[Tuple.Create(context.Subscription.Id, account.Id)]);
|
||||
|
||||
case AzureAccount.AccountType.Certificate:
|
||||
var certificate = ProfileClient.DataStore.GetCertificate(account.Id);
|
||||
return new CertificateCloudCredentials(context.Subscription.Id.ToString(), certificate);
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("Error: couldn't do whatever it is we're trying to do here");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (context.Account == null)
|
||||
{
|
||||
throw new ArgumentException(Resources.InvalidSubscriptionState);
|
||||
}
|
||||
|
||||
if (context.Account.Type == AzureAccount.AccountType.Certificate)
|
||||
{
|
||||
var certificate = ProfileClient.DataStore.GetCertificate(context.Account.Id);
|
||||
return new CertificateCloudCredentials(context.Subscription.Id.ToString(), certificate);
|
||||
}
|
||||
|
||||
var tenant = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants)
|
||||
.Intersect(context.Account.GetPropertyAsArray(AzureAccount.Property.Tenants))
|
||||
.FirstOrDefault();
|
||||
|
||||
if (tenant == null)
|
||||
{
|
||||
throw new ArgumentException(Resources.InvalidSubscriptionState);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var token = Authenticate(context.Account, context.Environment, tenant, null, ShowDialog.Never);
|
||||
return new AccessTokenCredential(context.Subscription.Id, token);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(Resources.InvalidSubscriptionState, ex);
|
||||
}
|
||||
}
|
||||
|
||||
private AdalConfiguration GetAdalConfiguration(AzureEnvironment environment, string tenantId)
|
||||
|
|
|
@ -14,16 +14,12 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using Microsoft.Azure.Management.Resources;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Common;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.WindowsAzure.Management;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Factories
|
||||
{
|
||||
|
@ -90,15 +86,10 @@ namespace Microsoft.WindowsAzure.Commands.Common.Factories
|
|||
|
||||
public virtual HttpClient CreateHttpClient(string endpoint, ICredentials credentials)
|
||||
{
|
||||
return CreateHttpClientBase(endpoint, CreateHttpClientHandler(endpoint, credentials));
|
||||
return CreateHttpClient(endpoint, CreateHttpClientHandler(endpoint, credentials));
|
||||
}
|
||||
|
||||
public virtual HttpClient CreateHttpClient(string endpoint, HttpMessageHandler effectiveHandler)
|
||||
{
|
||||
return CreateHttpClientBase(endpoint, effectiveHandler);
|
||||
}
|
||||
|
||||
public static HttpClient CreateHttpClientBase(string endpoint, HttpMessageHandler effectiveHandler)
|
||||
{
|
||||
if (endpoint == null)
|
||||
{
|
||||
|
|
|
@ -23,13 +23,13 @@ namespace Microsoft.WindowsAzure.Commands.Common
|
|||
/// <summary>
|
||||
/// Returns IAccessToken if authentication succeeds or throws an exception if authentication fails.
|
||||
/// </summary>
|
||||
/// <param name="environment"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <param name="environment"></param>
|
||||
/// <param name="tenant"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="promptBehavior"></param>
|
||||
/// <returns></returns>
|
||||
IAccessToken Authenticate(ref AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior);
|
||||
IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior);
|
||||
|
||||
SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
using System.IO;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Interfaces
|
||||
{
|
||||
|
@ -21,6 +22,8 @@ namespace Microsoft.WindowsAzure.Commands.Common.Interfaces
|
|||
{
|
||||
void WriteFile(string path, string contents);
|
||||
|
||||
void WriteFile(string path, string content, Encoding encoding);
|
||||
|
||||
void WriteFile(string path, byte[] contents);
|
||||
|
||||
string ReadFileAsText(string path);
|
||||
|
@ -58,5 +61,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Interfaces
|
|||
X509Certificate2 GetCertificate(string thumbprint);
|
||||
|
||||
void AddCertificate(X509Certificate2 cert);
|
||||
|
||||
void RemoveCertificate(string thumbprint);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Interfaces
|
||||
|
@ -20,6 +21,8 @@ namespace Microsoft.WindowsAzure.Commands.Common.Interfaces
|
|||
{
|
||||
string Serialize(AzureProfile profile);
|
||||
|
||||
void Deserialize(string contents, AzureProfile profile);
|
||||
bool Deserialize(string contents, AzureProfile profile);
|
||||
|
||||
IList<string> DeserializeErrors { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,10 +12,7 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Models
|
||||
{
|
||||
|
|
|
@ -150,7 +150,11 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
|
||||
public bool IsEndpointSetToValue(AzureEnvironment.Endpoint endpoint, string url)
|
||||
{
|
||||
if (Endpoints.IsPropertySet(endpoint))
|
||||
if (url == null && !Endpoints.IsPropertySet(endpoint))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (url != null && Endpoints.IsPropertySet(endpoint))
|
||||
{
|
||||
return GetEndpoint(endpoint)
|
||||
.Trim(new[] {'/'})
|
||||
|
|
|
@ -49,6 +49,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
Environments = new Dictionary<string, AzureEnvironment>(StringComparer.InvariantCultureIgnoreCase);
|
||||
Subscriptions = new Dictionary<Guid, AzureSubscription>();
|
||||
Accounts = new Dictionary<string, AzureAccount>(StringComparer.InvariantCultureIgnoreCase);
|
||||
ProfileLoadErrors = new List<string>();
|
||||
|
||||
if (!store.DirectoryExists(AzurePowerShell.ProfileDirectory))
|
||||
{
|
||||
|
@ -60,15 +61,22 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
string contents = store.ReadFileAsText(profilePath);
|
||||
|
||||
IProfileSerializer serializer;
|
||||
|
||||
if (ParserHelper.IsXml(contents))
|
||||
{
|
||||
serializer = new XmlProfileSerializer();
|
||||
serializer.Deserialize(contents, this);
|
||||
if (!serializer.Deserialize(contents, this))
|
||||
{
|
||||
ProfileLoadErrors.AddRange(serializer.DeserializeErrors);
|
||||
}
|
||||
}
|
||||
else if (ParserHelper.IsJson(contents))
|
||||
{
|
||||
serializer = new JsonProfileSerializer();
|
||||
serializer.Deserialize(contents, this);
|
||||
if (!serializer.Deserialize(contents, this))
|
||||
{
|
||||
ProfileLoadErrors.AddRange(serializer.DeserializeErrors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +110,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
}
|
||||
}
|
||||
|
||||
public IDataStore DataStore { get { return store; } }
|
||||
public List<string> ProfileLoadErrors { get; private set; }
|
||||
|
||||
public Dictionary<string, AzureEnvironment> Environments { get; set; }
|
||||
|
||||
|
@ -139,25 +147,5 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate2 GetCertificate(string thumbprint)
|
||||
{
|
||||
return store.GetCertificate(thumbprint);
|
||||
}
|
||||
|
||||
public void AddCertificate(X509Certificate2 cert)
|
||||
{
|
||||
store.AddCertificate(cert);
|
||||
}
|
||||
|
||||
public void SaveTokenCache(byte[] data)
|
||||
{
|
||||
store.WriteFile(tokenCacheFile, data);
|
||||
}
|
||||
|
||||
public byte[] LoadTokenCache()
|
||||
{
|
||||
return store.ReadFileAsBytes(tokenCacheFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Utilities;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Models
|
||||
|
|
|
@ -12,9 +12,12 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Interfaces;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Common.Models
|
||||
|
@ -26,6 +29,11 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
File.WriteAllText(path, contents);
|
||||
}
|
||||
|
||||
public void WriteFile(string path, string contents, Encoding encoding)
|
||||
{
|
||||
File.WriteAllText(path, contents, encoding);
|
||||
}
|
||||
|
||||
public void WriteFile(string path, byte[] contents)
|
||||
{
|
||||
File.WriteAllBytes(path, contents);
|
||||
|
@ -102,13 +110,53 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
}
|
||||
else
|
||||
{
|
||||
return GeneralUtilities.GetCertificateFromStore(thumbprint);
|
||||
Validate.ValidateStringIsNullOrEmpty(thumbprint, "certificate thumbprint");
|
||||
X509Certificate2Collection certificates;
|
||||
if (TryFindCertificatesInStore(thumbprint, StoreLocation.CurrentUser, out certificates) ||
|
||||
TryFindCertificatesInStore(thumbprint, StoreLocation.LocalMachine, out certificates))
|
||||
{
|
||||
return certificates[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException(string.Format(Resources.CertificateNotFoundInStore, thumbprint));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddCertificate(X509Certificate2 cert)
|
||||
private static bool TryFindCertificatesInStore(string thumbprint,
|
||||
StoreLocation location, out X509Certificate2Collection certificates)
|
||||
{
|
||||
GeneralUtilities.AddCertificateToStore(cert);
|
||||
X509Store store = new X509Store(StoreName.My, location);
|
||||
store.Open(OpenFlags.ReadOnly);
|
||||
certificates = store.Certificates.Find(X509FindType.FindByThumbprint, thumbprint, false);
|
||||
store.Close();
|
||||
|
||||
return certificates.Count > 0;
|
||||
}
|
||||
|
||||
public void AddCertificate(X509Certificate2 certificate)
|
||||
{
|
||||
Validate.ValidateNullArgument(certificate, Resources.InvalidCertificate);
|
||||
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
|
||||
store.Open(OpenFlags.ReadWrite);
|
||||
store.Add(certificate);
|
||||
store.Close();
|
||||
}
|
||||
|
||||
public void RemoveCertificate(string thumbprint)
|
||||
{
|
||||
if (thumbprint != null)
|
||||
{
|
||||
var certificate = GetCertificate(thumbprint);
|
||||
if (certificate != null)
|
||||
{
|
||||
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
|
||||
store.Open(OpenFlags.ReadWrite);
|
||||
store.Remove(certificate);
|
||||
store.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool DirectoryExists(string path)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
@ -32,24 +33,60 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
}, Formatting.Indented);
|
||||
}
|
||||
|
||||
public void Deserialize(string contents, AzureProfile profile)
|
||||
public bool Deserialize(string contents, AzureProfile profile)
|
||||
{
|
||||
var jsonProfile = JObject.Parse(contents);
|
||||
DeserializeErrors = new List<string>();
|
||||
|
||||
foreach (var env in jsonProfile["Environments"])
|
||||
try
|
||||
{
|
||||
profile.Environments[(string)env["Name"]] = JsonConvert.DeserializeObject<AzureEnvironment>(env.ToString());
|
||||
}
|
||||
var jsonProfile = JObject.Parse(contents);
|
||||
|
||||
foreach (var subscription in jsonProfile["Subscriptions"])
|
||||
{
|
||||
profile.Subscriptions[new Guid((string)subscription["Id"])] = JsonConvert.DeserializeObject<AzureSubscription>(subscription.ToString());
|
||||
}
|
||||
foreach (var env in jsonProfile["Environments"])
|
||||
{
|
||||
try
|
||||
{
|
||||
profile.Environments[(string) env["Name"]] =
|
||||
JsonConvert.DeserializeObject<AzureEnvironment>(env.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DeserializeErrors.Add(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var account in jsonProfile["Accounts"])
|
||||
{
|
||||
profile.Accounts[(string)account["Id"]] = JsonConvert.DeserializeObject<AzureAccount>(account.ToString());
|
||||
foreach (var subscription in jsonProfile["Subscriptions"])
|
||||
{
|
||||
try
|
||||
{
|
||||
profile.Subscriptions[new Guid((string) subscription["Id"])] =
|
||||
JsonConvert.DeserializeObject<AzureSubscription>(subscription.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DeserializeErrors.Add(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var account in jsonProfile["Accounts"])
|
||||
{
|
||||
try
|
||||
{
|
||||
profile.Accounts[(string) account["Id"]] =
|
||||
JsonConvert.DeserializeObject<AzureAccount>(account.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DeserializeErrors.Add(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DeserializeErrors.Add(ex.Message);
|
||||
}
|
||||
return DeserializeErrors.Count == 0;
|
||||
}
|
||||
|
||||
public IList<string> DeserializeErrors { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,28 +33,30 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Deserialize(string contents, AzureProfile profile)
|
||||
public bool Deserialize(string contents, AzureProfile profile)
|
||||
{
|
||||
ProfileData data = null;
|
||||
Debug.Assert(profile != null);
|
||||
|
||||
try
|
||||
DeserializeErrors = new List<string>();
|
||||
|
||||
DataContractSerializer serializer = new DataContractSerializer(typeof(ProfileData));
|
||||
using (MemoryStream s = new MemoryStream(Encoding.UTF8.GetBytes(contents ?? "")))
|
||||
{
|
||||
DataContractSerializer serializer = new DataContractSerializer(typeof(ProfileData));
|
||||
using (MemoryStream s = new MemoryStream(Encoding.UTF8.GetBytes(contents ?? "")))
|
||||
data = (ProfileData)serializer.ReadObject(s);
|
||||
}
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
foreach (AzureEnvironmentData oldEnv in data.Environments)
|
||||
{
|
||||
data = (ProfileData)serializer.ReadObject(s);
|
||||
profile.Environments[oldEnv.Name] = oldEnv.ToAzureEnvironment();
|
||||
}
|
||||
|
||||
if (data != null)
|
||||
List<AzureEnvironment> envs = profile.Environments.Values.ToList();
|
||||
foreach (AzureSubscriptionData oldSubscription in data.Subscriptions)
|
||||
{
|
||||
foreach (AzureEnvironmentData oldEnv in data.Environments)
|
||||
{
|
||||
profile.Environments[oldEnv.Name] = oldEnv.ToAzureEnvironment();
|
||||
}
|
||||
|
||||
List<AzureEnvironment> envs = profile.Environments.Values.ToList();
|
||||
foreach (AzureSubscriptionData oldSubscription in data.Subscriptions)
|
||||
try
|
||||
{
|
||||
var newSubscription = oldSubscription.ToAzureSubscription(envs);
|
||||
if (newSubscription.Account == null)
|
||||
|
@ -80,9 +82,17 @@ namespace Microsoft.WindowsAzure.Commands.Common.Models
|
|||
|
||||
profile.Subscriptions[newSubscription.Id] = newSubscription;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Skip subscription if failed to load
|
||||
DeserializeErrors.Add(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (XmlException) { /* The profile XML was malformed ignore parsing the file */ }
|
||||
|
||||
return DeserializeErrors.Count == 0;
|
||||
}
|
||||
|
||||
public IList<string> DeserializeErrors { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
@ -69,6 +69,15 @@ namespace Microsoft.WindowsAzure.Commands.Common.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Account id doesn't match one in subscription..
|
||||
/// </summary>
|
||||
public static string AccountIdDoesntMatchSubscription {
|
||||
get {
|
||||
return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Account "{0}" has been added..
|
||||
/// </summary>
|
||||
|
@ -1024,6 +1033,15 @@ namespace Microsoft.WindowsAzure.Commands.Common.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Environment name doesn't match one in subscription..
|
||||
/// </summary>
|
||||
public static string EnvironmentNameDoesntMatchSubscription {
|
||||
get {
|
||||
return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The environment name '{0}' is not found..
|
||||
/// </summary>
|
||||
|
@ -1651,7 +1669,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided subscription if {0} is not valid.
|
||||
/// Looks up a localized string similar to The provided subscription id {0} is not valid.
|
||||
/// </summary>
|
||||
public static string InvalidSubscriptionId {
|
||||
get {
|
||||
|
@ -2658,7 +2676,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Reploy deployment with {0} Id ?.
|
||||
/// Looks up a localized string similar to Replace current deployment with '{0}' Id ?.
|
||||
/// </summary>
|
||||
public static string RedeployCommit {
|
||||
get {
|
||||
|
@ -3910,7 +3928,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided subscription name doesn't exist in the imported publish profile. If subscriptions have changed for the hosted service, retrieve an updated profile by using Get-AzurePublishSettingsFile then import the profile using Import-AzurePublishSettingsFile.
|
||||
/// Looks up a localized string similar to The subscription id {0} doesn't exist..
|
||||
/// </summary>
|
||||
public static string SubscriptionIdNotFoundMessage {
|
||||
get {
|
||||
|
|
|
@ -650,7 +650,7 @@ Please follow these steps in the portal:
|
|||
<value>The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.</value>
|
||||
</data>
|
||||
<data name="InvalidSubscriptionId" xml:space="preserve">
|
||||
<value>The provided subscription if {0} is not valid</value>
|
||||
<value>The provided subscription id {0} is not valid</value>
|
||||
</data>
|
||||
<data name="InvalidSubscriptionName" xml:space="preserve">
|
||||
<value>Must specify a non-null subscription name.</value>
|
||||
|
@ -1001,7 +1001,7 @@ Please follow these steps in the portal:
|
|||
<value>Resources\Scaffolding\Python</value>
|
||||
</data>
|
||||
<data name="RedeployCommit" xml:space="preserve">
|
||||
<value>Reploy deployment with {0} Id ?</value>
|
||||
<value>Replace current deployment with '{0}' Id ?</value>
|
||||
</data>
|
||||
<data name="RegenerateKeyWarning" xml:space="preserve">
|
||||
<value>Are you sure you want to regenerate key?</value>
|
||||
|
@ -1392,7 +1392,7 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
|
|||
<value>The subscription data file {0} does not exist.</value>
|
||||
</data>
|
||||
<data name="SubscriptionIdNotFoundMessage" xml:space="preserve">
|
||||
<value>The provided subscription name doesn't exist in the imported publish profile. If subscriptions have changed for the hosted service, retrieve an updated profile by using Get-AzurePublishSettingsFile then import the profile using Import-AzurePublishSettingsFile</value>
|
||||
<value>The subscription id {0} doesn't exist.</value>
|
||||
</data>
|
||||
<data name="SubscriptionNameNotFoundMessage" xml:space="preserve">
|
||||
<value>The subscription name {0} doesn't exist.</value>
|
||||
|
@ -1558,6 +1558,12 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
|
|||
<data name="NoSubscriptionAddedMessage" xml:space="preserve">
|
||||
<value>There is no subscription associated with account {0}.</value>
|
||||
</data>
|
||||
<data name="AccountIdDoesntMatchSubscription" xml:space="preserve">
|
||||
<value>Account id doesn't match one in subscription.</value>
|
||||
</data>
|
||||
<data name="EnvironmentNameDoesntMatchSubscription" xml:space="preserve">
|
||||
<value>Environment name doesn't match one in subscription.</value>
|
||||
</data>
|
||||
<data name="ServiceKeyNotFound" xml:space="preserve">
|
||||
<value>Unable to retrieve service key for ServicePrincipal account {0}. Please run the Add-AzureAccount cmdlet to supply the credentials for this service principal.</value>
|
||||
</data>
|
||||
|
|
|
@ -47,12 +47,12 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
if (entry.Value is SecureString)
|
||||
{
|
||||
value = ConversionUtilities.SecureStringToString(entry.Value as SecureString);
|
||||
value = SecureStringToString(entry.Value as SecureString);
|
||||
}
|
||||
|
||||
if (addValueLayer)
|
||||
{
|
||||
dictionary[(string)entry.Key] = new Hashtable() { { "value", value } };
|
||||
dictionary[(string)entry.Key] = new Hashtable { { "value", value } };
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -64,23 +64,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> ToStringDictionary(this Hashtable hashtable)
|
||||
{
|
||||
if (hashtable == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var dictionary = new Dictionary<string, string>();
|
||||
foreach (var entry in hashtable.Cast<DictionaryEntry>())
|
||||
{
|
||||
dictionary[entry.Key.ToString()] = entry.Value == null ? null : entry.Value.ToString();
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
}
|
||||
|
||||
public static Hashtable ToHashtable<TV>(this IDictionary<string, TV> dictionary)
|
||||
{
|
||||
if (dictionary == null)
|
||||
|
|
|
@ -24,7 +24,6 @@ using Microsoft.WindowsAzure.Commands.Common.Properties;
|
|||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
||||
{
|
||||
|
||||
public static class FileUtilities
|
||||
{
|
||||
static FileUtilities()
|
||||
|
@ -50,15 +49,15 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
string path = Path.Combine(startDirectory, fileName);
|
||||
|
||||
// Try search in the subdirectories in case that the file path does not exist in root path
|
||||
if (!FileUtilities.DataStore.FileExists(path) && !FileUtilities.DataStore.DirectoryExists(path))
|
||||
if (!DataStore.FileExists(path) && !DataStore.DirectoryExists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
path = FileUtilities.DataStore.GetDirectories(startDirectory, fileName, SearchOption.AllDirectories).FirstOrDefault();
|
||||
path = DataStore.GetDirectories(startDirectory, fileName, SearchOption.AllDirectories).FirstOrDefault();
|
||||
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
path = FileUtilities.DataStore.GetFiles(startDirectory, fileName, SearchOption.AllDirectories).First();
|
||||
path = DataStore.GetFiles(startDirectory, fileName, SearchOption.AllDirectories).First();
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
@ -73,13 +72,13 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
public static string GetWithProgramFilesPath(string directoryName, bool throwIfNotFound)
|
||||
{
|
||||
string programFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
||||
if (FileUtilities.DataStore.DirectoryExists(Path.Combine(programFilesPath, directoryName)))
|
||||
if (DataStore.DirectoryExists(Path.Combine(programFilesPath, directoryName)))
|
||||
{
|
||||
return Path.Combine(programFilesPath, directoryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (programFilesPath.IndexOf(Resources.x86InProgramFiles) == -1)
|
||||
if (programFilesPath.IndexOf(Resources.x86InProgramFiles, StringComparison.InvariantCultureIgnoreCase) == -1)
|
||||
{
|
||||
programFilesPath += Resources.x86InProgramFiles;
|
||||
if (throwIfNotFound)
|
||||
|
@ -108,20 +107,20 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
/// <param name="copySubDirs">Should the copy be recursive</param>
|
||||
public static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs)
|
||||
{
|
||||
var dirs = FileUtilities.DataStore.GetDirectories(sourceDirName);
|
||||
var dirs = DataStore.GetDirectories(sourceDirName);
|
||||
|
||||
if (!FileUtilities.DataStore.DirectoryExists(sourceDirName))
|
||||
if (!DataStore.DirectoryExists(sourceDirName))
|
||||
{
|
||||
throw new DirectoryNotFoundException(String.Format(Resources.PathDoesNotExist, sourceDirName));
|
||||
}
|
||||
|
||||
FileUtilities.DataStore.CreateDirectory(destDirName);
|
||||
DataStore.CreateDirectory(destDirName);
|
||||
|
||||
var files = FileUtilities.DataStore.GetFiles(sourceDirName);
|
||||
var files = DataStore.GetFiles(sourceDirName);
|
||||
foreach (var file in files)
|
||||
{
|
||||
string tempPath = Path.Combine(destDirName, Path.GetFileName(file));
|
||||
FileUtilities.DataStore.CopyFile(file, tempPath);
|
||||
DataStore.CopyFile(file, tempPath);
|
||||
}
|
||||
|
||||
if (copySubDirs)
|
||||
|
@ -142,9 +141,9 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
{
|
||||
Validate.ValidateStringIsNullOrEmpty(pathName, "Settings directory");
|
||||
string directoryPath = Path.GetDirectoryName(pathName);
|
||||
if (!FileUtilities.DataStore.DirectoryExists(directoryPath))
|
||||
if (!DataStore.DirectoryExists(directoryPath))
|
||||
{
|
||||
FileUtilities.DataStore.CreateDirectory(directoryPath);
|
||||
DataStore.CreateDirectory(directoryPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,14 +153,14 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
/// <returns>Path to the temp directory.</returns>
|
||||
public static string CreateTempDirectory()
|
||||
{
|
||||
string tempPath = null;
|
||||
string tempPath;
|
||||
do
|
||||
{
|
||||
tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
|
||||
}
|
||||
while (FileUtilities.DataStore.DirectoryExists(tempPath) || FileUtilities.DataStore.FileExists(tempPath));
|
||||
while (DataStore.DirectoryExists(tempPath) || DataStore.FileExists(tempPath));
|
||||
|
||||
FileUtilities.DataStore.CreateDirectory(tempPath);
|
||||
DataStore.CreateDirectory(tempPath);
|
||||
return tempPath;
|
||||
}
|
||||
|
||||
|
@ -177,7 +176,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
Debug.Assert(!String.IsNullOrEmpty(destinationDirectory), "destinationDirectory cannot be null or empty!");
|
||||
Debug.Assert(!Directory.Exists(destinationDirectory), "destinationDirectory must not exist!");
|
||||
|
||||
foreach (string file in FileUtilities.DataStore.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories))
|
||||
foreach (string file in DataStore.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
string relativePath = file.Substring(
|
||||
sourceDirectory.Length + 1,
|
||||
|
@ -185,12 +184,12 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
string destinationPath = Path.Combine(destinationDirectory, relativePath);
|
||||
|
||||
string destinationDir = Path.GetDirectoryName(destinationPath);
|
||||
if (!FileUtilities.DataStore.DirectoryExists(destinationDir))
|
||||
if (!DataStore.DirectoryExists(destinationDir))
|
||||
{
|
||||
FileUtilities.DataStore.CreateDirectory(destinationDir);
|
||||
DataStore.CreateDirectory(destinationDir);
|
||||
}
|
||||
|
||||
FileUtilities.DataStore.CopyFile(file, destinationPath);
|
||||
DataStore.CopyFile(file, destinationPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,9 +198,9 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
Encoding encoding;
|
||||
|
||||
|
||||
if (FileUtilities.DataStore.FileExists(path))
|
||||
if (DataStore.FileExists(path))
|
||||
{
|
||||
using (StreamReader r = new StreamReader(FileUtilities.DataStore.ReadFileAsStream(path)))
|
||||
using (StreamReader r = new StreamReader(DataStore.ReadFileAsStream(path)))
|
||||
{
|
||||
encoding = r.CurrentEncoding;
|
||||
}
|
||||
|
@ -233,7 +232,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
try
|
||||
{
|
||||
FileAttributes attributes = FileUtilities.DataStore.GetFileAttributes(path);
|
||||
FileAttributes attributes = DataStore.GetFileAttributes(path);
|
||||
|
||||
if ((attributes & FileAttributes.Directory) == FileAttributes.Directory)
|
||||
{
|
||||
|
@ -252,12 +251,12 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
public static void RecreateDirectory(string dir)
|
||||
{
|
||||
if (FileUtilities.DataStore.DirectoryExists(dir))
|
||||
if (DataStore.DirectoryExists(dir))
|
||||
{
|
||||
FileUtilities.DataStore.DeleteDirectory(dir);
|
||||
DataStore.DeleteDirectory(dir);
|
||||
}
|
||||
|
||||
FileUtilities.DataStore.CreateDirectory(dir);
|
||||
DataStore.CreateDirectory(dir);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -28,6 +28,7 @@ using System.ServiceModel.Channels;
|
|||
using System.Text;
|
||||
using System.Xml;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Common.Internals;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
||||
{
|
||||
|
@ -48,47 +49,17 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return certificates != null && certificates.Count > 0;
|
||||
}
|
||||
|
||||
private static string TryGetEnvironmentVariable(string environmentVariableName, string defaultValue)
|
||||
{
|
||||
string value = Environment.GetEnvironmentVariable(environmentVariableName);
|
||||
return (string.IsNullOrEmpty(value)) ? defaultValue : value;
|
||||
}
|
||||
|
||||
public static string GetNodeModulesPath()
|
||||
{
|
||||
return Path.Combine(FileUtilities.GetAssemblyDirectory(), Resources.NodeModulesPath);
|
||||
}
|
||||
|
||||
public static byte[] GetResourceContents(string resourceName)
|
||||
{
|
||||
Stream stream = assembly.GetManifestResourceStream(resourceName);
|
||||
byte[] contents = new byte[stream.Length];
|
||||
stream.Read(contents, (int)stream.Position, (int)stream.Length);
|
||||
return contents;
|
||||
}
|
||||
|
||||
[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
|
||||
public static void LaunchWebPage(string target)
|
||||
{
|
||||
ProcessHelper.Start(target);
|
||||
}
|
||||
|
||||
public static int GetRandomFromTwo(int first, int second)
|
||||
{
|
||||
return (new Random(DateTime.Now.Millisecond).Next(2) == 0) ? first : second;
|
||||
}
|
||||
|
||||
public static string[] GetResourceNames(string resourcesFullFolderName)
|
||||
{
|
||||
return assembly.GetManifestResourceNames().Where<string>(item => item.StartsWith(resourcesFullFolderName)).ToArray<string>();
|
||||
}
|
||||
|
||||
public static TResult InvokeMethod<T, TResult>(string methodName, object instance, params object[] arguments)
|
||||
{
|
||||
MethodInfo info = typeof(T).GetMethod(methodName);
|
||||
return (TResult)info.Invoke(instance, arguments);
|
||||
}
|
||||
|
||||
public static X509Certificate2 GetCertificateFromStore(string thumbprint)
|
||||
{
|
||||
Validate.ValidateStringIsNullOrEmpty(thumbprint, "certificate thumbprint");
|
||||
|
@ -104,38 +75,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static void AddCertificateToStore(X509Certificate2 certificate)
|
||||
{
|
||||
Validate.ValidateNullArgument(certificate, Resources.InvalidCertificate);
|
||||
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
|
||||
store.Open(OpenFlags.ReadWrite);
|
||||
store.Add(certificate);
|
||||
store.Close();
|
||||
}
|
||||
|
||||
public static void RemoveCertificateFromStore(X509Certificate2 certificate)
|
||||
{
|
||||
if (certificate != null)
|
||||
{
|
||||
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
|
||||
store.Open(OpenFlags.ReadWrite);
|
||||
store.Remove(certificate);
|
||||
store.Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of blob endpoint uri from environment if set, otherwise returns the default value.
|
||||
/// </summary>
|
||||
/// <param name="accountName">The storage account name</param>
|
||||
/// <returns>The full blob endpoint uri including the storage account name</returns>
|
||||
public static string BlobEndpointUri(string accountName)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture,
|
||||
TryGetEnvironmentVariable(Resources.BlobEndpointUriEnv, Resources.BlobEndpointUri),
|
||||
accountName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two strings with handling special case that base string can be empty.
|
||||
/// </summary>
|
||||
|
@ -389,11 +328,11 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
|
||||
public static string FormatString(string content)
|
||||
{
|
||||
if (XmlUtilities.IsXml(content))
|
||||
if (ParserHelper.IsXml(content))
|
||||
{
|
||||
return XmlUtilities.TryFormatXml(content);
|
||||
}
|
||||
else if (JsonUtilities.IsJson(content))
|
||||
else if (ParserHelper.IsJson(content))
|
||||
{
|
||||
return JsonUtilities.TryFormatJson(content);
|
||||
}
|
||||
|
@ -451,11 +390,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return new Uri(endpoint);
|
||||
}
|
||||
|
||||
public static string GetNonEmptyValue(string oldValue, string newValue)
|
||||
{
|
||||
return string.IsNullOrEmpty(newValue) ? oldValue : newValue;
|
||||
}
|
||||
|
||||
public static string DownloadFile(string uri)
|
||||
{
|
||||
string contents = null;
|
||||
|
@ -475,24 +409,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return contents;
|
||||
}
|
||||
|
||||
public static string ToUpperFirstLetter(string word)
|
||||
{
|
||||
return string.IsNullOrEmpty(word) ? word : word.Substring(0, 1).ToUpper() + word.Substring(1);
|
||||
}
|
||||
|
||||
public static object GetValue(dynamic variable, string property)
|
||||
{
|
||||
object value = null;
|
||||
IDictionary<String, object> expanded = (IDictionary<String, object>)variable;
|
||||
|
||||
if (expanded.ContainsKey(property))
|
||||
{
|
||||
value = expanded[property];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static string GenerateSeparator(int amount, string separator)
|
||||
{
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
|
|
@ -39,29 +39,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static bool IsJson(string content)
|
||||
{
|
||||
content = content.Trim();
|
||||
return content.StartsWith("{") && content.EndsWith("}")
|
||||
|| content.StartsWith("[") && content.EndsWith("]");
|
||||
}
|
||||
|
||||
public static void SerializeJsonFile<T>(T data, string path)
|
||||
{
|
||||
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
|
||||
javaScriptSerializer.MaxJsonLength = Int32.MaxValue;
|
||||
FileUtilities.DataStore.WriteFile(path, TryFormatJson(javaScriptSerializer.Serialize(data)));
|
||||
}
|
||||
|
||||
public static T DeserializeJsonFile<T>(string path)
|
||||
{
|
||||
string json = FileUtilities.DataStore.ReadFileAsText(path);
|
||||
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
|
||||
javaScriptSerializer.MaxJsonLength = Int32.MaxValue;
|
||||
return javaScriptSerializer.Deserialize<T>(json);
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> DeserializeJson(string jsonString)
|
||||
public static Dictionary<string, object> DeserializeJson(string jsonString, bool throwExceptionOnFailure = false)
|
||||
{
|
||||
Dictionary<string, object> result = new Dictionary<string,object>();
|
||||
if (jsonString == null)
|
||||
|
@ -84,6 +62,10 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
catch
|
||||
{
|
||||
if (throwExceptionOnFailure)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
IEnumerable<string> paths = psModulePath.Split(';');
|
||||
paths = job(paths);
|
||||
|
||||
if (paths.Count() == 0)
|
||||
if (!paths.Any())
|
||||
{
|
||||
Environment.SetEnvironmentVariable(PSModulePathName, null, target);
|
||||
}
|
||||
|
@ -93,30 +93,5 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
{
|
||||
return dynamicParameters.Values.Where(dp => MyInvocation.BoundParameters.Keys.Any(bp => bp.Equals(dp.Name)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current AzureMode valid values are AzureServiceManagement and AzureResourceManager only.
|
||||
/// </summary>
|
||||
/// <returns>Returns AzureServiceManagement if in RDFE and AzureResourceManager if in CSM</returns>
|
||||
public static AzureModule GetCurrentMode()
|
||||
{
|
||||
return GetCurrentModeOverride();
|
||||
}
|
||||
|
||||
private static AzureModule GetCurrentModuleFromEnvironment()
|
||||
{
|
||||
string PSModulePathEnv = Environment.GetEnvironmentVariable(PSModulePathName);
|
||||
|
||||
if (PSModulePathEnv.Contains(FileUtilities.GetModuleFolderName(AzureModule.AzureResourceManager)))
|
||||
{
|
||||
return AzureModule.AzureResourceManager;
|
||||
}
|
||||
else
|
||||
{
|
||||
return AzureModule.AzureServiceManagement;
|
||||
}
|
||||
}
|
||||
|
||||
public static Func<AzureModule> GetCurrentModeOverride = GetCurrentModuleFromEnvironment;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
{
|
||||
xmlSerializer.Serialize(writer, obj);
|
||||
}
|
||||
FileUtilities.DataStore.WriteFile(fileName, sBuilder.ToString());
|
||||
FileUtilities.DataStore.WriteFile(fileName, sBuilder.ToString(), Encoding.Unicode);
|
||||
}
|
||||
|
||||
public static string SerializeXmlString<T>(T obj)
|
||||
|
@ -78,28 +78,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
return sBuilder.ToString();
|
||||
}
|
||||
|
||||
public static T DeserializeXmlStream<T>(Stream stream)
|
||||
{
|
||||
XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));
|
||||
T obj = (T)xmlSerializer.Deserialize(stream);
|
||||
stream.Close();
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static T DeserializeXmlString<T>(string contents)
|
||||
{
|
||||
XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));
|
||||
T obj;
|
||||
|
||||
using (StringReader reader = new StringReader(contents))
|
||||
{
|
||||
obj = (T)xmlSerializer.Deserialize(reader);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Formats the given XML into indented way.
|
||||
/// </summary>
|
||||
|
@ -118,24 +96,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the content is valid XML or not.
|
||||
/// </summary>
|
||||
/// <param name="content">The text to check</param>
|
||||
/// <returns>True if XML, false otherwise</returns>
|
||||
public static bool IsXml(string content)
|
||||
{
|
||||
try
|
||||
{
|
||||
XDocument.Parse(content);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Formats given string into well formatted XML.
|
||||
/// </summary>
|
||||
|
|
|
@ -13,11 +13,8 @@
|
|||
// /c /namespace:Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema
|
||||
// /language:cs
|
||||
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema
|
||||
{
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
|
||||
[System.SerializableAttribute()]
|
||||
|
@ -27,7 +24,6 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConf
|
|||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration", IsNullable = false)]
|
||||
public partial class ServiceConfiguration
|
||||
{
|
||||
|
||||
private RoleSettings[] roleField;
|
||||
|
||||
private NetworkConfigurationElement networkConfigurationField;
|
||||
|
@ -1221,10 +1217,9 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConf
|
|||
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
|
||||
public enum SchemaVersion
|
||||
{
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlEnumAttribute("2014-01.2.3")]
|
||||
Item20140123,
|
||||
[System.Xml.Serialization.XmlEnumAttribute("2014-06.2.4")]
|
||||
Item20140624,
|
||||
|
||||
/// <remarks/>
|
||||
unspecified,
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema
|
||||
{
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
|
||||
[System.SerializableAttribute()]
|
||||
|
@ -2750,13 +2748,12 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefi
|
|||
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition")]
|
||||
public enum SchemaVersion
|
||||
{
|
||||
|
||||
/// <remarks/>
|
||||
unspecified,
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlEnumAttribute("2014-01.2.3")]
|
||||
Item20140123,
|
||||
[System.Xml.Serialization.XmlEnumAttribute("2014-06.2.4")]
|
||||
Item20140624,
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.9.10826.1824" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.11.10918.1222" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.4.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
|
||||
</packages>
|
|
@ -18,7 +18,6 @@ using Microsoft.WindowsAzure.Commands.Common;
|
|||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Profile
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
IEnumerable<AzureAccount> accounts = defaultProfileClient.ListAccounts(Name);
|
||||
IEnumerable<AzureAccount> accounts = DefaultProfileClient.ListAccounts(Name);
|
||||
List<PSAzureAccount> output = new List<PSAzureAccount>();
|
||||
foreach (AzureAccount account in accounts) {
|
||||
output.Add(account.ToPSAzureAccount());
|
||||
|
|
|
@ -49,13 +49,13 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Build" />
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -73,16 +73,17 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\lib\Microsoft.Web.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.1.3.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
|
@ -96,13 +97,13 @@
|
|||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
}
|
||||
output.Add(base.ConstructPSObject(null, args.ToArray()));
|
||||
}
|
||||
WriteObject(output);
|
||||
WriteObject(output, true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
#
|
||||
# Module manifest for module 'Azure'
|
||||
#
|
||||
# Generated by: Microsoft Corporation
|
||||
#
|
||||
# Generated on: 5/23/2012
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '0.8.8'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325'
|
||||
|
||||
# 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 = ''
|
||||
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '3.0'
|
||||
|
||||
# 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 the .NET Framework required by this module
|
||||
DotNetFrameworkVersion = '4.0'
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module
|
||||
CLRVersion='4.0'
|
||||
|
||||
# Processor architecture (None, X86, Amd64, IA64) required by this module
|
||||
ProcessorArchitecture = 'None'
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
RequiredModules = @()
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
RequiredAssemblies = @()
|
||||
|
||||
# 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 = @()
|
||||
|
||||
# Modules to import as nested modules of the module specified in ModuleToProcess
|
||||
NestedModules = '..\..\Package\Debug\ServiceManagement\Azure\Services\Microsoft.WindowsAzure.Commands.Profile.dll'
|
||||
|
||||
# Functions to export from this module
|
||||
FunctionsToExport = '*'
|
||||
|
||||
# Cmdlets to export from this module
|
||||
CmdletsToExport = '*'
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = '*'
|
||||
|
||||
# Aliases to export from this module
|
||||
AliasesToExport = @()
|
||||
|
||||
# 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 ModuleToProcess
|
||||
PrivateData = ''
|
||||
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -159,7 +159,7 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
{
|
||||
var response = client.Subscriptions.Get();
|
||||
var environment = ProfileClient.GetEnvironmentOrDefault(subscription.Environment);
|
||||
var account = defaultProfileClient.Profile.Accounts[subscription.Account];
|
||||
var account = DefaultProfileClient.Profile.Accounts[subscription.Account];
|
||||
bool isCert = account.Type == AzureAccount.AccountType.Certificate;
|
||||
|
||||
PSAzureSubscriptionExtended result = new PSAzureSubscriptionExtended(ConstructPsAzureSubscription(subscription))
|
||||
|
@ -168,18 +168,21 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
ActiveDirectoryUserId = subscription.Account,
|
||||
CurrentCoreCount = response.CurrentCoreCount,
|
||||
CurrentHostedServices = response.CurrentHostedServices,
|
||||
CurrentDnsServers = 0, // TODO: Add to spec
|
||||
CurrentLocalNetworkSites = 0, // TODO: Add to spec
|
||||
CurrentDnsServers = response.CurrentDnsServers,
|
||||
CurrentLocalNetworkSites = response.CurrentLocalNetworkSites,
|
||||
CurrentStorageAccounts = response.CurrentStorageAccounts,
|
||||
CurrentVirtualNetworkSites = response.CurrentVirtualNetworkSites,
|
||||
MaxCoreCount = response.MaximumCoreCount,
|
||||
MaxDnsServers = response.MaximumDnsServers,
|
||||
MaxHostedServices = response.MaximumHostedServices,
|
||||
MaxVirtualNetworkSites = response.MaximumVirtualNetworkSites,
|
||||
MaxLocalNetworkSites = response.MaximumLocalNetworkSites,
|
||||
MaxStorageAccounts = response.MaximumStorageAccounts,
|
||||
MaxVirtualNetworkSites = response.MaximumVirtualNetworkSites,
|
||||
ServiceAdminLiveEmailId = response.ServiceAdminLiveEmailId,
|
||||
SubscriptionRealName = response.SubscriptionName,
|
||||
SubscriptionStatus = response.SubscriptionStatus.ToString(),
|
||||
ServiceEndpoint = environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement).ToString(),
|
||||
ResourceManagerEndpoint = environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager).ToString(),
|
||||
ServiceEndpoint = environment.GetEndpoint(AzureEnvironment.Endpoint.ServiceManagement),
|
||||
ResourceManagerEndpoint = environment.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager),
|
||||
IsDefault = subscription.GetProperty(AzureSubscription.Property.Default) != null,
|
||||
Account = account,
|
||||
Certificate = isCert ? ProfileClient.DataStore.GetCertificate(subscription.Account) : null,
|
||||
|
|
|
@ -12,44 +12,76 @@
|
|||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
using Microsoft.WindowsAzure.Commands.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Properties;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.Profile
|
||||
{
|
||||
|
||||
|
||||
[Cmdlet(VerbsCommon.Select, "AzureSubscription", DefaultParameterSetName = "Current")]
|
||||
[Cmdlet(VerbsCommon.Select, "AzureSubscription", DefaultParameterSetName = SelectSubscriptionByNameParameterSet)]
|
||||
[OutputType(typeof(AzureSubscription))]
|
||||
public class SelectAzureSubscriptionCommand : SubscriptionCmdletBase
|
||||
{
|
||||
private const string SelectSubscriptionByIdParameterSet = "SelectSubscriptionByIdParameterSet";
|
||||
|
||||
private const string SelectSubscriptionByNameParameterSet = "SelectSubscriptionByNameParameterSet";
|
||||
|
||||
private const string SelectDefaultSubscriptionByIdParameterSet = "SelectDefaultSubscriptionByIdParameterSet";
|
||||
|
||||
private const string SelectDefaultSubscriptionByNameParameterSet = "SelectDefaultSubscriptionByNameParameterSet";
|
||||
|
||||
private const string NoCurrentSubscriptionParameterSet = "NoCurrentSubscriptionParameterSet";
|
||||
|
||||
private const string NoDefaultSubscriptionParameterSet = "NoDefaultSubscriptionParameterSet";
|
||||
|
||||
|
||||
public SelectAzureSubscriptionCommand() : base(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "Current", HelpMessage = "Name of subscription to select")]
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "Default", HelpMessage = "Name of subscription to select")]
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = SelectSubscriptionByNameParameterSet, HelpMessage = "Name of subscription to select")]
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = SelectDefaultSubscriptionByNameParameterSet, HelpMessage = "Name of subscription to select")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
[Alias("Name")]
|
||||
public string SubscriptionName { get; set; }
|
||||
|
||||
[Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = "Current", HelpMessage = "Name of account to select")]
|
||||
[Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = "Default", HelpMessage = "Name of account to select")]
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = SelectSubscriptionByIdParameterSet, HelpMessage = "Id of subscription to select")]
|
||||
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = SelectDefaultSubscriptionByIdParameterSet, HelpMessage = "Id of subscription to select")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
[Alias("Id")]
|
||||
public string SubscriptionId { get; set; }
|
||||
|
||||
[Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of account to select")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Account { get; set; }
|
||||
|
||||
[Parameter(Mandatory = false, ParameterSetName = "Current", HelpMessage = "Switch to set the chosen subscription as the current one")]
|
||||
[Parameter(Mandatory = false, ParameterSetName = SelectSubscriptionByIdParameterSet,
|
||||
HelpMessage = "Switch to set the chosen subscription as the current one")]
|
||||
[Parameter(Mandatory = false, ParameterSetName = SelectSubscriptionByNameParameterSet,
|
||||
HelpMessage = "Switch to set the chosen subscription as the current one")]
|
||||
public SwitchParameter Current { get; set; }
|
||||
|
||||
[Parameter(Mandatory = true, ParameterSetName = "Default", HelpMessage = "Switch to set the chosen subscription as the default one")]
|
||||
[Parameter(Mandatory = true, ParameterSetName = SelectDefaultSubscriptionByIdParameterSet,
|
||||
HelpMessage = "Switch to set the chosen subscription as the default one")]
|
||||
[Parameter(Mandatory = true, ParameterSetName = SelectDefaultSubscriptionByNameParameterSet,
|
||||
HelpMessage = "Switch to set the chosen subscription as the default one")]
|
||||
public SwitchParameter Default { get; set; }
|
||||
|
||||
[Parameter(Mandatory = true, ParameterSetName = "NoCurrent", HelpMessage = "Switch to clear the current subscription")]
|
||||
[Parameter(Mandatory = true, ParameterSetName = NoCurrentSubscriptionParameterSet,
|
||||
HelpMessage = "Switch to clear the current subscription")]
|
||||
public SwitchParameter NoCurrent { get; set; }
|
||||
|
||||
[Parameter(Mandatory = true, ParameterSetName = "NoDefault", HelpMessage = "Switch to clear the default subscription")]
|
||||
[Parameter(Mandatory = true, ParameterSetName = NoDefaultSubscriptionParameterSet,
|
||||
HelpMessage = "Switch to clear the default subscription")]
|
||||
public SwitchParameter NoDefault { get; set; }
|
||||
|
||||
[Parameter(Mandatory = false)]
|
||||
|
@ -59,19 +91,27 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
{
|
||||
switch (ParameterSetName)
|
||||
{
|
||||
case "Current":
|
||||
case SelectSubscriptionByNameParameterSet:
|
||||
WriteObject(ProfileClient.SetSubscriptionAsCurrent(SubscriptionName, Account));
|
||||
break;
|
||||
|
||||
case "Default":
|
||||
case SelectSubscriptionByIdParameterSet:
|
||||
WriteObject(ProfileClient.SetSubscriptionAsCurrent(SubscriptionIdAsGuid(), Account));
|
||||
break;
|
||||
|
||||
case SelectDefaultSubscriptionByNameParameterSet:
|
||||
WriteObject(ProfileClient.SetSubscriptionAsDefault(SubscriptionName, Account));
|
||||
break;
|
||||
|
||||
case "NoCurrent":
|
||||
case SelectDefaultSubscriptionByIdParameterSet:
|
||||
WriteObject(ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), Account));
|
||||
break;
|
||||
|
||||
case NoCurrentSubscriptionParameterSet:
|
||||
AzureSession.SetCurrentContext(null, null, null);
|
||||
break;
|
||||
|
||||
case "NoDefault":
|
||||
case NoDefaultSubscriptionParameterSet:
|
||||
ProfileClient.ClearDefaultSubscription();
|
||||
break;
|
||||
}
|
||||
|
@ -81,5 +121,15 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
WriteObject(true);
|
||||
}
|
||||
}
|
||||
|
||||
private Guid SubscriptionIdAsGuid()
|
||||
{
|
||||
Guid subscriptionIdGuid;
|
||||
if (!Guid.TryParse(SubscriptionId, out subscriptionIdGuid))
|
||||
{
|
||||
throw new ArgumentException(string.Format(Resources.InvalidGuid, SubscriptionId), "SubscriptionId");
|
||||
}
|
||||
return subscriptionIdGuid;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -106,7 +106,7 @@ namespace Microsoft.WindowsAzure.Commands.Profile
|
|||
AzureEnvironment environment = ProfileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
|
||||
if (environment == null)
|
||||
{
|
||||
environment = defaultProfileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
|
||||
environment = DefaultProfileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
|
||||
}
|
||||
|
||||
if (environment == null)
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.9.10826.1824" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.11.10918.1222" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common" version="1.4.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="1.3.0" targetFramework="net45" />
|
||||
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
</packages>
|
|
@ -52,19 +52,17 @@ namespace Microsoft.WindowsAzure.Commands.ScenarioTest
|
|||
|
||||
[Fact]
|
||||
[Trait(Category.Service, Category.Automation)]
|
||||
[Trait(Category.RunType, Category.LiveOnly)]
|
||||
public void TestAutomationSuspendAndResumeJob()
|
||||
{
|
||||
if (XUnitHelper.IsCheckin()) return;
|
||||
|
||||
RunPowerShellTest("Test-AutomationSuspendAndResumeJob -runbookPath Resources\\Automation\\Use-WorkflowCheckpointSample.ps1");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait(Category.Service, Category.Automation)]
|
||||
[Trait(Category.RunType, Category.LiveOnly)]
|
||||
public void TestAutomationStartRunbookOnASchedule()
|
||||
{
|
||||
if (XUnitHelper.IsCheckin()) return;
|
||||
|
||||
RunPowerShellTest("Test-AutomationStartRunbookOnASchedule -runbookPath Resources\\Automation\\Test-Workflow.ps1");
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
<DebugType>pdbonly</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Azure.Utilities.HttpRecorder">
|
||||
<Reference Include="Microsoft.Azure.Utilities.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Hydra.HttpRecorder.1.0.5359.24167-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll</HintPath>
|
||||
<HintPath>..\..\packages\Hydra.HttpRecorder.1.0.5406.28672-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
|
@ -51,13 +51,13 @@
|
|||
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -77,39 +77,38 @@
|
|||
<HintPath>..\lib\Microsoft.Web.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.3.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.1.3.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.WindowsAzure.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.4.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.2.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Management.WebSites">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.WebSites.3.1.1-prerelease\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.WebSites.4.0.1-prerelease\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\WindowsAzure.Storage.4.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Testing, Version=1.0.5359.24167, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Hydra.SpecTestSupport.1.0.5359.24167-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.Testing">
|
||||
<HintPath>..\..\packages\Hydra.SpecTestSupport.1.0.5406.28672-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -123,13 +122,13 @@
|
|||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
|
@ -171,6 +170,12 @@
|
|||
<Compile Include="Common\TestEnvironmentFactory.cs" />
|
||||
<Compile Include="Common\TokenCloudCredentialsHelper.cs" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\CredentialTests\AddAccountForArmTests.ps1">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CredentialTests\Common.ps1">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationConfigureRunbook.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -261,6 +266,9 @@
|
|||
<None Include="Resources\Storage\StorageContext.ps1">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Compile Include="CredentialTests\AddAccountForArmTests.cs" />
|
||||
<Compile Include="CredentialTests\CredentialTestBase.cs" />
|
||||
<Compile Include="CredentialTests\CredentialTestHelper.cs" />
|
||||
<Compile Include="MediaServicesTests\MediaServicesTests.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common
|
|||
TestMockSupport.RunningMocked = this.runningMocked;
|
||||
if (this.runningMocked)
|
||||
{
|
||||
AzureSession.AuthenticationFactory = new MockAuthenticationFactory();
|
||||
AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory();
|
||||
string dummyCredentialFile = Path.Combine(Environment.CurrentDirectory, TestCredentialHelper.DefaultCredentialFile);
|
||||
if (!File.Exists(dummyCredentialFile))
|
||||
{
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.CredentialTests
|
||||
{
|
||||
public class AddAccountForArmTests : CredentialTestBase
|
||||
{
|
||||
public AddAccountForArmTests() :
|
||||
base(AzureModule.AzureResourceManager)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
[Theory]
|
||||
[Trait(Category.RunType, Category.LiveOnly)]
|
||||
[InlineData("Test-AddOrgIdWithSingleSubscription")]
|
||||
[InlineData("Test-NonInteractiveFPOLoginFails")]
|
||||
[InlineData("Test-MicrosoftAccountNotSupportedForNonInteractiveLogin")]
|
||||
[InlineData("Test-AddServicePrincipalToEmptyProfile")]
|
||||
[InlineData("Test-LoginWithUserAndServicePrincipal")]
|
||||
[InlineData("Test-LoginWithServicePrincipalAndUser")]
|
||||
[InlineData("Test-ServicePrincipalExclusiveLogout")]
|
||||
[InlineData("Test-ServicePrincipalLogoutWithUserOnSameSubscription")]
|
||||
public void RunTests(string testScript)
|
||||
{
|
||||
RunPowerShellTest(testScript);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.CredentialTests
|
||||
{
|
||||
public abstract class CredentialTestBase
|
||||
{
|
||||
private readonly CredentialTestHelper helper;
|
||||
private readonly AzureModule commandMode;
|
||||
private const string modulePathFormat = @"Resources\CredentialTests\{0}.ps1";
|
||||
|
||||
protected CredentialTestBase(AzureModule commandMode)
|
||||
{
|
||||
helper = new CredentialTestHelper();
|
||||
this.commandMode = commandMode;
|
||||
}
|
||||
|
||||
protected virtual Collection<PSObject> RunPowerShellTest(params string[] scripts)
|
||||
{
|
||||
helper.SetupModules(commandMode,
|
||||
new[] {
|
||||
"Common",
|
||||
GetType().Name
|
||||
}.Select(m => string.Format(modulePathFormat, m)).ToArray());
|
||||
|
||||
return helper.RunPowerShellTest(scripts);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Management.Automation;
|
||||
using Microsoft.WindowsAzure.Commands.Common;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
|
||||
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.CredentialTests
|
||||
{
|
||||
internal class CredentialTestHelper
|
||||
{
|
||||
private List<string> modules;
|
||||
|
||||
public CredentialTestHelper()
|
||||
{
|
||||
ProfileClient.DataStore = new MockDataStore();
|
||||
// Ignore SSL errors
|
||||
System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => true;
|
||||
}
|
||||
|
||||
public void SetupModules(AzureModule mode, params string[] testModules)
|
||||
{
|
||||
modules = new List<string>();
|
||||
switch (mode)
|
||||
{
|
||||
case AzureModule.AzureProfile:
|
||||
modules.Add(@"ServiceManagement\Azure\Azure.psd1");
|
||||
modules.Add(@"ResourceManager\AzureResourceManager\AzureResourceManager.psd1");
|
||||
break;
|
||||
|
||||
case AzureModule.AzureServiceManagement:
|
||||
modules.Add(@"ServiceManagement\Azure\Azure.psd1");
|
||||
break;
|
||||
|
||||
case AzureModule.AzureResourceManager:
|
||||
modules.Add(@"ResourceManager\AzureResourceManager\AzureResourceManager.psd1");
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ArgumentException("Unknown command type for testing");
|
||||
}
|
||||
modules.Add("Assert.ps1");
|
||||
modules.Add("Common.ps1");
|
||||
modules.AddRange(testModules);
|
||||
}
|
||||
|
||||
public virtual Collection<PSObject> RunPowerShellTest(params string[] scripts)
|
||||
{
|
||||
using (var powershell = System.Management.Automation.PowerShell.Create())
|
||||
{
|
||||
SetupPowerShellModules(powershell);
|
||||
|
||||
Collection<PSObject> output = null;
|
||||
for (int i = 0; i < scripts.Length; ++i)
|
||||
{
|
||||
Console.WriteLine(scripts[i]);
|
||||
powershell.AddScript(scripts[i]);
|
||||
}
|
||||
try
|
||||
{
|
||||
output = powershell.Invoke();
|
||||
|
||||
if (powershell.Streams.Error.Count > 0)
|
||||
{
|
||||
throw new RuntimeException(
|
||||
"Test failed due to a non-empty error stream, check the error stream in the test log for more details.");
|
||||
}
|
||||
return output;
|
||||
}
|
||||
catch (Exception psException)
|
||||
{
|
||||
powershell.LogPowerShellException(psException);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
powershell.LogPowerShellResults(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupPowerShellModules(System.Management.Automation.PowerShell powershell)
|
||||
{
|
||||
powershell.AddScript(string.Format("cd \"{0}\"", Environment.CurrentDirectory));
|
||||
|
||||
foreach (string moduleName in modules)
|
||||
{
|
||||
powershell.AddScript(string.Format("Import-Module \".\\{0}\"", moduleName));
|
||||
}
|
||||
|
||||
powershell.AddScript("$VerbosePreference='Continue'");
|
||||
powershell.AddScript("$DebugPreference='Continue'");
|
||||
powershell.AddScript("$ErrorActionPreference='Stop'");
|
||||
powershell.AddScript("Write-Debug \"AZURE_TEST_MODE = $env:AZURE_TEST_MODE\"");
|
||||
powershell.AddScript("Write-Debug \"TEST_HTTPMOCK_OUTPUT = $env:TEST_HTTPMOCK_OUTPUT\"");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
# ----------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright Microsoft Corporation
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
### Helper functions for below tests ###
|
||||
function Assert-Empty-Profile
|
||||
{
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 0 } "Assumed no subscriptions, but there is at least one"
|
||||
Assert-True { (Get-AzureAccount).Length -eq 0 } "Assumed no accounts, but there is at least one"
|
||||
}
|
||||
|
||||
### Add-AzureAccount Scenario Tests for CSM ####
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Tests that single user account can be used to log in and list resource groups
|
||||
#>
|
||||
function Test-AddOrgIdWithSingleSubscription
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
|
||||
# Verify that account can be added and used to access the
|
||||
# expected subscription
|
||||
$accountInfo = Get-UserCredentials "OrgIdOneTenantOneSubscription"
|
||||
|
||||
Add-AzureAccount -Credential $accountInfo.Credential -Environment $accountInfo.Environment
|
||||
|
||||
# Is expected subscription added?
|
||||
$sub = (Get-AzureSubscription)[0]
|
||||
|
||||
# does it have the right subscription id?
|
||||
Assert-True { $sub.SubscriptionId -eq $accountInfo.ExpectedSubscription }
|
||||
|
||||
# It's set as current account and as default account
|
||||
Assert-True { $sub.IsCurrent }
|
||||
Assert-True { $sub.IsDefault }
|
||||
|
||||
# It's using the expected account
|
||||
Assert-True { $sub.DefaultAccount -eq $accountInfo.UserId }
|
||||
|
||||
# Can we use it to do something? If this passes then we're ok
|
||||
Get-AzureResourceGroup
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login with Foreign Principal fails with non-interactive flow with reasonable error message
|
||||
to output stream.
|
||||
#>
|
||||
function Test-NonInteractiveFPOLoginFails
|
||||
{
|
||||
$accountInfo = Get-UserCredentials "OrgIdForeignPrincipal"
|
||||
Add-AzureAccount -Credential $accountInfo.Credential -Environment $accountInfo.Environment
|
||||
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 0 } "There should be no subscription"
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Attempt to login with Microsoft Account without user interaction fails with
|
||||
a reasonable message to error stream.
|
||||
#>
|
||||
function Test-MicrosoftAccountNotSupportedForNonInteractiveLogin
|
||||
{
|
||||
$accountInfo = Get-UserCredentials MicrosoftId
|
||||
Assert-ThrowsContains {
|
||||
Add-AzureAccount -Credential $accountInfo.Credential -Environment $accountInfo.Environment
|
||||
} "-Credential parameter can only be used with Organization ID credentials"
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login with service principal with no other accounts
|
||||
#>
|
||||
function Test-AddServicePrincipalToEmptyProfile
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
$accountInfo = Get-UserCredentials ServicePrincipal
|
||||
Add-AzureAccount -ServicePrincipal -Credential $accountInfo.Credential -Environment $accountInfo.Environment -Tenant $accountInfo.TenantId
|
||||
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 1 } "Subscription was not added"
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login with user, then SP, SP should be default account
|
||||
#>
|
||||
function Test-LoginWithUserAndServicePrincipal
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
$userAccount = Get-UserCredentials OrgIdOneTenantOneSubscription
|
||||
$servicePrincipalAccount = Get-UserCredentials ServicePrincipal
|
||||
|
||||
Add-AzureAccount -Credential $userAccount.Credential -Environment $accountInfo.Environment
|
||||
Add-AzureAccount -ServicePrincipal -Credential $servicePrincipalAccount.Credential -Environment $servicePrincipalAccount.Environment -Tenant $servicePrincipalAccount.TenantId
|
||||
|
||||
$sub = (Get-AzureSubscription)[0]
|
||||
Assert-True { $sub.DefaultAccount -eq $servicePrincipalAccount.UserId }
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login with service principal, then user, user should be default account
|
||||
#>
|
||||
function Test-LoginWithServicePrincipalAndUser
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
$userAccount = Get-UserCredentials OrgIdOneTenantOneSubscription
|
||||
$servicePrincipalAccount = Get-UserCredentials ServicePrincipal
|
||||
|
||||
Add-AzureAccount -ServicePrincipal -Credential $servicePrincipalAccount.Credential -Environment $servicePrincipalAccount.Environment -Tenant $servicePrincipalAccount.TenantId
|
||||
Add-AzureAccount -Credential $userAccount.Credential -Environment $accountInfo.Environment
|
||||
|
||||
$sub = (Get-AzureSubscription)[0]
|
||||
Assert-True { $sub.DefaultAccount -eq $userAccount.UserId }
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login then logout should result in exclusive subscription being removed
|
||||
#>
|
||||
function Test-ServicePrincipalExclusiveLogout
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
$servicePrincipalAccount = Get-UserCredentials ServicePrincipal
|
||||
|
||||
Add-AzureAccount -ServicePrincipal -Credential $servicePrincipalAccount.Credential -Environment $servicePrincipalAccount.Environment -Tenant $servicePrincipalAccount.TenantId
|
||||
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 1 }
|
||||
|
||||
Remove-AzureAccount $servicePrincipalAccount.UserId -Force
|
||||
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 0 }
|
||||
Assert-True { (Get-AzureAccount).Length -eq 0 }
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Login Service Principal and User, then logout Service principal.
|
||||
#>
|
||||
function Test-ServicePrincipalLogoutWithUserOnSameSubscription
|
||||
{
|
||||
Assert-Empty-Profile
|
||||
Assert-Empty-Profile
|
||||
|
||||
$userAccount = Get-UserCredentials OrgIdOneTenantOneSubscription
|
||||
$servicePrincipalAccount = Get-UserCredentials ServicePrincipal
|
||||
|
||||
Add-AzureAccount -Credential $userAccount.Credential -Environment $accountInfo.Environment
|
||||
Add-AzureAccount -ServicePrincipal -Credential $servicePrincipalAccount.Credential -Environment $servicePrincipalAccount.Environment -Tenant $servicePrincipalAccount.TenantId
|
||||
|
||||
$sub = (Get-AzureSubscription)[0]
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 1 }
|
||||
Assert-True { $sub.DefaultAccount -eq $servicePrincipalAccount.UserId }
|
||||
|
||||
Remove-AzureAccount $servicePrincipalAccount.UserId -Force
|
||||
|
||||
$sub = (Get-AzureSubscription)[0]
|
||||
Assert-True { (Get-AzureSubscription).Length -eq 1 }
|
||||
Assert-True { $sub.DefaultAccount -eq $userAccount.UserId }
|
||||
Assert-True { (Get-AzureAccount).Length -eq 1 }
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
# ----------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright Microsoft Corporation
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
Function to get user name and password for a variety of different account types
|
||||
#>
|
||||
|
||||
function Get-UserCredentials ([string] $userType)
|
||||
{
|
||||
# Force load of testing assembly to get connection string parser
|
||||
[System.Reflection.Assembly]::Load("Microsoft.WindowsAzure.Testing")
|
||||
|
||||
function get-from-environment ($varName) {
|
||||
if (-not (test-path "Env:\$varName")) {
|
||||
throw "Required environment variable $varName is not set"
|
||||
}
|
||||
(get-childitem "Env:\$varName").Value
|
||||
}
|
||||
|
||||
function credential-from-username-password ($user, $password)
|
||||
{
|
||||
$ss = ConvertTo-SecureString -String $password -AsPlainText -Force
|
||||
New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user, $ss
|
||||
}
|
||||
|
||||
function fields-from-connection-string ([string] $cs)
|
||||
{
|
||||
[Microsoft.WindowsAzure.Testing.TestEnvironmentFactory]::ParseConnectionString($cs)
|
||||
}
|
||||
|
||||
function credential-from-fields ($fields)
|
||||
{
|
||||
$user = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::UserId]
|
||||
$password = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::Password]
|
||||
credential-from-username-password $user $password
|
||||
}
|
||||
|
||||
function environment-from-fields ($fields)
|
||||
{
|
||||
$baseUri = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::BaseUri]
|
||||
if (($baseUri -eq $null) -or ($baseUri -eq "")) {
|
||||
"AzureCloud"
|
||||
} else {
|
||||
$envs = (Get-AzureEnvironment | ? { $_.ServiceManagement -eq $baseUri })
|
||||
if ($envs.Length -eq 1) {
|
||||
$envs[0].Name
|
||||
} else {
|
||||
throw "Could not find environment matching $baseUri"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function account-info-from-connection-string ([string] $cs)
|
||||
{
|
||||
$fields = fields-from-connection-string $cs
|
||||
@{
|
||||
UserId = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::UserId];
|
||||
Credential = (credential-from-fields $fields);
|
||||
Environment = (environment-from-fields $fields);
|
||||
ExpectedSubscription = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::SubscriptionId];
|
||||
TenantId = $fields[[Microsoft.WindowsAzure.Testing.ConnectionStringFields]::AADTenant]
|
||||
}
|
||||
}
|
||||
|
||||
function account-info-from-environment-var ([string] $envvar) {
|
||||
$cs = get-from-environment $envvar
|
||||
account-info-from-connection-string $cs
|
||||
}
|
||||
|
||||
$typeHandlers = @{
|
||||
OrgIdOneTenantOneSubscription = { account-info-from-environment-var AZURE_ORGID_ONE_TENANT_ONE_SUBSCRIPTION };
|
||||
OrgIdForeignPrincipal = { account-info-from-environment-var AZURE_ORGID_FPO };
|
||||
MicrosoftId = { account-info-from-environment-var AZURE_LIVEID };
|
||||
ServicePrincipal = { account-info-from-environment-var AZURE_SERVICE_PRINCIPAL }
|
||||
}
|
||||
|
||||
$handler = $typeHandlers[$userType]
|
||||
if ($handler -ne $Null) {
|
||||
& $handler
|
||||
} else {
|
||||
throw "Unknown credential type $userType"
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@
|
|||
# limitations under the License.
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
.".\\Common.ps1"
|
||||
.".\\Assert.ps1"
|
||||
.".\\..\\Common.ps1"
|
||||
.".\\..\\Assert.ps1"
|
||||
.".\\Websites\\Common.ps1"
|
||||
.".\\Websites\\WebsitesTests.ps1"
|
||||
$global:totalCount = 0;
|
||||
|
@ -22,6 +22,7 @@ $global:passedTests = @()
|
|||
$global:failedTests = @()
|
||||
$global:times = @{}
|
||||
Add-Type -Path "..\\Microsoft.Azure.Utilities.HttpRecorder.dll"
|
||||
Add-Type -Path "..\\Microsoft.WindowsAzure.Testing.dll"
|
||||
[Microsoft.Azure.Utilities.HttpRecorder.HttpMockServer]::Initialize("foo", "bar")
|
||||
function Run-TestProtected
|
||||
{
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче