GitHub Application investigation
This repository is used to investigate deploying to Azure Spring Apps with one endpoint.
Steps to Run this application
- Fill
client-id
andclient-secret
in application.yml. - Start
AzureSpringAppsDeployerApplication
. - Access endpoint like
http://localhost:8080/deployer?gitHubRepoUrl=https%3A%2F%2Fgithub.com%2Fchenrujun%2Fazure-spring-apps-deployer-target-application%2F&moduleName=hello-world
. - Login with your microsoft account. Note: MSFT account can not be used. For example: rujche@microsoft.com can not be used, it may require admin permission. Account like rujun@806258199qq.onmicrosoft.com is OK. The reason can be found here.
- After few minutes(5 - 10 minutes), you will get response like this:
https://deployer-service-202205052030-deployer-app-202205052030.azuremicroservices.io
- Access the URL you got in previous step, you will get response successfully. It means the application has deployed to Azure Spring Cloud successfully.
Workaround in Current Implementation
Check the source code of AzureSpringAppsDeployerService#deployAzureSpringApps
. There are 2 ways to get source code file:
- https://github.com/weidongxu-microsoft/azure-sdk-for-java-management-tests/raw/master/spring-cloud/piggymetrics.tar.gz
- https://github.com/chenrujun/azure-spring-apps-deployer-target-application/archive/refs/heads/master.tar.gz
1
can work but 2
can not. Because after unzipping the second file, all files are included in a folder. To use the source-code deploy, there should be a file like "pom.xml" in the root path. All files included in a folder will hide the "pom.xml" file.
Further steps:
- Fix the problem: GitHub downloaded tar.gz file contains a root folder, which make it can not be deployed directly.
- Support deploy by clicking button in GitHub README. Get GitHub url by Referer header instead of request parameter.
- Support choosing
subscription / resource-group / Azure Spring Cloud service
before deploy. - Make module name optional. Support single module project.
- Give more information when deploying. For example, show deploy status.
- Support open the deployed app automatically.