Exemple #1
0
        //--//

        public bool GetInputs(out CloudWebDeployInputs result)
        {
            result = new CloudWebDeployInputs( );

            result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );
            if (result.Credentials == null)
            {
                result = null;
                return(false);
            }

            ServiceBusNamespace selectedNamespace = AzureConsoleHelper.SelectNamespace(result.Credentials);

            if (selectedNamespace == null)
            {
                result = null;
                Console.WriteLine("Quiting...");
                return(false);
            }
            result.NamePrefix = selectedNamespace.Name;
            if (result.NamePrefix.EndsWith("-ns"))
            {
                result.NamePrefix = result.NamePrefix.Substring(0, result.NamePrefix.Length - 3);
            }

            result.SBNamespace        = selectedNamespace.Name;
            result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";

            result.Location = selectedNamespace.Region;

            return(true);
        }
Exemple #2
0
        //--//

        public bool GetInputs(out ClearResourcesInputs result)
        {
            result = new ClearResourcesInputs( );

            result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );
            if (result.Credentials == null)
            {
                result = null;
                return(false);
            }

            ServiceBusNamespace selectedNamespace = AzureConsoleHelper.SelectNamespace(result.Credentials,
                                                                                       "Please select namespace you want to clear resources for: ", "Enter manually (if Namespace was deleted but there are resources with the same name prefix).");

            if (selectedNamespace == null)
            {
                result = null;
                Console.WriteLine("Quiting...");
                return(false);
            }
            result.NamePrefix = selectedNamespace.Name;

            if (selectedNamespace.Region != null)
            {
                result.NamespaceExists = true;
                result.Location        = selectedNamespace.Region;
            }

            result.SBNamespace        = result.NamePrefix + "-ns";
            result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";

            return(true);
        }
Exemple #3
0
        //--//

        public bool GetInputs(out CloudWebDeployInputs result)
        {
            result = new CloudWebDeployInputs( );

            result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );
            if (result.Credentials == null)
            {
                result = null;
                return(false);
            }

            ServiceBusNamespace selectedNamespace = AzureConsoleHelper.SelectNamespace(result.Credentials);

            if (selectedNamespace == null)
            {
                result = null;
                Console.WriteLine("Quiting...");
                return(false);
            }
            result.NamePrefix = selectedNamespace.Name;
            result.Location   = selectedNamespace.Region;

            result.SBNamespace        = result.NamePrefix + "-ns";
            result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";

            result.EventHubNameDevices = "ehdevices";
            result.EventHubNameAlerts  = "ehalerts";

            return(true);
        }
        //--//

        public bool GetInputs(out CloudWebDeployInputs result)
        {
            result = new CloudWebDeployInputs( );

            result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );
            if (result.Credentials == null)
            {
                result = null;
                return(false);
            }

            ServiceBusNamespace selectedNamespace = AzureConsoleHelper.SelectNamespace(result.Credentials);

            if (selectedNamespace == null)
            {
                result = null;
                Console.WriteLine("Quiting...");
                return(false);
            }
            result.NamePrefix = selectedNamespace.Name;
            result.Location   = selectedNamespace.Region;

/*
 *          Console.WriteLine( "Need to select or not Transform flag." );
 *          Console.WriteLine( "If selected, the input and output file name will be \"web.config\" placed in Web project location." );
 *          Console.WriteLine( "Otherwise, input file name will be \"web.PublishTemplate.config\" and output - \"" +
 *              String.Format("web.{0}.config", result.NamePrefix) + "\".");
 *
 *          for( ;; )
 *          {
 *              Console.WriteLine( "Do you want to use Transform flag? (y/n)" );
 *
 *              string answer = Console.ReadLine( );
 *              string request = "not use";
 *              result.Transform = false;
 *              if( !string.IsNullOrEmpty( answer ) && answer.ToLower( ).StartsWith( "y" ) )
 *              {
 *                  result.Transform = true;
 *                  request = "use";
 *              }
 *              if( ConsoleHelper.Confirm( "Are you sure you want to " + request + " Transform flag?" ) )
 *              {
 *                  break;
 *              }
 *          }
 */
            result.SBNamespace        = result.NamePrefix + "-ns";
            result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";

            result.EventHubNameDevices = "ehdevices";
            result.EventHubNameAlerts  = "ehalerts";

            //result.WebSiteDirectory = "..\\..\\..\\..\\WebSite\\ConnectTheDotsWebSite"; // Default for running the tool from the bin/debug or bin/release directory (i.e within VS)
            return(true);
        }
Exemple #5
0
        //--//

        public bool GetInputs(out AzurePrepInputs result)
        {
            result             = new AzurePrepInputs( );
            result.Credentials = AzureConsoleHelper.GetUserSubscriptionCredentials( );

            if (result.Credentials == null)
            {
                result = null;
                return(false);
            }

            for ( ;;)
            {
                Console.WriteLine("Enter a name for Service Bus Namespace (only letters and digits, less than 17 chars long).");
                Console.WriteLine("(Note that fully qualified path may also be subject to further length restrictions.)");
                result.NamePrefix = Console.ReadLine( );
                if (string.IsNullOrEmpty(result.NamePrefix) || !CheckNamePrefix(result.NamePrefix))
                {
                    Console.WriteLine("Namespace prefix should contain only letters and digits and have length less than 17.");
                    continue;
                }
                if (ConsoleHelper.Confirm("Are you sure you want to create a namespace called " + result.NamePrefix + "?"))
                {
                    break;
                }
            }

            if (string.IsNullOrEmpty(result.NamePrefix))
            {
                result = null;
                return(false);
            }

            result.Location = SelectRegion(result);

            result.SBNamespace        = result.NamePrefix + "-ns";
            result.StorageAccountName = result.NamePrefix.ToLowerInvariant( ) + "storage";

            result.EventHubNameDevices = "ehdevices";
            result.EventHubNameAlerts  = "ehalerts";

            return(true);
        }