Dify: Account-based logon

Updated at:
Copy as MD

AI-Native Database Service allows you to purchase and configure the required resources for Dify with account-based logon in a single operation, including a metadatabase, Redis, and vector database instances.

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 AI-Native Database Service.

    • The relational database, Redis, and vector database instances that you want to import must already be registered in AI-Native Database Service.

    • Security hosting must be enabled for all instances.

2. Go to the deployment page

  1. Log on to the AI-Native Database Service console.

  2. In the left-side navigation pane, choose Custom Development > Dify.

  3. Click Create Instance to go to the Dify 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 must be in the same region to ensure service availability and network connectivity.

Deployment version

The version of Dify to deploy. The Enterprise Edition is a paid version optimized for medium to large organizations and requires a separate license.

Logon method

The authentication method for system access. 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 Dify: DMS account-based logon.

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 and EIP 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. To deploy a high-availability Dify service with multiple replicas, you must select 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.

  1. 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.

  2. Redis configuration

    • Create new instance: Select a suitable Redis configuration.

    • Import existing instance: Select a Redis instance that has security hosting enabled.

  3. 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

  1. 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.

    Note

    Before 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.

  2. 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.

    Return to the Dify instance list. The status of the corresponding instance shows as Deploying. After the deployment is complete, click the instance name to go to the details page, where you can view configuration information such as the metadatabase type, Redis instance, vector engine type, and OSS bucket.

Examples

Configure whitelist

  1. On the Dify instance details page, in the Basic Configurations section, click the Configure Whitelist button next to Instance Public Endpoint.

  2. On the Entries tab that appears, click the Add Entry button.

  3. In the Add Policy Group Entry dialog box, enter your local IP address and other IP addresses that require access.

  4. Click Add to save the whitelist configuration.

Administrator setup and logon

  1. After configuring the whitelist, on the Dify instance details page, click the Dify Studio link.

  2. 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.

  3. 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

  1. After you log on, click your profile picture in the upper-right corner and select Settings.

  2. On the Settings page, click Members in the left-side navigation pane.

  3. 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.

  4. Click Send Invitation.

  5. After the invitation is sent, copy the invitation link and open it to access the new member's logon page.

  6. Open the link and set a password for future logons.

  7. 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.

Embed an application in a third-party page

Note

This operation applies only to Chatflow applications and is not supported for Workflow applications.

  1. After you develop an application, click Publish > Publish Update in the upper-right corner to publish the application.

  2. After the application is published, click Embed in Website.

  3. In the Embed in your website dialog box, select an embedding format and click the copy button to copy the corresponding code.

  4. 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.