Skip to content

Commit 179ded9

Browse files
authored
feat: Configure Azure CI for SAML SSO (#2648)
## Description Provide a concise summary of the changes made in this pull request - ## Pull request type Check the appropriate box: - [ ] Review Fixes - [ ] Documentation Overhaul - [ ] Feature/Story - Link one or more Engineering Tickets * - [ ] A-Force - [ ] Error in documentation - [ ] Maintenance ## Documentation tickets Link to one or more documentation tickets: - ## Checklist From the below options, select the ones that are applicable: - [ ] Checked for Grammarly suggestions. - [ ] Adhered to the writing checklist. - [ ] Adhered to the media checklist. - [ ] Verified and updated cross-references or added redirect rules. - [ ] Tested the redirect rules on deploy preview. - [ ] Validated the modifications made to the content on the deploy preview. - [ ] Validated the CSS modifications on different screen sizes.
1 parent c5c88ae commit 179ded9

File tree

11 files changed

+370
-43
lines changed

11 files changed

+370
-43
lines changed
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# Configure Azure Container Instance for SAML SSO
2+
3+
This page shows how to configure Appsmith on Azure Container Instance for using Security Assertion Markup Language (SAML) Single Sign-On (SSO).
4+
5+
## Prerequisites
6+
7+
- [Azure account](https://portal.azure.com/#home) with permission to create and manage PostgreSQL resources.
8+
- Ensure that you have taken a manual backup for your instance. See [Backup instance](/getting-started/setup/instance-management/appsmithctl?current-command-type=docker-commands#backup-instance)
9+
10+
## Set up PostgreSQL in Azure
11+
12+
Follow these steps to set up a PostgreSQL instance in Azure. It is recommended to create PostgreSQL in the same region and availability zone as your Appsmith deployment for optimized performance.
13+
14+
15+
16+
1. Log into the [**Azure Portal**](https://portal.azure.com).
17+
18+
2. In the left-hand menu, select **Create a resource** and search for **Azure Database for PostgreSQL**.
19+
20+
3. Select **Single server** and click **Create**.
21+
22+
<dd>
23+
24+
<ZoomImage src="/img/azure-pg-create.webp" alt="" caption="" />
25+
26+
</dd>
27+
28+
4. In the **Basics** tab, set up:
29+
30+
<dd>
31+
32+
- **Subscription**: Select Subscription 1.
33+
34+
- **Resource Group**: Select Sandbox.
35+
36+
- **Server Name:** Enter appsmith-postgres.
37+
38+
- **Region**: Select the region matching your Appsmith deployment for optimized latency.
39+
40+
- **PostgreSQL** Version: Choose Version 14.
41+
42+
- **Workload Type**: Select Development.
43+
44+
45+
<ZoomImage src="/img/azure-pg-server.webp" alt="" caption="" />
46+
47+
48+
49+
</dd>
50+
51+
5. In the **Compute + storage** section, configure as needed based on performance requirements.
52+
53+
6. In the **Authentication Settings**:
54+
55+
<dd>
56+
57+
- **Authentication Method**: Select PostgreSQL Authentication Only.
58+
59+
- **Username**: Enter your preferred username (for example, `pgadmin`).
60+
61+
- **Password**: Set a secure password.
62+
63+
<ZoomImage src="/img/azure-pg-auth.webp" alt="" caption="" />
64+
65+
66+
7. Once the setup is complete, click **Next: Networking**.
67+
68+
69+
70+
71+
</dd>
72+
73+
74+
## Set up Firewall Rules
75+
76+
Configure firewall rules for your PostgreSQL instance to ensure secure access. By default, you can enable public access, but it's recommended to restrict access to specific IP addresses in production environments.
77+
78+
1. In the Azure Portal, go to the **Networking** tab of your PostgreSQL server.
79+
80+
2. Under **Firewall** rules, choose one of the following options:
81+
82+
<dd>
83+
84+
Add your IP address or select **Allow Azure services and resources** to access this server if you want to enable broader access temporarily.
85+
86+
<ZoomImage src="/img/azure-pg-firewall.webp" alt="" caption="" />
87+
88+
89+
90+
91+
92+
</dd>
93+
94+
95+
3. Click **Save** to apply the firewall settings.
96+
97+
98+
## Connect to PostgreSQL Database
99+
100+
After setting up your PostgreSQL instance, connect to it using the provided credentials.
101+
102+
<ZoomImage src="/img/azure-db-pg.webp" alt="" caption="" />
103+
104+
105+
1. In the Azure Portal, navigate to **All resources** and select your PostgreSQL server instance.
106+
107+
2. Find your connection details (`host`, `port`, `username`, and `database name`).
108+
109+
3. Open a terminal and use the following command to connect to your PostgreSQL database:
110+
111+
<dd>
112+
113+
```sql
114+
# Format
115+
psql -h <hostname> -p <port> -U <username> <database>
116+
117+
# Example
118+
psql -h appsmith.postgres.database.azure.com -p 5432 -U pgadmin postgres
119+
```
120+
121+
</dd>
122+
123+
## Create Keycloak Database and User
124+
125+
Once connected to your PostgreSQL database, create a new database for Keycloak and a user with appropriate roles.
126+
127+
1. Create the keycloak database:
128+
129+
<dd>
130+
131+
```sql
132+
CREATE DATABASE keycloak;
133+
```
134+
135+
</dd>
136+
137+
2. Create a new user and set a secure password:
138+
139+
<dd>
140+
141+
```sql
142+
CREATE USER your_username WITH PASSWORD 'your_password';
143+
```
144+
145+
</dd>
146+
147+
3. Assign the necessary roles to the new user:
148+
149+
<dd>
150+
151+
```sql
152+
GRANT CONNECT ON DATABASE keycloak TO your_username;
153+
GRANT USAGE ON SCHEMA public TO your_username;
154+
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO your_username;
155+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO your_username;
156+
```
157+
Replace `your_username` and `your_password` with your actual credentials.
158+
159+
</dd>
160+
161+
## Connect PostgreSQL to Appsmith
162+
163+
To connect your PostgreSQL database to Appsmith, follow these steps:
164+
165+
1. Open your `docker-compose.yml` file for the Appsmith and add the PostgreSQL configuration under the `environment` section.
166+
167+
<dd>
168+
169+
Get the `APPSMITH_KEYCLOAK_DB_URL` from the **Connection Strings** section of your Azure PostgreSQL instance.
170+
171+
*Example:*
172+
173+
```yaml
174+
# PostgreSQL URL format: postgresql://username:password@hostname:port/database
175+
176+
version: "3"
177+
services:
178+
appsmith:
179+
image: index.docker.io/appsmith/appsmith-ee
180+
container_name: appsmith
181+
ports:
182+
- "80:80"
183+
- "443:443"
184+
environment:
185+
# External PostgreSQL configuration for Keycloak
186+
// highlight-next-line
187+
APPSMITH_KEYCLOAK_DB_URL: postgresql://appsmith:[email protected]:5432/keycloak
188+
volumes:
189+
- ./stacks:/appsmith-stacks
190+
restart: unless-stopped
191+
192+
```
193+
</dd>
194+
195+
2. Save the changes, then restart Appsmith to apply the new configurations:
196+
197+
<dd>
198+
199+
```bash
200+
docker-compose down
201+
docker-compose up -d
202+
```
203+
204+
</dd>
205+
206+
207+
208+
## Troubleshooting
209+
210+
If you are facing issues during deployment, refer to the guide on [troubleshooting deployment errors](/help-and-support/troubleshooting-guide/deployment-errors). If you continue to face issues, reach out to the support team via the chat widget on this page.
211+
212+
## Further reading
213+
214+
- [SAML Single Sign-On](/getting-started/setup/instance-configuration/authentication/security-assertion-markup-language-saml)
215+
- [Manage Appsmith instance](/getting-started/setup/instance-management)

website/docs/getting-started/setup/instance-configuration/authentication/security-assertion-markup-language-saml/auth0.mdx

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,69 @@ To configure Appsmith to use [Auth0](https://auth0.com/) as a SAML provider, fol
4444

4545
## Register Auth0 in Appsmith
4646

47-
:::caution
48-
If you are running Appsmith on **Google Cloud Run** or **AWS ECS**, make sure to configure your service before setting up SSO. For detailed instructions, see the [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso), or [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs) guide.
49-
:::
5047

5148
To complete the SAML configuration, you have to register the identity provider on Appsmith. Appsmith provides three options to register the identity provider as mentioned below:
5249

5350
<Tabs queryString="auth0-saml">
5451
<TabItem label="Metadata URL (recommended)" value="auth0metadataurl">
5552

5653
To register Auth0 as the identity provider on Appsmith, follow the steps below:
57-
1. Go to the **SAML 2.0** configuration page in Appsmith and navigate to **Register Identity Provider** section.
58-
2. Add the copied **Metadata URL** in the **Metadata URL** field under the **Register Identity Provider** section.
54+
55+
1. If you are running Appsmith on **Google Cloud Run**, **AWS ECS**, or **Azure Container Instances**, make sure to configure the service before setting up SSO. For more information, see:
56+
57+
58+
<dd>
59+
60+
- [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso)
61+
- [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs)
62+
- [**Configure Azure Container Instances for SSO**](/getting-started/setup/installation-guides/azure/setup-to-integrate-sso)
63+
64+
</dd>
65+
66+
2. Go to the **SAML 2.0** configuration page in Appsmith and navigate to **Register Identity Provider** section.
67+
68+
3. Add the copied **Metadata URL** in the **Metadata URL** field under the **Register Identity Provider** section.
5969

6070
</TabItem>
6171

6272
<TabItem label="Metadata XML" value="auth0metdataxml">
6373

6474
To set up SAML using the raw Metadata XML file, follow the steps below:
65-
1. Open the copied **Metadata URL** in a browser tab and copy the XML content.
66-
2. Navigate to Appsmith and add the raw XML in the **Metadata XML** field under the **Register Identity Provider** section in the **SAML 2.0** configuration page.
75+
76+
1. If you are running Appsmith on **Google Cloud Run**, **AWS ECS**, or **Azure Container Instances**, make sure to configure the service before setting up SSO. For more information, see:
77+
78+
79+
<dd>
80+
81+
- [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso)
82+
- [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs)
83+
- [**Configure Azure Container Instances for SSO**](/getting-started/setup/installation-guides/azure/setup-to-integrate-sso)
84+
85+
</dd>
86+
87+
2. Open the copied **Metadata URL** in a browser tab and copy the XML content.
88+
89+
3. Navigate to Appsmith and add the raw XML in the **Metadata XML** field under the **Register Identity Provider** section in the **SAML 2.0** configuration page.
6790

6891
</TabItem>
6992
<TabItem label="IdP data" value="auth0idpdata">
7093

7194
If you have Identity provider data like **X509 Public Certificate**, **Email**, you can choose this option to configure SAML.
7295

73-
1. Open the Metadata URL in a browser tab or open the Metadata XML file.
74-
2. Add the following values from XML tags in **IdP Data** under the **Register Identity Provider** section in the Appsmith **SAML 2.0** configuration page:
96+
1. If you are running Appsmith on **Google Cloud Run**, **AWS ECS**, or **Azure Container Instances**, make sure to configure the service before setting up SSO. For more information, see:
97+
98+
99+
<dd>
100+
101+
- [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso)
102+
- [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs)
103+
- [**Configure Azure Container Instances for SSO**](/getting-started/setup/installation-guides/azure/setup-to-integrate-sso)
104+
105+
</dd>
106+
107+
2. Open the Metadata URL in a browser tab or open the Metadata XML file.
108+
109+
3. Add the following values from XML tags in **IdP Data** under the **Register Identity Provider** section in the Appsmith **SAML 2.0** configuration page:
75110

76111
| <div style= {{width:"200px"}}> **IdP Data Field ** </div> | <div style= {{width:"auto"}}> **Metadata XML Tag** </div> |
77112
| ------------------- | ------------------------------------------------------------------------------------------ |

website/docs/getting-started/setup/instance-configuration/authentication/security-assertion-markup-language-saml/entra-id.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,24 @@ This page shows how to configure [Microsoft Entra ID (Azure AD)](https://www.mic
107107

108108
## Register Entra ID in Appsmith
109109

110-
:::caution
111-
If you are running Appsmith on **Google Cloud Run** or **AWS ECS**, make sure to configure your service before setting up SSO. For detailed instructions, see the [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso), or [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs) guide.
112-
:::
113110

114111
To complete the SAML configuration, you’ll have to register the identity provider on Appsmith as mentioned below:
115112

116113

117-
1. Open the copied **App Federation Metadata Url** in a browser tab.
114+
1. If you are running Appsmith on **Google Cloud Run**, **AWS ECS**, or **Azure Container Instances**, make sure to configure the service before setting up SSO. For more information, see:
115+
116+
117+
<dd>
118+
119+
- [**Configure Google Cloud Run for SSO**](/getting-started/setup/installation-guides/google-cloud-run/setup-to-integrate-sso)
120+
- [**Create PostgreSQL RDS for SAML SSO**](/getting-started/setup/installation-guides/aws-ecs/setup-postgresql-aws-ecs)
121+
- [**Configure Azure Container Instances for SSO**](/getting-started/setup/installation-guides/azure/setup-to-integrate-sso)
122+
123+
</dd>
124+
125+
2. Open the copied **App Federation Metadata Url** in a browser tab.
118126

119-
2. Add the following values from XML tags in **IdP Data** under the **Register Identity Provider** section in the Appsmith **SAML 2.0** configuration page:
127+
3. Add the following values from XML tags in **IdP Data** under the **Register Identity Provider** section in the Appsmith **SAML 2.0** configuration page:
120128

121129
<dd>
122130

@@ -129,7 +137,7 @@ To complete the SAML configuration, you’ll have to register the identity provi
129137

130138
</dd>
131139

132-
3. To configure custom SAML claims (if added in the Entra ID's **Claims and Attributes**) in Appsmith, Click the **Advanced** section.
140+
4. To configure custom SAML claims (if added in the Entra ID's **Claims and Attributes**) in Appsmith, Click the **Advanced** section.
133141

134142
<dd>
135143

0 commit comments

Comments
 (0)