Skip to content

Commit 7e29fc8

Browse files
authored
Merge pull request #2 from deathly809/stack-storage
Split SDK out into it's own project
2 parents 78c1384 + 7667d9c commit 7e29fc8

Some content is hidden

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

48 files changed

+199
-82
lines changed

src/ResourceManager/Storage/Stack/AzureRM.Storage.psd1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.3.4'; },
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.3.4'; },
5555
@{ModuleName = 'Azure.Storage'; ModuleVersion = '4.1.1'; })
5656

5757
# Assemblies that must be loaded prior to importing this module
@@ -73,11 +73,11 @@ NestedModules = @('.\Microsoft.Azure.Commands.Management.Storage.dll')
7373
FunctionsToExport = @()
7474

7575
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
76-
CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey',
77-
'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey',
78-
'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount',
79-
'Set-AzureRmStorageAccount',
80-
'Get-AzureRmStorageAccountNameAvailability',
76+
CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey',
77+
'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey',
78+
'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount',
79+
'Set-AzureRmStorageAccount',
80+
'Get-AzureRmStorageAccountNameAvailability',
8181
'Get-AzureRmStorageUsage'
8282

8383
# Variables to export from this module
@@ -119,7 +119,7 @@ PrivateData = @{
119119
# ExternalModuleDependencies = ''
120120

121121
} # End of PSData hashtable
122-
122+
123123
} # End of PrivateData hashtable
124124

125125
# HelpInfo URI of this module

src/ResourceManager/Storage/Stack/Commands.Management.Storage.Test/Commands.Management.Storage.Test.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@
145145
<Project>{a50ab133-5c04-4a17-9054-f8343683ec23}</Project>
146146
<Name>Commands.Management.Storage</Name>
147147
</ProjectReference>
148+
<ProjectReference Include="..\SDK\StorageSDK.csproj">
149+
<Project>{ccc1f6c7-e2ce-47b3-bd64-8efd17823e20}</Project>
150+
<Name>StorageSDK</Name>
151+
</ProjectReference>
148152
</ItemGroup>
149153
<ItemGroup>
150154
<None Include="packages.config">
@@ -195,4 +199,4 @@
195199
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
196200
</ItemGroup>
197201
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
198-
</Project>
202+
</Project>

src/ResourceManager/Storage/Stack/Commands.Management.Storage.Test/TestController.cs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ public void RunPsTestWorkflow(
7676
string callingClassType,
7777
string mockName)
7878
{
79-
Dictionary<string, string> d = new Dictionary<string, string>();
80-
d.Add("Microsoft.Resources", null);
81-
d.Add("Microsoft.Features", null);
82-
d.Add("Microsoft.Authorization", null);
83-
d.Add("Microsoft.Compute", null);
84-
var providersToIgnore = new Dictionary<string, string>();
85-
providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
86-
providersToIgnore.Add("Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2016-02-01");
87-
providersToIgnore.Add("Microsoft.Azure.Management.Storage.StorageManagementClient", "2016-01-01");
79+
Dictionary<string, string> d = new Dictionary<string, string> {
80+
{ "Microsoft.Resources", null },
81+
{ "Microsoft.Features", null },
82+
{ "Microsoft.Authorization", null },
83+
{ "Microsoft.Compute", null }
84+
};
85+
var providersToIgnore = new Dictionary<string, string> {
86+
{ "Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01" },
87+
{ "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2016-02-01" },
88+
{ "Microsoft.Azure.Management.Storage.StorageManagementClient", "2016-01-01" }
89+
};
8890

8991
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
9092

@@ -93,10 +95,7 @@ public void RunPsTestWorkflow(
9395

9496
this.csmTestFactory = new CSMTestEnvironmentFactory();
9597

96-
if(initialize != null)
97-
{
98-
initialize(this.csmTestFactory);
99-
}
98+
initialize?.Invoke(this.csmTestFactory);
10099

101100
SetupManagementClients(context);
102101

@@ -127,10 +126,7 @@ public void RunPsTestWorkflow(
127126
}
128127
finally
129128
{
130-
if(cleanup !=null)
131-
{
132-
cleanup();
133-
}
129+
cleanup?.Invoke();
134130
}
135131
}
136132
}

