title: Can firebase cloud functions emulator invoke triggers with production firestore?
body: <p>I am trying to test a Firebase cloud function on an emulator with real production firestore. When I start up my functions emulator, I get an error <code>i functions[sendPushOnNewMessage]:function ignored because the firestore emulator does not exist or is not running.</code> Interestingly, I can read from firestore (from production data), but firebase emulator refuses to allow these functions to start. </p>
  
  <pre><code>❯ firebase emulators:start --only functions
  i  emulators: Starting emulators: functions
  i  ui: Emulator UI logging to ui-debug.log
  ⚠  functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /Users/.../functions/3afae-a81e699d1cf0.json. Non-emulated services will access production using these credentials. Be careful!
  ⚠  functions: The Cloud Firestore emulator is not running, so calls to Firestore will affect production.
  &gt;  Starting up...
  i  functions[createUserRecord]: function ignored because the auth emulator does not exist or is not running.
  i  functions[sendPushOnNewMessage]: function ignored because the firestore emulator does not exist or is not running.
  </code></pre>
  
  <p>Here is how I am using service account to setup (I know this works since I can read documents):</p>
  
  <pre><code>// Service account initialization.
  let serviceAccount = require('./3afae-a81e699d1cf0.json');
  var initOptions = {}
  emulator#set_up_admin_credentials_optional.
  if (process.env.FUNCTIONS_EMULATOR) {
    initOptions.credential = admin.credential.cert(serviceAccount)
  }
  admin.initializeApp(initOptions);
  const firestore = admin.firestore();
  </code></pre>
  
  <p>Example of my trigger function:</p>
  
  <pre><code>exports.sendPushOnNewMessage = functions.firestore.document('chats/{chatID}/messages/{messageID}').onCreate((change, context) =&gt; {
      console.log("Trigger called")
  }
  </code></pre>