Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 3.89 KB

azurewebapp.md

File metadata and controls

102 lines (79 loc) · 3.89 KB
title description published date tags editor dateCreated
Azure Web App
Installation Guide
true
2023-09-01 02:32:54 UTC
setup, guide
markdown
2019-05-31 22:40:09 UTC

This guide was contributed by the community and may be incomplete or become outdated. {.is-warning}

This guide details the step-by-step procedure to install Wiki.js on an Azure Web App with an Azure Database for PostgreSQL.

1. Database

We'll first create the database for our wiki.

While it's possible to host the database alongside the application on the Azure Web App, this is not recommended as it will impact performance and is not scalable.

1.1 Create Database

  1. Create a new resource, search for Azure Database for PostgreSQL and click Create.
  2. Select Single server
  3. Fill in the server details.
    • You must select a version of 9.6 or later.
    • The minimum server size is Basic with 1 vCore, however you cannot upgrade to General Purpose afterwards if you choose Basic.
  4. Finish by creating the resource.

1.2 Configure Database

  1. Once the resource is created, navigate to Connection security.
  2. Enable Allow access to Azure services so that your Azure Web App is able to access your DB.
  3. Click on Add client IP to add your own IP address to the whitelist.
  4. Click Save and wait for changes to be applied.

🚦 This guide assumes the DB will be dedicated to the wiki. If you plan on sharing the DB with other applications, you should connect to the server and create a dedicated user + database. {.is-warning}

2. Azure Web App

We can now create the App Service where our wiki will run.

2.1 Create Web App

  1. Create a new resource, search for Web App and click Create.
  2. Fill in the instance details.
    • Select Docker Image for Publish type.
    • Select Linux for Operating System.
    • The minimum App Service Plan size is B1. Consider selecting at least P1V2 for production scenarios.
  3. Click Next: Docker
  4. Set the following options:
    • Single Container
    • Image Source: Docker Hub
    • Access Type: Public
    • Image and Tag: requarks/wiki:2
  5. Click Review and create (other steps are optional).

2.2 Configure Web App

  1. Once the resource is created, navigate to Configuration.
  2. Add the following Application Settings: (replace xyz with values you entered when creating the DB earlier)
    DB_TYPE: postgres
    DB_HOST: xyz.postgres.database.azure.com
    DB_PORT: 5432
    DB_NAME: postgres
    DB_USER: xyz@xyz
    DB_PASS: xyz
    DB_SSL: true
    
  3. Click Save to apply the configuration.
  4. Navigate to the Overview tab and click Restart.
  5. Wait for the container to be ready. You can monitor the app status in the Container settings tab, using the Logs window. A message similar to Container xyz_0 for site xyz initialized successfully and is ready to serve requests. should be logged.

3. Setup Wiki.js

  1. Browse to your app public URL. (Can be found in the Overview tab of your web app resource)
  2. Follow the instructions to create the admin account and start using your wiki.

4. Troubleshooting

4.1 431 Request Header Fields Too Large Issues

Enabling App Service Authentication in Azure might cause Request Header Fields Too Large errors.
To fix this:

  1. In your Azure Web App, navigate to Configuration.
  2. Add the following Application Settings:
    WEBSITE_AUTH_DISABLE_IDENTITY_FLOW: true
    

The issue can re-appear for graphql queries when enabling SAML 2.0 authentication in Wiki.js, even with above fix.
To solve that we need to increase the max header size for NodeJS.

  1. In your Azure Web App, navigate to Configuration.
  2. Add the following Application Settings:
    NODE_OPTIONS: --max-http-header-size=81920
    

{.align-abstopright}