Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Deploy Meilisearch on Azure in One Click
Christopher Maneu
Christopher Maneu

Posted on • Originally published atmaneu.net

     

Deploy Meilisearch on Azure in One Click

If you're developing an application, chances are that you need some search capabilities. In this area, users have been accustomed to blazing-fast search experiences like the ones on modern search engines.

Truth is, providing a great search experience from just an autocomplete box is quite hard. EnterMeilisearch, an open-source search API. It's easy to use, blazing fast, and comes withSDKs for a wide range of languages.

So, let's see how easy it is to host it on Azure 🚀

One-click deploy

If you're in a hurry, just click that big blue buttonand do not forget to replace theApplication Name with something morepersonal.

Deploy To Azure

Azure portal asking deployment parameters

Click on theCreate button, wait a few minutes while the deployment is happening...and that's it! Your Meilisearch instance is up and running. You can access your instance via a custom URL of the generated App Service. You can see it by clicking theOutputs tab on the left. The API is accessible on the 433 port and not the default 7700 port.

The deployment output table, showing the Meilisearch API url

Host Meilisearch on Azure Web Apps for Containers

Let's see under the hood how you can easily host Meilisearch on Azure. As Meilisearch is created in Rust, the best way to host it is probably to use their container image. WithAzure App Service, you can easily host and scale containers without having to deal with Kubernetes or OS updates.

Create an Azure App Service

If you're not familiar with Azure App Service, I encourage you tofollow this tutorial. Onwards, I'll assume you have a basic knowledge of this service :).

If you try to deploygetmeili/meilisearch image, it'll not work the first time. This is due to the port exposed by the image - which is by default 7700. We need to inform Azure App Service to map this port behind the SSL termination done by App Service. For this, you must add the environment variableWEBSITES_PORT with the value 7700.

Meilisearch recommends setting a master API Key. You can do so by adding theMEILI_MASTER_KEY environment variable with some long & complex values.
Once this is done, you can try your instance right away! If you're also new to Meilisearch,checkout their quick start!.

Melisearch dashboard hosted on Azure displaying search results with Harry Potter movies

Setup shared storage

But what happens if you stop or restart your instance? All your indexed data is gone!

The meilisearch dashboard with no index

Well, this is quite expected. Azure App Service is by default a stateless service: all data written on disk will be lost at some point (service restart, reimaging, ...). So you need to configure what we callPath mappings. This feature will map a folder within the container to a specific file share. Hence all data stored there will be persisted even if the container is restarted.

Azure portal showing mounted volumes

You can see how to mount a storage mapping to a Linux container inour documentation.

The last thing you must do is to add the environment variableMEILI_DB_PATH with the path used in your path mapping.

That's it, you now have a Meilisearch instance hosted on Azure :).

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
mikedigitalegg profile image
mikedigitalegg
  • Joined

Thanks for the guide, got us up an running quickly. Just a gotcha for anyone else using this guide... it looks like the databases are not backwards compatible so you should lock the image to a specific version rather than using getmeili/meilisearch:latest

eg. getmeili/meilisearch:v0.26.0

We had an issue where when the container was restarted it upgraded to latest (which was 0.27) so the app went down with an error due to database incompatibility.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Data Engineering & Analytics Lead Cloud Advocate @ Microsoft
  • Location
    France 🥖
  • Work
    Data Engineering & Analytics Lead Cloud Advocate @ Microsoft
  • Joined

More fromChristopher Maneu

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp