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;