Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy the STRAPI API on Azure?

Tags:

azure

strapi

I am trying to deploy a STRAPI API on an azure environment, but I can't get it to run.

I have followed these deployment instructions but when I have deployed the source to azure, it only give me a 500 error that I can't find in the logs.

Does anyone have any experience deploying strapi to azure and have some instructions for me?

like image 561
Tom Aalbers Avatar asked Jan 31 '26 18:01

Tom Aalbers


1 Answers

Alright it was a configuration error.

First I used the Deployment Center to configure an automatic deployment via Github. This will ensure all the node_modules (including the ones of the plugins) are correctly installed.

This all went successful, but I kept getting a 500.1001 error without any clear description.

The thing I needed to change was the port in the server.json in the correct environment.

From:

{
  "host": "www.mydomain.com",
  "port": 1337,
  "proxy": {
    "enabled": false
  },
  "autoReload": {
    "enabled": true
  },
  "cron": {
    "enabled": false
  },
  "admin": {
    "autoOpen": false
  }
}

To:

{
  "host": "www.mydomain.com",
  "port": "${process.env.PORT || 1337}",
  "proxy": {
    "enabled": false
  },
  "autoReload": {
    "enabled": true
  },
  "cron": {
    "enabled": false
  },
  "admin": {
    "autoOpen": false
  }
}
like image 161
Tom Aalbers Avatar answered Feb 03 '26 09:02

Tom Aalbers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!