Skip to content

Commit 704dead

Browse files
author
Hovsep
committed
Merge pull request Azure#1622 from hovsepm/release-1.1.0
Fixed Storage issue in NewAzureStorageContext.cs
2 parents 95c6d74 + 2437b6e commit 704dead

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Common/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ internal CloudStorageAccount GetStorageAccountWithAzureEnvironment(StorageCreden
338338
{
339339
AzureEnvironment azureEnvironment = null;
340340

341-
if (null != DefaultContext)
341+
if (null != SMProfile)
342342
{
343-
if (string.IsNullOrEmpty(azureEnvironmentName) )
343+
if (DefaultContext != null && string.IsNullOrEmpty(azureEnvironmentName))
344344
{
345345
azureEnvironment = DefaultContext.Environment;
346346

@@ -354,7 +354,7 @@ internal CloudStorageAccount GetStorageAccountWithAzureEnvironment(StorageCreden
354354
{
355355
try
356356
{
357-
var profileClient = new ProfileClient(new AzureSMProfile());
357+
var profileClient = new ProfileClient(SMProfile);
358358
azureEnvironment = profileClient.GetEnvironmentOrDefault(azureEnvironmentName);
359359
}
360360
catch(ArgumentException e)

0 commit comments

Comments
 (0)