예제 #1
0
        public static PersistentVM CreateVMObjectWithDataDiskSubnetAndAvailibilitySet(string vmName, OS os, string username, string password, string subnet)
        {
            string disk1               = "Disk1";
            int    diskSize            = 30;
            string availabilitySetName = Utilities.GetUniqueShortName("AvailSet");
            string img = string.Empty;

            bool isWindowsOs = false;

            if (os == OS.Windows)
            {
                img         = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false);
                isWindowsOs = true;
            }
            else
            {
                img         = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Linux" }, false);
                isWindowsOs = false;
            }

            PersistentVM           vm = Utilities.CreateIaaSVMObject(vmName, InstanceSize.Small, img, isWindowsOs, username, password);
            AddAzureDataDiskConfig azureDataDiskConfigInfo1 = new AddAzureDataDiskConfig(DiskCreateOption.CreateNew, diskSize, disk1, 0, HostCaching.ReadWrite.ToString());

            azureDataDiskConfigInfo1.Vm = vm;

            vm = vmPowershellCmdlets.SetAzureSubnet(vm, new string[] { subnet });
            vm = vmPowershellCmdlets.SetAzureAvailabilitySet(availabilitySetName, vm);
            return(vm);
        }
        public static void SetTestSettings()
        {
            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            CredentialHelper.GetTestSettings(Resource.TestSettings);

            vmPowershellCmdlets.RemoveAzureSubscriptions();
            vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile);

            if (string.IsNullOrEmpty(CredentialHelper.DefaultSubscriptionName))
            {
                defaultAzureSubscription = vmPowershellCmdlets.GetCurrentAzureSubscription();
                if (string.IsNullOrEmpty(Resource.DefaultSubscriptionName))
                {
                    CredentialHelper.DefaultSubscriptionName = defaultAzureSubscription.SubscriptionName;
                }
            }
            else
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetDefaultAzureSubscription(CredentialHelper.DefaultSubscriptionName);
            }

            locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { CredentialHelper.Location }); // Get-AzureLocation

            if (String.IsNullOrEmpty(locationName))
            {
                Console.WriteLine("No location is selected!");
            }
            Console.WriteLine("Location Name: {0}", locationName);

            if (defaultAzureSubscription.CurrentStorageAccountName == null && !string.IsNullOrEmpty(CredentialHelper.DefaultStorageName))
            {
                SetDefaultStorage();
            }

            try
            {
                imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false); // Get-AzureVMImage
            }
            catch
            {
                Console.WriteLine("Error occurred during Get-AzureVMImageName... imageName is not set.");
            }

            if (String.IsNullOrEmpty(imageName))
            {
                Console.WriteLine("No image is selected!");
            }
            else
            {
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }
        [Ignore] // https://github.com/WindowsAzure/azure-sdk-tools/issues/1402
        public void NewWindowsAzureQuickVM()
        {
            powershell.Invoke();

            ServiceManagementCmdletTestHelper vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            
            string imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false);
            string locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { Resource.Location });

            string newAzureQuickVMName = Utilities.GetUniqueShortName("PSTestVM");
            string newAzureQuickVMSvcName = Utilities.GetUniqueShortName("PSTestService");

            vmPowershellCmdlets.NewAzureQuickVM(OS.Windows, newAzureQuickVMName, newAzureQuickVMSvcName, imageName, "pstestuser", "p@ssw0rd", locationName);

            // Verify
            PersistentVMRoleContext vmRoleCtxt = vmPowershellCmdlets.GetAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName);
            Assert.AreEqual(newAzureQuickVMName, vmRoleCtxt.Name, true);

            // Cleanup
            vmPowershellCmdlets.RemoveAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName);

            Assert.AreEqual(null, vmPowershellCmdlets.GetAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName));
        }
