Skip to content

Commit bd4be66

Browse files
committed
Merge pull request #165 from Azure/dev
.
2 parents f411429 + 8d44f81 commit bd4be66

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/Diagnostics/SetAzureVMDiagnosticsExtension.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
using Microsoft.Azure.Management.Compute.Models;
2222
using Microsoft.WindowsAzure.Commands.Common.Storage;
2323
using Microsoft.WindowsAzure.Commands.Utilities.Common;
24-
using Microsoft.WindowsAzure.Management.Storage;
24+
using Microsoft.Azure.Commands.Management.Storage;
25+
using Microsoft.Azure.Management.Storage;
2526
using Newtonsoft.Json;
2627

2728
namespace Microsoft.Azure.Commands.Compute
@@ -37,7 +38,7 @@ public class SetAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionBase
3738
private const string VirtualMachineExtension = "Microsoft.Compute/virtualMachines/extensions";
3839
private const string IaaSDiagnosticsExtension = "IaaSDiagnostics";
3940
private const string ExtensionPublisher = "Microsoft.Azure.Diagnostics";
40-
private StorageManagementClient storageClient;
41+
private IStorageManagementClient storageClient;
4142

4243
[Parameter(
4344
Mandatory = true,
@@ -154,14 +155,14 @@ public string PrivateConfiguration
154155
}
155156
}
156157

157-
public StorageManagementClient StorageClient
158+
public IStorageManagementClient StorageClient
158159
{
159160
get
160161
{
161162
if (this.storageClient == null)
162163
{
163164
this.storageClient = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(
164-
DefaultProfile.Context, AzureEnvironment.Endpoint.ServiceManagement);
165+
DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);
165166
}
166167

167168
return this.storageClient;
@@ -201,15 +202,8 @@ protected string GetStorageKey()
201202

202203
if (!string.IsNullOrEmpty(StorageAccountName))
203204
{
204-
var storageAccount = this.StorageClient.StorageAccounts.Get(StorageAccountName);
205-
if (storageAccount != null)
206-
{
207-
var keys = this.StorageClient.StorageAccounts.GetKeys(StorageAccountName);
208-
if (keys != null)
209-
{
210-
storageKey = !string.IsNullOrEmpty(keys.PrimaryKey) ? keys.PrimaryKey : keys.SecondaryKey;
211-
}
212-
}
205+
var storageCredentials = StorageUtilities.GenerateStorageCredentials(this.StorageClient, this.ResourceGroupName, this.StorageAccountName);
206+
storageKey = storageCredentials.ExportBase64EncodedKey();
213207
}
214208

215209
return storageKey;

tools/Docs/Get-AllCommands/Get-AllCommands.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,9 @@ function Get-AllBuildServerCommands {
690690
rm .\Output -Recurse -Force -ErrorAction SilentlyContinue
691691

692692
#Comment these lines to selectivly build the output for either Service Management or Resource Manager
693-
Get-AllBuildServerCommands -OutputPath ".\Output" -ManifestFullName "..\..\..\src\Package\Debug\ServiceManagement\Azure\Azure.psd1"
693+
Get-AllBuildServerCommands -OutputPath ".\Output" -ManifestFullName "..\..\..\src\Package\Release\ServiceManagement\Azure\Azure.psd1"
694694
Get-AllBuildServerCommands -OutputPath ".\Output" -ManifestFullName "..\..\AzureRM\AzureRM.psd1"
695695

696-
$modules = (Get-ChildItem "..\..\..\src\Package\Debug\ResourceManager" -Recurse -Include "*.psd1" -Exclude "*dll-help.psd1", "AzureResourceManager.psd1") | sort -Unique -Property Name
696+
$modules = (Get-ChildItem "..\..\..\src\Package\Release\ResourceManager" -Recurse -Include "*.psd1" -Exclude "*dll-help.psd1", "AzureResourceManager.psd1") | sort -Unique -Property Name
697697
$modules | Foreach { Get-AllBuildServerCommands -OutputPath ".\Output" -ManifestFullName $_.FullName }
698698

0 commit comments

Comments
 (0)