Automate Meteor deployments on Azure App Service
- Meteor 1.4+
- App Service on Basic plan or higher
- Following General Settings:
- Web sockets - On
- ARR Affinity - On
- Following App Settings:
- SCM_COMMAND_IDLE_TIMEOUT - 7200
- METEOR_AZURE_NODE_VERSION - Node version bundled with your current Meteor release
- METEOR_AZURE_NPM_VERSION - NPM version bundled with your current Meteor release
- ROOT_URL - http://{sitename}.azurewebsites.net or a custom domain you've set up
- MONGO_URL - MongoDB connection string
- MONGO_OPLOG_URL - Optional: Recommended with multiple instances
- METEOR_SETTINGS - Optional: e.g from your settings.json
- METEOR_AZURE_ROOT - Optional: Path to your .meteor directory IF it's nested (format as "foo\bar\")
- Copy the contents of the
script
directory into the top-level of your repository - Configure a deployment source in the Azure portal (detailed instructions)
Meteor's core force-ssl package is incompatible with our setup. You can achieve the same functionality with an extra rewrite rule in your web.config (see a full example here):
<!-- Force HTTPS -->
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
Note that with this approach ROOT_URL should be prefixed with 'https' (if not already)
See the meteor-azure-example repo