This topic describes how to create an app in App Studio and deploy it in the production environment to make it accessible through the Internet.
Go to App Studio
Create a project
- Log on to the DataWorks console and click Go to Data Development next to a workspace.
- Click the icon in the upper-left corner and hover the cursor over All products. Choose .
- On the App Studio page, create a template-based or code-based project or import a project from Git.
- Set project parameters as needed and click Submit.
Associate your project with Git
Before publishing an app, you need to initialize Git.
- Create a repo on code.aliyun.com and take down the SSH URL of the repo.
- Go to App Studio and click Version. Select Connect to Remote Repo.
- In the Connect to Remote Repo dialog box that appears, set parameters and click Submit.
Note If you have not bound an SSH key or Git email address, follow the instructions on the page.
Publish the app
After associating your project with Git, you can create an app through Publish New Version.
- Return to the Projects page and click Manage on the project card.
- On the project management page that appears, click Publish New Version in the upper-right corner. In the dialog box that appears, select the app for which a new version needs to be published.
- Click Publish.
Deploy the app
- After you click Publish, a guide page appears, as shown in the following figure.
Go to the purchase page and purchase an App Studio workspace. Go to App Studio, create an ECS group, and then add the purchased ECS instance to the ECS group.
- Click Purchase Link. On the page that appears, follow the instructions to purchase an App Studio workspace in your specified region.
- Click Manage Deployment on the app card to go to the app O&M page.
Note You need to unbind the host bound previously.
- Click Create ECS Group in the upper-right corner of the ECS Group List area and create an ECS group.
- Choose . In the dialog box that appears, add the ECS instance you just purchased to the newly created ECS group.
- After the Apps page is refreshed, click Publish to publish the app to the default ECS group.
The app has been deployed on your ECS instance and started to provide services.
Perform VPC deployment
VPC deployment refers to adding a VPC to the CIDR block of your purchased ECS instance. You need to perform VPC deployment for each project on Alibaba Cloud and App Studio. However, you need to perform this operation only once for each project. When there is an iterative version, you only need to deploy the app. For more information, see the preceding section.
Authorize VPC access
An ECS instance used for publishing apps in App Studio connects to your VPC through an ENI. You need to grant your service account of App Studio the permission to manage ENIs.
- Go to the RAM Roles page and click Create RAM Role. Select Alibaba Cloud Account and click Next. Select Other Alibaba Cloud Account and enter 1591568227964362. Enter a custom name in RAM Role Name and click OK.
Note You must enter 1591568227964362 in Other Alibaba Cloud Account.
- Click Add permissions for the newly created RAM role in the Actions column. Grant the RAM role the AliyunECSNetworkInterfaceManagement permission to manage ENIs. Then, click OK.
- Click the RAM role and view the ARN.
Create a VPC and a VSwitch
You must create a VPC and a VSwitch in the region to which your App Studio workspace belongs. Here, China (Shanghai) is used as example.
After the VSwitch is created, take down the VSwitch ID on the VSwitch page for later use.
Create a security group
After the security group is created, take down the security group ID for later use.
Add the VPC in App Studio
- Click O&M in the upper-right corner of the App Studio page.
- Choose Add VPC. and click
- In the Add VPC dialog box that appears, enter the recorded ARN, security group ID, and VSwitch ID in Role ID, Security Group ID, and VSwitch ID, respectively. Provide a brief description of your operation.
- Click Run.
Create an ENI and associate it with an ECS instance
- Click the ID of your VPC to go to the ENI management page.
- Click Add ENI.
- After the ENI is added, click Associate with ECS instance.
- In the Associate with ECS instance dialog box that appears, set VpcID, EniID, ECS Group, and ECS Instance.
After the preceding operations are performed, App Studio creates an ENI for you and associates it with the specified ECS instance.
Enable access from the Internet
Next, you can associate the ENI with an elastic IP address to expose the app to the Internet. You can also enable SLB in this procedure.
The procedure for associating the ENI with an elastic IP address is as follows: