diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs index bd99b91f13f8..a302f1f7af14 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs @@ -1596,14 +1596,16 @@ public string GetAzureVMImageName(string[] keywords, bool exactMatch = true, int Collection vmImages = GetAzureVMImage(); foreach (SM.OSImageContext image in vmImages) { - if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0 && - ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))) + if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0 + && ((diskSize == null) || (image.LogicalSizeInGB <= diskSize)) + && image.Location.Contains(CredentialHelper.Location)) return image.ImageName; } foreach (SM.OSImageContext image in vmImages) { - if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0 && - ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))) + if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0 + && ((diskSize == null) || (image.LogicalSizeInGB <= diskSize)) + && image.Location.Contains(CredentialHelper.Location)) return image.ImageName; } return null; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs index c0d4e43ced9b..9fe5e302a940 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs @@ -104,10 +104,11 @@ public static void SetDefaultStorage() if (!string.IsNullOrEmpty(GetDefaultStorage(CredentialHelper.DefaultStorageName, CredentialHelper.Location))) { defaultAzureSubscription = vmPowershellCmdlets.SetAzureSubscription(defaultAzureSubscription.SubscriptionName, defaultAzureSubscription.SubscriptionId, CredentialHelper.DefaultStorageName); + defaultAzureSubscription.CurrentStorageAccountName = CredentialHelper.DefaultStorageName; vmPowershellCmdlets.SelectAzureSubscription(defaultAzureSubscription.SubscriptionName, true); - storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccountName); - Assert.AreEqual(defaultAzureSubscription.CurrentStorageAccountName, storageAccountKey.StorageAccountName); - blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(defaultAzureSubscription.CurrentStorageAccountName)[0].Endpoints.ToArray())[0]; + storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(CredentialHelper.DefaultStorageName); + Assert.AreEqual(CredentialHelper.DefaultStorageName, storageAccountKey.StorageAccountName); + blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(CredentialHelper.DefaultStorageName)[0].Endpoints.ToArray())[0]; } else {