Azure / azure-libraries-for-java

Azure Management Libraries for Java
https://docs.microsoft.com/en-us/java/azure/
MIT License
94 stars 98 forks source link

appservice OneDeploy #1292

Closed weidongxu-microsoft closed 3 years ago

weidongxu-microsoft commented 3 years ago

API review.

Not fully tested, but at least this works for tomcat.

            WebApp app = azure.webApps().getByResourceGroup("rg-weidxu", "wa1weidxu");
            app.deploy(DeployType.ZIP, new File(ManageWebAppBasic.class.getResource("/helloworld.zip").getPath()));
            app.deploy(DeployType.WAR, new File(ManageWebAppBasic.class.getResource("/helloworld.war").getPath()), new DeployOptions().withPath("webapps/app1"));

And this works for java SE.

            app.deploy(DeployType.JAR, new File(ManageWebAppBasic.class.getResource("/some_sprint_app.jar").getPath()));

PS: OneDeploy https://github.com/shrishrirang/onedeploy

weidongxu-microsoft commented 3 years ago

At present, not able to add live test, since web app is not ready (until about Nov.), manually script need to be called to prepare the site (https://github.com/shrishrirang/onedeploy/blob/master/setup/windows/README.md).

weidongxu-microsoft commented 3 years ago

DeploymentSlot

            slot.deploy(DeployType.ZIP, new File(ManageWebAppBasic.class.getResource("/helloworld.zip").getPath()), new DeployOptions().withCleanDeployment(true));
            slot.deploy(DeployType.JAR_LIB, new File("C:\\github_fork\\autorest.java\\preprocessor\\target\\preprocessor.jar"), new DeployOptions().withPath("preprocessor.jar"));
            slot.deploy(DeployType.STATIC, new File("C:\\github_fork\\autorest.java\\generate.bat"), new DeployOptions().withPath("generate.bat"));
            slot.deploy(DeployType.SCRIPT_STARTUP, new File("C:\\github_fork\\autorest.java\\generate.bat"));
weidongxu-microsoft commented 3 years ago

Manual test is good. @xccc-msft @ChenTanyi