private static async Task SetupAndTearDownWebsite(ManagementControllerParameters managementControllerParameters)
        {
            using (ManagementController controller = new ManagementController(managementControllerParameters))
            {

                Console.WriteLine("1. Create WebSite named {0} in GeoRegion {1}", managementControllerParameters.WebSiteName, managementControllerParameters.GeoRegion);
                ConsoleContinuePrompt("CREATE WebSite");

                await controller.CreateWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("2. List WebSites");
                ConsoleContinuePrompt("LIST WebSites", false);

                LogWebsites(controller.GetWebSites());

                Console.WriteLine("...Complete"); 
                Console.WriteLine("3. Configure WebSite");
                ConsoleContinuePrompt("CONFIGURE WebSite");

                await controller.ConfigureWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("4. Publish WebSite");
                ConsoleContinuePrompt("PUBLISH WebSite", false);

                await controller.PublishWebSite();
                
                var webSiteUrl= @"http://" + managementControllerParameters.WebSiteName + ".azurewebsites.net";
                Console.WriteLine("...git publishing to {0} in progress. Site will be ready when git commands executed in opened command window", webSiteUrl);
                Console.WriteLine("5. Open WebSite in browser");
                ConsoleContinuePrompt("OPEN in browser", false);
                
                Process.Start(webSiteUrl);

                Console.WriteLine("...Complete");
                Console.WriteLine("6. Upgrade WebSite");
                ConsoleContinuePrompt("UPGRADE WebSite");

                await controller.UpgradeWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("7. Delete WebSite");
                ConsoleContinuePrompt("DELETE WebSite");

                await controller.TearDownWebSite();
            }
        }
Exemple #2
0
        private static async Task SetupAndTearDownWebsite(ManagementControllerParameters managementControllerParameters)
        {
            using (ManagementController controller = new ManagementController(managementControllerParameters))
            {
                Console.WriteLine("1. Create WebSite named {0} in GeoRegion {1}", managementControllerParameters.WebSiteName, managementControllerParameters.GeoRegion);
                ConsoleContinuePrompt("CREATE WebSite");

                await controller.CreateWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("2. List WebSites");
                ConsoleContinuePrompt("LIST WebSites", false);

                LogWebsites(controller.GetWebSites());

                Console.WriteLine("...Complete");
                Console.WriteLine("3. Configure WebSite");
                ConsoleContinuePrompt("CONFIGURE WebSite");

                await controller.ConfigureWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("4. Publish WebSite");
                ConsoleContinuePrompt("PUBLISH WebSite", false);

                await controller.PublishWebSite();

                var webSiteUrl = @"http://" + managementControllerParameters.WebSiteName + ".azurewebsites.net";
                Console.WriteLine("...git publishing to {0} in progress. Site will be ready when git commands executed in opened command window", webSiteUrl);
                Console.WriteLine("5. Open WebSite in browser");
                ConsoleContinuePrompt("OPEN in browser", false);

                Process.Start(webSiteUrl);

                Console.WriteLine("...Complete");
                Console.WriteLine("6. Upgrade WebSite");
                ConsoleContinuePrompt("UPGRADE WebSite");

                await controller.UpgradeWebSite();

                Console.WriteLine("...Complete");
                Console.WriteLine("7. Delete WebSite");
                ConsoleContinuePrompt("DELETE WebSite");

                await controller.TearDownWebSite();
            }
        }