SetAzureSubscription() public method

public SetAzureSubscription ( string subscriptionName, string currentStorageAccount ) : SubscriptionData
subscriptionName string
currentStorageAccount string
return SubscriptionData
        public static void SetDefaultStorage()
        {
            if (!string.IsNullOrEmpty(GetDefaultStorage(CredentialHelper.DefaultStorageName, CredentialHelper.Location)))
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetAzureSubscription(defaultAzureSubscription.SubscriptionName, CredentialHelper.DefaultStorageName);

                storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccount);
                Assert.AreEqual(defaultAzureSubscription.CurrentStorageAccount, storageAccountKey.StorageAccountName);
                blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(defaultAzureSubscription.CurrentStorageAccount)[0].Endpoints.ToArray())[0];
            }
            else
            {
                Console.WriteLine("Unable to get the default storege account");
            }
        }
        public static void AssemblyInit(TestContext context)
        {
            vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
            vmPowershellCmdlets.ImportAzurePublishSettingsFile();
            if (string.IsNullOrEmpty(Resource.DefaultSubscriptionName))
            {
                Console.WriteLine("No subscription is selected!");
            }
            else
            {
                defaultAzureSubscription = vmPowershellCmdlets.SetDefaultAzureSubscription(Resource.DefaultSubscriptionName);
                Assert.AreEqual(Resource.DefaultSubscriptionName, defaultAzureSubscription.SubscriptionName);

                if (defaultAzureSubscription.CurrentStorageAccount == null || Utilities.CheckRemove(vmPowershellCmdlets.GetAzureStorageAccount, defaultAzureSubscription.CurrentStorageAccount))
                {
                    string defaultStorage = Utilities.GetUniqueShortName("storage");
                    vmPowershellCmdlets.NewAzureStorageAccount(defaultStorage, Resource.Location);
                    defaultAzureSubscription = vmPowershellCmdlets.SetAzureSubscription(defaultAzureSubscription.SubscriptionName, defaultStorage);
                }

                storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccount);
                Assert.AreEqual(defaultAzureSubscription.CurrentStorageAccount, storageAccountKey.StorageAccountName);
                blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(defaultAzureSubscription.CurrentStorageAccount)[0].Endpoints.ToArray())[0];

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

                imageName = vmPowershellCmdlets.GetAzureVMImageName(new[] { "Windows", "testvmimage" }, false); // Get-AzureVMImage
                if (String.IsNullOrEmpty(imageName))
                {
                    Console.WriteLine("No image is selected!");
                }
                Console.WriteLine("Image Name: {0}", imageName);
            }
        }