예제 #4
0
        [Ignore] // https://github.com/WindowsAzure/azure-sdk-tools/issues/1402
        public void NewWindowsAzureQuickVM()
        {
            powershell.Invoke();

            ServiceManagementCmdletTestHelper vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();

            string imageName    = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows", "testvmimage" }, false);
            string locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { Resource.Location }, false);

            string newAzureQuickVMName    = Utilities.GetUniqueShortName("PSTestVM");
            string newAzureQuickVMSvcName = Utilities.GetUniqueShortName("PSTestService");

            vmPowershellCmdlets.NewAzureQuickVM(OS.Windows, newAzureQuickVMName, newAzureQuickVMSvcName, imageName, "pstestuser", "p@ssw0rd", locationName);

            // Verify
            PersistentVMRoleContext vmRoleCtxt = vmPowershellCmdlets.GetAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName);

            Assert.AreEqual(newAzureQuickVMName, vmRoleCtxt.Name, true);

            // Cleanup
            vmPowershellCmdlets.RemoveAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName);

            Assert.AreEqual(null, vmPowershellCmdlets.GetAzureVM(newAzureQuickVMName, newAzureQuickVMSvcName));
        }
        public static void SetTestSettings()
        {
            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            CredentialHelper.GetTestSettings(Resource.TestSettings);

            vmPowershellCmdlets.RemoveAzureSubscriptions();
            vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile);

            if (string.IsNullOrEmpty(CredentialHelper.DefaultSubscriptionName))
            {
                defaultAzureSubscription = vmPowershellCmdlets.GetCurrentAzureSubscription();
                if (string.IsNullOrEmpty(Resource.DefaultSubscriptionName))
                {
                    CredentialHelper.DefaultSubscriptionName = defaultAzureSubscription.SubscriptionName;
                }
            }
            else
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetDefaultAzureSubscription(CredentialHelper.DefaultSubscriptionName);
            }

            locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { CredentialHelper.Location }); // Get-AzureLocation
            if (String.IsNullOrEmpty(locationName))
            {
                Console.WriteLine("No location is selected!");
            }
            Console.WriteLine("Location Name: {0}", locationName);

            if (defaultAzureSubscription.CurrentStorageAccountName == null && !string.IsNullOrEmpty(CredentialHelper.DefaultStorageName))
            {
                SetDefaultStorage();
            }

            imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false); // Get-AzureVMImage
            if (String.IsNullOrEmpty(imageName))
            {
                Console.WriteLine("No image is selected!");
            }
            else
            {
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }
        public static void SetTestSettings()
        {
            // Please remove this line once all tests are done
            System.Net.ServicePointManager.ServerCertificateValidationCallback +=
                delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
                    System.Security.Cryptography.X509Certificates.X509Chain chain,
                    System.Net.Security.SslPolicyErrors sslPolicyErrors)
                {
                    return true; // **** Always accept
                };

            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            CredentialHelper.GetTestSettings(Resource.TestSettings);

            vmPowershellCmdlets.RemoveAzureSubscriptions();
            var ussouthEnv = vmPowershellCmdlets.GetAzureEnvironment("ussouth");
            if (ussouthEnv != null && ussouthEnv.Count > 0)
            {
                Console.WriteLine("Removing ussouth environment...");
                vmPowershellCmdlets.RunPSScript("Remove-AzureEnvironment -Name ussouth -Force");
            }

            List<PSAzureEnvironment> environments = vmPowershellCmdlets.GetAzureEnvironment();
            var serviceManagementUrl = GetServiceManagementUrl(CredentialHelper.PublishSettingsFile);
            var subscriptionId = GetSubscriptionId(CredentialHelper.PublishSettingsFile);

            foreach (var env in environments)
            {
                if (!string.IsNullOrEmpty(env.ServiceManagementUrl))
                {
                    if (env.ServiceManagementUrl.Equals(serviceManagementUrl))
                    {
                        currentEnvName = env.Name;
                        var curEnv = vmPowershellCmdlets.GetAzureEnvironment(currentEnvName)[0];
                        Console.WriteLine("Using the existing environment: {0}", currentEnvName);
                        Console.WriteLine("PublichSettingsFileUrl: {0}", curEnv.PublishSettingsFileUrl);
                        Console.WriteLine("ServiceManagement: {0}", curEnv.ServiceManagementUrl);
                        Console.WriteLine("ManagementPortalUrl: {0}", curEnv.ManagementPortalUrl);
                        Console.WriteLine("ActiveDirectory: {0}", curEnv.ActiveDirectoryAuthority);
                        Console.WriteLine("ActiveDirectoryServiceEndpointResourceId: {0}", curEnv.ActiveDirectoryServiceEndpointResourceId);
                        Console.WriteLine("ResourceManager: {0}", curEnv.ResourceManagerUrl);
                        Console.WriteLine("Gallery: {0}", curEnv.GalleryUrl);
                        Console.WriteLine("Graph: {0}", curEnv.GalleryUrl);
                        break;
                    }
                }
            }

            if (string.IsNullOrEmpty(currentEnvName))
            {
                Console.WriteLine("Creating new environment... : {0}", TempEnvName);
                var prodEnv = vmPowershellCmdlets.GetAzureEnvironment("AzureCloud")[0];
                vmPowershellCmdlets.RunPSScript(string.Format(
                    @"Add-AzureEnvironment -Name {0} `
                    -PublishSettingsFileUrl {1} `
                    -ServiceEndpoint {2} `
                    -ManagementPortalUrl {3} `
                    -ActiveDirectoryEndpoint {4} `
                    -ActiveDirectoryServiceEndpointResourceId {5} `
                    -ResourceManagerEndpoint {6} `
                    -GalleryEndpoint {7} `
                    -GraphEndpoint {8}",
                    TempEnvName,
                    prodEnv.PublishSettingsFileUrl,
                    serviceManagementUrl,
                    prodEnv.ManagementPortalUrl,
                    prodEnv.ActiveDirectoryAuthority,
                    prodEnv.ActiveDirectoryServiceEndpointResourceId,
                    prodEnv.ResourceManagerUrl,
                    prodEnv.GalleryUrl,
                    prodEnv.GalleryUrl));

                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, TempEnvName);
            }
            else
            {
                Console.WriteLine("Using existing environment... : {0}", currentEnvName);
                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, currentEnvName);
            }

            var firstSub = vmPowershellCmdlets.GetAzureSubscription(subscriptionId);
            vmPowershellCmdlets.SelectAzureSubscription(firstSub.SubscriptionId);
            defaultAzureSubscription = vmPowershellCmdlets.GetCurrentAzureSubscription();
            CredentialHelper.DefaultSubscriptionName = defaultAzureSubscription.SubscriptionName;

            locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { CredentialHelper.Location }); // Get-AzureLocation

            if (String.IsNullOrEmpty(locationName))
            {
                Console.WriteLine("No location is selected!");
            }
            Console.WriteLine("Location Name: {0}", locationName);

            if (defaultAzureSubscription.CurrentStorageAccountName == null && !string.IsNullOrEmpty(CredentialHelper.DefaultStorageName))
            {
                SetDefaultStorage();
            }

            try
            {
                imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false); // Get-AzureVMImage
            }
            catch
            {
                Console.WriteLine("Error occurred during Get-AzureVMImageName... imageName is not set.");
            }

            if (String.IsNullOrEmpty(imageName))
            {
                Console.WriteLine("No image is selected!");
            }
            else
            {
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }
예제 #7
0
        public static void SetTestSettings()
        {
            // Please remove this line once all tests are done
            System.Net.ServicePointManager.ServerCertificateValidationCallback +=
                delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
                         System.Security.Cryptography.X509Certificates.X509Chain chain,
                         System.Net.Security.SslPolicyErrors sslPolicyErrors)
            {
                return(true);    // **** Always accept
            };

            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            CredentialHelper.GetTestSettings(Resource.TestSettings);

            vmPowershellCmdlets.RemoveAzureSubscriptions();
            if (vmPowershellCmdlets.GetAzureEnvironment("ussouth").Count > 0)
            {
                Console.WriteLine("Removing ussouth environment...");
                vmPowershellCmdlets.RunPSScript("Remove-AzureEnvironment -Name ussouth -Force");
            }

            List <AzureEnvironment> environments = vmPowershellCmdlets.GetAzureEnvironment();
            var serviceManagementUrl             = GetServiceManagementUrl(CredentialHelper.PublishSettingsFile);

            foreach (var env in environments)
            {
                var envServiceManagementUrl = (string)env.Endpoints[AzureEnvironment.Endpoint.ServiceManagement];
                if (!string.IsNullOrEmpty(envServiceManagementUrl))
                {
                    if (envServiceManagementUrl.Equals(serviceManagementUrl))
                    {
                        currentEnvName = env.Name;
                        var curEnv = vmPowershellCmdlets.GetAzureEnvironment(currentEnvName)[0];
                        Console.WriteLine("Using the existing environment: {0}", currentEnvName);
                        Console.WriteLine("PublichSettingsFileUrl: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.PublishSettingsFileUrl));
                        Console.WriteLine("ServiceManagement: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ServiceManagement));
                        Console.WriteLine("ManagementPortalUrl: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ManagementPortalUrl));
                        Console.WriteLine("ActiveDirectory: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectory));
                        Console.WriteLine("ActiveDirectoryServiceEndpointResourceId: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId));
                        Console.WriteLine("ResourceManager: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager));
                        Console.WriteLine("Gallery: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.Gallery));
                        Console.WriteLine("Graph: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.Graph));
                        break;
                    }
                }
            }

            if (string.IsNullOrEmpty(currentEnvName))
            {
                Console.WriteLine("Creating new environment... : {0}", TempEnvName);
                var prodEnv = vmPowershellCmdlets.GetAzureEnvironment("AzureCloud")[0];
                vmPowershellCmdlets.RunPSScript(string.Format(
                                                    @"Add-AzureEnvironment -Name {0} `
                    -PublishSettingsFileUrl {1} `
                    -ServiceEndpoint {2} `
                    -ManagementPortalUrl {3} `
                    -ActiveDirectoryEndpoint {4} `
                    -ActiveDirectoryServiceEndpointResourceId {5} `
                    -ResourceManagerEndpoint {6} `
                    -GalleryEndpoint {7} `
                    -GraphEndpoint {8}",
                                                    TempEnvName,
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.PublishSettingsFileUrl),
                                                    serviceManagementUrl,
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ManagementPortalUrl),
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectory),
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId),
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager),
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.Gallery),
                                                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.Graph)));

                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, TempEnvName);
            }
            else
            {
                Console.WriteLine("Using existing environment... : {0}", currentEnvName);
                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, currentEnvName);
            }

            var firstSub = vmPowershellCmdlets.GetAzureSubscription().First();

            vmPowershellCmdlets.SelectAzureSubscription(firstSub.SubscriptionName);

            if (string.IsNullOrEmpty(CredentialHelper.DefaultSubscriptionName))
            {
                defaultAzureSubscription = vmPowershellCmdlets.GetCurrentAzureSubscription();
                if (string.IsNullOrEmpty(Resource.DefaultSubscriptionName))
                {
                    CredentialHelper.DefaultSubscriptionName = defaultAzureSubscription.SubscriptionName;
                }
            }
            else
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetDefaultAzureSubscription(CredentialHelper.DefaultSubscriptionName);
            }

            locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { CredentialHelper.Location }); // Get-AzureLocation

            if (String.IsNullOrEmpty(locationName))
            {
                Console.WriteLine("No location is selected!");
            }
            Console.WriteLine("Location Name: {0}", locationName);

            if (defaultAzureSubscription.CurrentStorageAccountName == null && !string.IsNullOrEmpty(CredentialHelper.DefaultStorageName))
            {
                SetDefaultStorage();
            }

            try
            {
                imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false); // Get-AzureVMImage
            }
            catch
            {
                Console.WriteLine("Error occurred during Get-AzureVMImageName... imageName is not set.");
            }

            if (String.IsNullOrEmpty(imageName))
            {
                Console.WriteLine("No image is selected!");
            }
            else
            {
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }
        public static void SetTestSettings()
        {
            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            CredentialHelper.GetTestSettings(Resource.TestSettings);

            vmPowershellCmdlets.RemoveAzureSubscriptions();
            if (vmPowershellCmdlets.GetAzureEnvironment("ussouth").Count > 0)
            {
                Console.WriteLine("Removing ussouth environment...");
                vmPowershellCmdlets.RunPSScript("Remove-AzureEnvironment -Name ussouth -Force");
            }

            List<AzureEnvironment> environments =  vmPowershellCmdlets.GetAzureEnvironment();
            var serviceManagementUrl = GetServiceManagementUrl(CredentialHelper.PublishSettingsFile);

            foreach (var env in environments)
            {
                var envServiceManagementUrl = (string) env.Endpoints[AzureEnvironment.Endpoint.ServiceManagement];
                if (!string.IsNullOrEmpty(envServiceManagementUrl))
                {
                    if (envServiceManagementUrl.Equals(serviceManagementUrl))
                    {
                        currentEnvName = env.Name;
                        var curEnv = vmPowershellCmdlets.GetAzureEnvironment(currentEnvName)[0];
                        Console.WriteLine("Using the existing environment: {0}", currentEnvName);
                        Console.WriteLine("PublichSettingsFileUrl: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.PublishSettingsFileUrl));
                        Console.WriteLine("ServiceManagement: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ServiceManagement));
                        Console.WriteLine("ManagementPortalUrl: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ManagementPortalUrl));
                        Console.WriteLine("ActiveDirectory: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectory));
                        Console.WriteLine("ActiveDirectoryServiceEndpointResourceId: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId));
                        Console.WriteLine("ResourceManager: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager));
                        Console.WriteLine("Gallery: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.Gallery));
                        Console.WriteLine("Graph: {0}", curEnv.GetEndpoint(AzureEnvironment.Endpoint.Graph));
                        break;
                    }
                }
            }

            if (string.IsNullOrEmpty(currentEnvName))
            {
                Console.WriteLine("Creating new environment... : {0}", TempEnvName);
                var prodEnv = vmPowershellCmdlets.GetAzureEnvironment("AzureCloud")[0];
                vmPowershellCmdlets.RunPSScript(string.Format(
                    @"Add-AzureEnvironment -Name {0} `
                    -PublishSettingsFileUrl {1} `
                    -ServiceEndpoint {2} `
                    -ManagementPortalUrl {3} `
                    -ActiveDirectoryEndpoint {4} `
                    -ActiveDirectoryServiceEndpointResourceId {5} `
                    -ResourceManagerEndpoint {6} `
                    -GalleryEndpoint {7} `
                    -GraphEndpoint {8}",
                    TempEnvName,
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.PublishSettingsFileUrl),
                    serviceManagementUrl,
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ManagementPortalUrl),
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectory),
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId),
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager),
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.Gallery),
                    prodEnv.GetEndpoint(AzureEnvironment.Endpoint.Graph)));

                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, TempEnvName);
            }
            else
            {
                Console.WriteLine("Using existing environment... : {0}", currentEnvName);
                vmPowershellCmdlets.ImportAzurePublishSettingsFile(CredentialHelper.PublishSettingsFile, currentEnvName);
            }

            var firstSub = vmPowershellCmdlets.GetAzureSubscription().First();
            vmPowershellCmdlets.SelectAzureSubscription(firstSub.SubscriptionName);

            if (string.IsNullOrEmpty(CredentialHelper.DefaultSubscriptionName))
            {
                defaultAzureSubscription = vmPowershellCmdlets.GetCurrentAzureSubscription();
                if (string.IsNullOrEmpty(Resource.DefaultSubscriptionName))
                {
                    CredentialHelper.DefaultSubscriptionName = defaultAzureSubscription.SubscriptionName;
                }
            }
            else
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetDefaultAzureSubscription(CredentialHelper.DefaultSubscriptionName);
            }

            locationName = vmPowershellCmdlets.GetAzureLocationName(new[] { CredentialHelper.Location }); // Get-AzureLocation

            if (String.IsNullOrEmpty(locationName))
            {
                Console.WriteLine("No location is selected!");
            }
            Console.WriteLine("Location Name: {0}", locationName);

            if (defaultAzureSubscription.CurrentStorageAccountName == null && !string.IsNullOrEmpty(CredentialHelper.DefaultStorageName))
            {
                SetDefaultStorage();
            }

            try
            {
                imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows" }, false); // Get-AzureVMImage
            }
            catch
            {
                Console.WriteLine("Error occurred during Get-AzureVMImageName... imageName is not set.");
            }

            if (String.IsNullOrEmpty(imageName))
            {
                Console.WriteLine("No image is selected!");
            }
            else
            {
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }