Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase deploy to custom region (eu-central1)

is there a way to specify the Region/Zone where my firebase functions will be deployed.

Actually i didn't found anything about that in the documentation and my functions are always deployed to us-central1 but i want to have it on eu-central1...

Is it possible to set it in the Firebase - Config - File?

{   "database": {     "rules": "database.rules.json"   },   "hosting": {     "public": "public",     "rewrites": [       {         "source": "**",         "destination": "/index.html"       }     ]   } } 

I also had a look on the cli options but i did not found anything there.

The Firebase Project itself is correctly set to an european Region o.O

thanks in advance

like image 811
BernhardS Avatar asked Apr 23 '17 09:04

BernhardS


2 Answers

firebaser here

Update (2018-07-25):

It is now possible to specify the region for your Cloud Functions in Firebase you specify that region in your code and deploy the change. E.g.:

exports.myStorageFunction = functions     .region('europe-west1')     .storage     .object()     .onFinalize((object) => {       // ...     }); 

For full details see the Firebase documentation on Cloud Functions locations (from where I got the above snippet) and modifying the region of a deployed function.

like image 55
Frank van Puffelen Avatar answered Oct 12 '22 11:10

Frank van Puffelen


From docs: https://firebase.google.com/docs/functions/locations

Now available in the following regions:

  • us-central1 (Iowa)
  • us-east1 (South Carolina)
  • europe-west1 (Belgium)
  • asia-northeast1 (Tokyo)

Best Practices for Changing Region

// before const functions = require('firebase-functions');  exports.webhook = functions     .https.onRequest((req, res) => {             res.send("Hello");     });  // after const functions = require('firebase-functions');  exports.webhookEurope = functions     .region('europe-west1')     .https.onRequest((req, res) => {             res.send("Hello");     }); 
like image 34
Jackl Avatar answered Oct 12 '22 11:10

Jackl