I have been serving dynamic content with a cloud function for some time.
Now, I tried changing the region of the cloud function by using region()
in the function builder:
// Old
export const serveContent = functions
.https
.onRequest((req, res) => {...})
// New
export const serveContent = functions
.region("europe-west1")
.https
.onRequest((req, res) => {...})
During this change I did not modify my rewrites
in the firebase.json
.
Now, the requests do not reach the cloud function anymore (there are no invocations shown in the logs) and my browser gets redirected with a 302 Found
status code to a page prompting for authentication. How can I keep serving content without authentication?
Both cloud functions have the Cloud Functions-Invoker
role set for allUsers
:
The prompt for authentication is just a side-effect of the real problem. The docs state:
Firebase Hosting supports Cloud Functions in us-central1 only.