Deploy on azure

Hello!

I’m trying to deploy a "development” version of my app to azure. And then connect an actual shopify app to that.
I wanna use docker deploy.
But i feel like i miss on something with how do i specify that it should be the dev.toml file that is being used together with my .env.development variables?

Do anyone have a good resource for azure deployment, because i have googled and can’t find any good.

Hi @TB-Alex

This is a common point of confusion. You cannot use your dev.toml or .env files directly in an Azure Docker deployment, and you must not use npm run dev in production. Your dev.toml file is only for configuring your app in the Partner Dashboard, and your .env files are for providing secrets to your running app instance.

First, you must create a separate app in your Partner Dashboard (e.g., “My App - Staging”). You need to manually copy all the settings from your dev.toml file (like scopes) into this new app’s setup. In the “App URL” fields, you must use your permanent Azure URL. This new app will have its own API key and secret.

Next, you configure Azure, not your code. Do not include your .env.development file in your Docker image. Instead, go to your App Service in the Azure portal and navigate to the “Configuration” > “Application settings” section.

You now have to manually add all your environment variables, using the new API key and secret from the “Staging” app you just created. Your Dockerfile should be set up to run npm run build and then use npm run start as its final command. This is the standard, secure way to deploy, where your Docker image is a generic build, and the environment variables in Azure tell it which app to connect to.

Hope this helps!

2 Likes

Use the actual developmemt forums for development issues, these are the merchant forums.
The apps subforum goal is to aid merchants in finding app solutions.

Location Location Location

1 Like