Skip to content

Commit d9f5bcc

Browse files
author
Jianghao Lu
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into dev
Conflicts: src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj src/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs src/Common/Commands.ResourceManager.Common/Properties/Resources.resx src/ResourceManager.sln
2 parents 3ffbfd5 + 28ea1a2 commit d9f5bcc

File tree

38 files changed

+581
-100
lines changed

38 files changed

+581
-100
lines changed

src/Common/Commands.Common/ProfileClient.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Microsoft.Azure.Common.Authentication
3232
/// </summary>
3333
public class ProfileClient
3434
{
35-
public AzureRMProfile Profile { get; private set; }
35+
public AzureSMProfile Profile { get; private set; }
3636

3737
public Action<string> WarningLog;
3838

@@ -129,12 +129,12 @@ private void UpgradeProfile()
129129
// In case that we changed a disk profile, reload it
130130
if (Profile != null && Profile.ProfilePath == newProfileFilePath)
131131
{
132-
Profile = new AzureRMProfile(Profile.ProfilePath);
132+
Profile = new AzureSMProfile(Profile.ProfilePath);
133133
}
134134
}
135135
}
136136

137-
public ProfileClient(AzureRMProfile profile)
137+
public ProfileClient(AzureSMProfile profile)
138138
{
139139
Profile = profile;
140140
WarningLog = (s) => Debug.WriteLine(s);
@@ -330,16 +330,16 @@ public AzureAccount AddAccountAndLoadSubscriptions(AzureAccount account, AzureEn
330330
AddOrSetSubscription(subscription);
331331
}
332332

333-
if (Profile.DefaultContext.Subscription == null)
333+
if (Profile.DefaultSubscription == null)
334334
{
335-
var firstSubscription = Profile.DefaultContext.Subscription.Values.FirstOrDefault();
335+
var firstSubscription = Profile.Subscriptions.Values.FirstOrDefault();
336336
if (firstSubscription != null)
337337
{
338338
SetSubscriptionAsDefault(firstSubscription.Name, firstSubscription.Account);
339339
}
340340
}
341341

342-
return Profile.DefaultContext.Account;
342+
return Profile.Accounts[account.Id];
343343
}
344344
else
345345
{

src/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,21 @@ protected override void PromptForDataCollectionProfileIfNotExists()
117117

118118
protected override void InitializeQosEvent()
119119
{
120-
QosEvent = new AzurePSQoSEvent()
121-
{
122-
CmdletType = this.GetType().Name,
123-
IsSuccess = true,
124-
};
125-
126-
if (this.DefaultContext != null && this.DefaultContext.Subscription != null)
127-
{
128-
QosEvent.Uid = MetricHelper.GenerateSha256HashString(
129-
this.DefaultContext.Subscription.Id.ToString());
130-
}
131-
else
132-
{
133-
QosEvent.Uid = "defaultid";
134-
}
120+
//QosEvent = new AzurePSQoSEvent()
121+
//{
122+
// CmdletType = this.GetType().Name,
123+
// IsSuccess = true,
124+
//};
125+
126+
//if (this.DefaultContext != null && this.DefaultContext.Subscription != null)
127+
//{
128+
// QosEvent.Uid = MetricHelper.GenerateSha256HashString(
129+
// this.DefaultContext.Subscription.Id.ToString());
130+
//}
131+
//else
132+
//{
133+
// QosEvent.Uid = "defaultid";
134+
//}
135135
}
136136
}
137137
}

src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,40 +167,38 @@
167167
<Compile Include="..\Commands.Common\PowerShellUtilities.cs">
168168
<Link>Common\PowerShellUtilities.cs</Link>
169169
</Compile>
170-
<Compile Include="..\Commands.Common\ProfileClient.cs">
171-
<Link>Common\ProfileClient.cs</Link>
172-
</Compile>
173170
<Compile Include="..\Commands.Common\ProfileClientExtensions.cs">
174171
<Link>Common\ProfileClientExtensions.cs</Link>
175172
</Compile>
176173
<Compile Include="..\Commands.Common\PSAzureAccount.cs">
177174
<Link>Common\PSAzureAccount.cs</Link>
178175
</Compile>
179-
<Compile Include="..\Commands.Common\PublishSettingsImporter.cs">
180-
<Link>Common\PublishSettingsImporter.cs</Link>
181-
</Compile>
182176
<Compile Include="..\Commands.Common\RecordingTracingInterceptor.cs">
183177
<Link>Common\RecordingTracingInterceptor.cs</Link>
184178
</Compile>
185179
<Compile Include="..\Commands.Common\SecureStringExtensions.cs">
186180
<Link>Common\SecureStringExtensions.cs</Link>
187181
</Compile>
182+
<Compile Include="..\Commands.Common\TestMockSupport.cs">
183+
<Link>Common\TestMockSupport.cs</Link>
184+
</Compile>
188185
<Compile Include="AzureRMCmdlet.cs" />
189-
<Compile Include="Common\TestMockSupport.cs" />
190186
<Compile Include="Properties\AssemblyInfo.cs" />
191187
<Compile Include="Properties\Resources.Designer.cs">
192188
<AutoGen>True</AutoGen>
193189
<DesignTime>True</DesignTime>
194190
<DependentUpon>Resources.resx</DependentUpon>
195191
</Compile>
192+
<Compile Include="RMProfileClient.cs" />
196193
<None Include="packages.config">
197194
<SubType>Designer</SubType>
198195
</None>
199196
</ItemGroup>
200197
<ItemGroup>
201198
<EmbeddedResource Include="Properties\Resources.resx">
202-
<Generator>ResXFileCodeGenerator</Generator>
199+
<Generator>PublicResXFileCodeGenerator</Generator>
203200
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
201+
<SubType>Designer</SubType>
204202
</EmbeddedResource>
205203
</ItemGroup>
206204
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

src/Common/Commands.ResourceManager.Common/Common/TestMockSupport.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Commands.ResourceManager.Common/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,7 @@ Select Y to enable data collection [Y/N]:</value>
148148
<data name="InvalidDefaultSubscription" xml:space="preserve">
149149
<value>No default subscription has been designated. Use Select-AzureSubscription -Default &lt;subscriptionName&gt; to set the default subscription.</value>
150150
</data>
151+
<data name="TenantNotFound" xml:space="preserve">
152+
<value>Tenant '{0}' was not found. Please verify that your account has access to this tenant.</value>
153+
</data>
151154
</root>

0 commit comments

Comments
 (0)