This document describes how to use DMS to purchase and configure the required resources for Dify with account-based logon in one click, including a metadatabase, Redis, and vector database instances.
Usage notes
-
This feature is available only in the China (Hangzhou), China (Hong Kong), Singapore, Indonesia (Jakarta), and Japan (Tokyo) regions.
-
Resources are billed based on the specifications you select. The price shown on the purchase page at the time of order placement is final. For more information, see Billable items (DMS).
-
Instances purchased with one-click deployment are automatically added to DMS with security hosting enabled. The default control mode of the instances is Flexible Management.
Procedure
1. Check and grant permissions
Before deployment, ensure your account has the required permissions to access and create resources. If a permission is missing, click the Grant Permission button on the deployment page to grant it.
-
Your account must have the following permissions:
-
AliyunDMSFullAccess -
AliyunRAMReadOnlyAccess -
AliyunECSReadOnlyAccess -
AliyunVPCReadOnlyAccess -
AliyunComputeNestUserReadOnlyAccess -
AliyunROSReadOnlyAccess -
AliyunGPDBReadOnlyAccess -
AliyunRDSReadOnlyAccess -
AliyunKvstoreReadOnlyAccess
-
-
To import existing database resources, you must meet the following requirements in addition to the read-only permissions listed above:
-
You must have the Administrator or Database Administrator (DBA) role in DMS.
-
The relational database, Redis, and vector database instances that you want to import must already be registered in DMS.
-
Security hosting must be enabled for all instances.
-
2. Go to the deployment page
Log on to the Alibaba Cloud console and go to the Dify on DMS deployment page.
3. Configure deployment parameters
On the deployment page, configure the parameters in the following sections.
Basic configurations
These parameters define the basic properties and billing method for the service.
|
Parameter |
Description |
|
Billing method |
The billing method for the service. Different billing methods affect resource costs and payment schedules. |
|
Region |
The geographical area where the service is deployed. All resources used by Dify on DMS must be in the same region to ensure service availability and network connectivity. |
|
Deployment version |
The version of Dify to deploy. Dify on DMS is designed for integration with Alibaba Cloud Data Management Service (DMS). The Enterprise Edition of Dify is a paid version optimized for medium to large organizations and requires a separate license. |
|
Logon method |
The authentication method for system access. DMS account logon lets users log on to the Dify platform with their DMS accounts, reusing the existing authentication mechanism. Dify account logon uses a user's email address and password for authentication. Users can log on through an internal or public domain name or IP address and manage their own accounts. This guide covers the Dify account logon method. For information about the DMS account logon method, see this topic. |
|
SR role authorization |
Authorizes the required service role (SR). If not authorized, click Grant Permission. |
|
SLR role authorization |
Authorizes the service-linked role (SLR) to delegate operations on other cloud resources. If not authorized, click Grant Permission. |
|
Associated service activation |
Indicates if dependent services are active. If not, click Grant Permission to activate them. |
|
Workspace creation method |
The method used to create the workspace. |
|
Workspace name |
A unique name for the workspace, used to distinguish different project or team environments. |
|
Network type |
The network deployment type. The current default is VPC. |
|
VPC |
The ID of the VPC instance where the service runs. |
|
Zone and vSwitch |
The primary zone and its corresponding vSwitch, where the primary node is deployed. This ensures high availability and low latency. |
|
Secondary zone and vSwitch |
The secondary zone and vSwitch for disaster recovery and failover. These resources are activated if the primary zone becomes unavailable, which improves system availability. |
|
NAT gateway |
Specifies whether to configure a NAT gateway to provide internet access for resources within the VPC. |
|
Private and public endpoints |
Enabling private and public endpoints requires activating PrivateZone, EIP, and ALB, which incur pay-as-you-go charges. For pricing details, see PrivateZone Billing, EIP Billing, and ALB Billing. |
Dify configuration
The data storage method for the Dify application. Both ESSD and OSS are supported.
|
Parameter |
Description |
|
Dify version |
The version of Dify to be deployed, which determines the core application's feature set, API, and capabilities. |
|
Storage configuration |
Choose between ESSD and OSS. |
|
Number of replicas |
The number of data copies stored to ensure high reliability. |
|
Deployment resource specification |
The compute resource configuration for the deployment instance, which affects performance and concurrent processing capacity. |
If you select OSS, you must configure the following OSS-related information.
|
Path |
If you select OSS for storage, you must specify the file storage path. |
|
OSS bucket |
If you select OSS for storage, you must specify the OSS bucket name for storing unstructured data such as static resources, attachments, and backups. |
Database configuration
Configure a metadatabase, cache, and vector database for Dify. You can create new instances or import existing ones. To learn how to import existing instances, see Prerequisites for creating Dify by using existing databases.
-
Metadatabase configuration
-
Create new instance: Select specifications, storage type, and storage capacity based on your business workload.
-
Import existing instance: Select a PostgreSQL instance with security hosting enabled.
-
-
Redis configuration
-
Create new instance: Select a suitable Redis configuration.
-
Import existing instance: Select a Redis instance that has security hosting enabled.
-
-
Vector database configuration
-
Create new instance: Select a suitable AnalyticDB configuration.
-
Import existing instance: Select a vector database instance that has security hosting enabled.
-
Security configuration
Configure access credentials and network security policies for the databases.
|
Parameter |
Description |
|
Database account |
A unified account created for all newly purchased databases. |
|
Password |
The password for the database account. |
|
Security group |
A virtual firewall that controls network access traffic for associated cloud resources. |
4. Deploy and verify
-
After you configure all the parameters, the estimated cost is displayed on the right side of the page. Review the configuration, and then click Buy Now.
NoteBefore you activate pay-as-you-go services or purchase subscription resources, ensure that your Alibaba Cloud account has sufficient balance to cover the order amount. The fees will be deducted directly from your account balance.
-
After payment, you are automatically redirected to the deployment details page, where you can view the real-time deployment progress. The entire process takes approximately 15 to 30 minutes.
In the left-side navigation pane, click the resource management icon and select Dify Resources to go to the details page. A blue banner at the top of the page indicates that the configuration is in progress, and the status shows as Deploying. In the Basic Configurations section, parameters such as the metadatabase type, Redis instance, vector engine type, and OSS bucket are displayed as a hyphen (-) until the deployment is complete.
Examples
Configure whitelist
-
On the Dify workspace page, click in the left-side navigation pane. On the Dify Resources page, in the Basic Configurations section, click the Configure Whitelist button next to Instance Public Endpoint.
-
On the Entries tab that appears, click the Add Entry button.
-
In the Add Policy Group Entry dialog box, enter your local IP address and other IP addresses that require access.
-
Click Add to save the whitelist configuration.
Administrator setup and logon
-
After configuring the whitelist, go to the workspace page and click in the left-side navigation pane.
-
When you open the Dify Studio page for the first time, the Set Administrator Account page appears. Set the administrator's email, username, and password.
-
After the setup is complete, log on to use Dify.
After you log on successfully, the Dify Studio page appears. You can start by selecting Create blank app, Create from template, or Import DSL file.
Add users
-
After you log on, click your profile picture in the upper-right corner and select Settings.
-
On the Settings page, click Members in the left-side navigation pane.
-
On the Members page, click Add to invite a new member.
In the Add Team Member dialog box, enter the recipient's email address in the Email field, select a role (for example, Member) from the drop-down list, and click Send Invitation.
-
Click Send Invitation.
-
After the invitation is sent, copy the invitation link and open it to access the new member's logon page.
-
Open the link and set a password for future logons.
-
Click Log On. On the next page, set a username for the user, and then click Join to finish.
On this page, you also need to confirm the UI Language and Timezone settings.
Embedding an application
This operation applies only to Chatflow applications and is not supported for Workflow applications.
-
Once you have developed an application, click in the upper-right corner to publish the application.
-
After the application is published, click Embed in Website.
-
In the Embed in your website dialog box, select an embedding format and click the
icon to copy the corresponding code. -
Paste the code into the source code of your website. The corresponding interface will then appear on the page.
After the code is embedded, the Dify chat widget appears in the lower-right corner of the webpage. The application name is displayed at the top. Users can interact with the AI assistant by sending messages in the input box at the bottom.