src/ResourceManager/Storage/Stack/Commands.Management.Storage/Commands.Management.Storage.csproj

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,13 @@
4848
<Prefer32Bit>false</Prefer32Bit>
4949
</PropertyGroup>
5050
<ItemGroup>
51+
<!-- We Moved this to a project we build: Microsoft.Azure.Management.Storage.6.4.0-preview -->
5152
<Reference Include="Microsoft.Azure.KeyVault.Core">
5253
<HintPath>..\..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
5354
<Private>True</Private>
5455
</Reference>
55-
<!-- <Reference Include="Microsoft.Azure.Management.Storage, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56-
<HintPath>..\..\..\..\packages\Microsoft.Azure.Management.Storage.6.4.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
57-
</Reference>
58-
-->
5956
<Reference Include="Microsoft.Data.Edm">
60-
<HintPath>..\..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
57+
<HintPath>..\..\..\..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll</HintPath>
6158
<Private>True</Private>
6259
</Reference>
6360
<Reference Include="Microsoft.Data.OData">
@@ -75,9 +72,8 @@
7572
<HintPath>..\..\..\..\packages\WindowsAzure.Storage.8.6.0\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
7673
<Private>True</Private>
7774
</Reference>
78-
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
7975
<Reference Include="System.Spatial">
80-
<HintPath>..\..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
76+
<HintPath>..\..\..\..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll</HintPath>
8177
<Private>True</Private>
8278
</Reference>
8379
</ItemGroup>
@@ -97,42 +93,6 @@
9793
<Compile Include="..\..\..\..\Common\Commands.Common.Storage\Adapters\WindowsAzure.Storage.8\LazyAzureStorageContext.cs">
9894
<Link>Common\LazyAzureStorageContext.cs</Link>
9995
</Compile>
100-
<Compile Include="Generated\IStorageAccountsOperations.cs" />
101-
<Compile Include="Generated\IStorageManagementClient.cs" />
102-
<Compile Include="Generated\IUsageOperations.cs" />
103-
<Compile Include="Generated\Models\AccessTier.cs" />
104-
<Compile Include="Generated\Models\AccountStatus.cs" />
105-
<Compile Include="Generated\Models\CheckNameAvailabilityResult.cs" />
106-
<Compile Include="Generated\Models\CustomDomain.cs" />
107-
<Compile Include="Generated\Models\Encryption.cs" />
108-
<Compile Include="Generated\Models\EncryptionService.cs" />
109-
<Compile Include="Generated\Models\EncryptionServices.cs" />
110-
<Compile Include="Generated\Models\Endpoints.cs" />
111-
<Compile Include="Generated\Models\KeyPermission.cs" />
112-
<Compile Include="Generated\Models\Kind.cs" />
113-
<Compile Include="Generated\Models\Page.cs" />
114-
<Compile Include="Generated\Models\ProvisioningState.cs" />
115-
<Compile Include="Generated\Models\Reason.cs" />
116-
<Compile Include="Generated\Models\Resource.cs" />
117-
<Compile Include="Generated\Models\Sku.cs" />
118-
<Compile Include="Generated\Models\SkuName.cs" />
119-
<Compile Include="Generated\Models\SkuTier.cs" />
120-
<Compile Include="Generated\Models\StorageAccount.cs" />
121-
<Compile Include="Generated\Models\StorageAccountCheckNameAvailabilityParameters.cs" />
122-
<Compile Include="Generated\Models\StorageAccountCreateParameters.cs" />
123-
<Compile Include="Generated\Models\StorageAccountKey.cs" />
124-
<Compile Include="Generated\Models\StorageAccountListKeysResult.cs" />
125-
<Compile Include="Generated\Models\StorageAccountRegenerateKeyParameters.cs" />
126-
<Compile Include="Generated\Models\StorageAccountUpdateParameters.cs" />
127-
<Compile Include="Generated\Models\Usage.cs" />
128-
<Compile Include="Generated\Models\UsageListResult.cs" />
129-
<Compile Include="Generated\Models\UsageName.cs" />
130-
<Compile Include="Generated\Models\UsageUnit.cs" />
131-
<Compile Include="Generated\StorageAccountsOperations.cs" />
132-
<Compile Include="Generated\StorageAccountsOperationsExtensions.cs" />
133-
<Compile Include="Generated\StorageManagementClient.cs" />
134-
<Compile Include="Generated\UsageOperations.cs" />
135-
<Compile Include="Generated\UsageOperationsExtensions.cs" />
13696
<Compile Include="Models\PSStorageAccount.cs" />
13797
<Compile Include="Models\PSUsage.cs" />
13898
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -182,6 +142,10 @@
182142
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
183143
<Name>Commands.ResourceManager.Common</Name>
184144
</ProjectReference>
145+
<ProjectReference Include="..\SDK\StorageSDK.csproj">
146+
<Project>{ccc1f6c7-e2ce-47b3-bd64-8efd17823e20}</Project>
147+
<Name>StorageSDK</Name>
148+
</ProjectReference>
185149
</ItemGroup>
186150
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
187151
<Import Project="..\..\..\..\..\tools\Common.Dependencies.targets" />
@@ -191,4 +155,4 @@
191155
</ItemGroup>
192156
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="$(OutputPath)\help\" ContinueOnError="false" />
193157
</Target>
194-
</Project>
158+
</Project>

src/ResourceManager/Storage/Stack/Commands.Management.Storage/StorageAccount/NewAzureStorageAccount.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System.Collections;
1616
using System.Management.Automation;
17-
//using Microsoft.Azure.Commands.Tags.Model;
1817
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
1918
using Microsoft.Azure.Management.Storage;
2019
using Microsoft.Azure.Management.Storage.Models;
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
4-
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net452" />
5-
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net452" />
6-
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net452" />
7-
<package id="System.Spatial" version="5.8.2" targetFramework="net452" />
8-
<package id="WindowsAzure.Storage" version="8.6.0" targetFramework="net452" />
9-
</packages>
4+
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net40" />
5+
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net40" />
6+
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net40" />
7+
<package id="System.Spatial" version="5.8.2" targetFramework="net40" />
8+
<package id="WindowsAzure.Storage" version="8.6.0" targetFramework="net45" />
9+
</packages>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Storage.Models
1010
{
1111
using Newtonsoft.Json;
1212
using Newtonsoft.Json.Converters;
13+
using Newtonsoft.Json.Linq;
1314
using System.Runtime.Serialization;
1415

1516
/// <summary>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
// General Information about an assembly is controlled through the following
20+
// set of attributes. Change these attribute values to modify the information
21+
// associated with an assembly.
22+
[assembly: AssemblyTitle("Microsoft.Azure.Management.Storage")]
23+
[assembly: AssemblyDescription("")]
24+
[assembly: AssemblyConfiguration("")]
25+
[assembly: AssemblyCompany("")]
26+
[assembly: AssemblyProduct("Microsoft.Azure.Management.Storage")]
27+
[assembly: AssemblyCopyright("Copyright © 2018")]
28+
[assembly: AssemblyTrademark("")]
29+
[assembly: AssemblyCulture("")]
30+
31+
// Setting ComVisible to false makes the types in this assembly not visible
32+
// to COM components. If you need to access a type in this assembly from
33+
// COM, set the ComVisible attribute to true on that type.
34+
[assembly: ComVisible(false)]
35+
36+
// The following GUID is for the ID of the typelib if this project is exposed to COM
37+
[assembly: Guid("15fc0119-dd3b-4167-b458-7202c89d397d")]
38+
39+
// Version information for an assembly consists of the following four values:
40+
//
41+
// Major Version
42+
// Minor Version
43+
// Build Number
44+
// Revision
45+
//
46+
// You can specify all the values or you can default the Build and Revision Numbers
47+
// by using the '*' as shown below:
48+
49+
[assembly: AssemblyVersion("1.0.0")]
50+
[assembly: AssemblyFileVersion("1.0.0")]
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
5+
<PropertyGroup>
6+
<Configurations>Debug;Release</Configurations>
7+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8+
<Platform>AnyCPU</Platform>
9+
<ProjectGuid>ccc1f6c7-e2ce-47b3-bd64-8efd17823e20</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>Microsoft.Azure.Management.Storage</RootNamespace>
13+
<AssemblyName>Microsoft.Azure.Management.Storage</AssemblyName>
14+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15+
<FileAlignment>512</FileAlignment>
16+
<TargetFrameworkProfile />
17+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
18+
<RestorePackages>true</RestorePackages>
19+
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
20+
</PropertyGroup>
21+
22+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>..\..\..\..\Stack\Debug\ResourceManager\AzureResourceManager\StorageSDK\</OutputPath>
27+
<DefineConstants>DEBUG;TRACE</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<RunCodeAnalysis>true</RunCodeAnalysis>
31+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
32+
<Prefer32Bit>false</Prefer32Bit>
33+
</PropertyGroup>
34+
35+
36+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
37+
<OutputPath>..\..\..\..\Stack\Release\ResourceManager\AzureResourceManager\StorageSDK</OutputPath>
38+
<DefineConstants>TRACE;SIGN</DefineConstants>
39+
<Optimize>true</Optimize>
40+
<DebugType>pdbonly</DebugType>
41+
<PlatformTarget>AnyCPU</PlatformTarget>
42+
<ErrorReport>prompt</ErrorReport>
43+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
44+
<SignAssembly>true</SignAssembly>
45+
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
46+
<DelaySign>true</DelaySign>
47+
<Prefer32Bit>false</Prefer32Bit></PropertyGroup>
48+
49+
<ItemGroup>
50+
<Compile Include="Generated\**\*.cs" />
51+
</ItemGroup>
52+
53+
<ItemGroup>
54+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
55+
<SpecificVersion>False</SpecificVersion>
56+
<HintPath>..\..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
57+
</Reference>
58+
<Reference Include="System" />
59+
<Reference Include="System.Core" />
60+
<Reference Include="System.Net" />
61+
<Reference Include="System.Net.Http" />
62+
<Reference Include="System.Runtime.Serialization" />
63+
64+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>..\..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.11\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.12\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
69+
</Reference>
70+
</ItemGroup>
71+
72+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
73+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
4+
<package id="Microsoft.Rest.ClientRuntime" version="2.3.11" targetFramework="net452" />
5+
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.12" targetFramework="net452" />>
6+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
7+
</packages>

0 commit comments

Comments
 (0)