Do I have to call Firebase Remote Config API from the Cloud Function? - google-cloud-functions

I have some params in Remote Config that I want to update from the Google Cloud Functions.
Should I use the Remote Config API when both Cloud Functions and Remote Config belong to the same account or project?
I am asking because Cloud Functions can directly import the data from Firestore without any authentication and API.

Remote Config provided the RESTful APIs to update the parameters or template.
You don't have to call them from a Google Cloud function. But calling them from a Google Cloud function or even Firebase Cloud function is definitely workable.
You can even call the RESTful APIs from postman or some other tools once you set up the call properly.
Check more details here: https://firebase.google.com/docs/reference/remote-config/rest

With Remote Config backend APIs, you could use Remote Config with Cloud Functions for Firebase, changing values in your app based on events that happen server-side. For example, you can use Remote Config to promote a new feature in your app, and then turn off that promotion automatically once you detect enough people have interacted with the new feature.
Using the Remote Config REST API or the Admin SDKs described in this guide, you can bypass managing the template in the Firebase console to directly integrate Remote Config changes into your own processes.
As described here, Cloud Functions can be triggered in response to changes in Firebase Remote Config in the same Cloud project as the function. This makes it possible to change the behavior and appearance of your app without publishing an app update.

Related

How to access secured API Management APIs linked to an Azure Static Web Application for local development with swa cli

How to call the secured API management linked APIs configured in azure portal when developing locally using SWA CLI? All I observed in the SWA configuration is meant for functions as APIs not the APIM.
https://learn.microsoft.com/en-us/azure/static-web-apps/apis-api-management
When adding API Management APIs to an azure static web app, an automatic proxy product is created on APIM securing access to the API for this app via /api prefix on the static web app domain. I did not see any mentions of how this works for local development to pass the user claims from SWA emulator to the API via that proxy?
I was trying to do this recently and I don't think it's possible. My solution was to add a proxy to my dev server (in my case vite) to proxy all requests to the /api route to the Api Management URL, setting the necessary subscription key header.

How to access Azure API Managment deployed in Vnet without using application Gateway? (For clients that exist outside the Vnet)

I have an API management instance that is integrated with a Vnet - the ability to access the API management instance is possible to internal consumers.
I would like certain public clients to also access this API management instance - the way described in the Azure documentation is to make use of Application Gateway:
see: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-integrate-internal-vnet-appgateway
Is anyone aware of an alternate approach not implementing Application Gateway?
Use Function App with Vnet Integration:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-vnet
The function app exposes public endpoint and has ability to make internal call to Vnet.

Google Cloud Functions authentication to other GCP APIs

I want to write a Google Cloud Function that can interact with GCP's Dataproc service to programatically launch Dataproc clusters. We already have a battle-hardened Dataproc infrastructure, we're just looking to extend the ways in which they get launched.
Our Dataproc clusters can only be launched using an appropriate IAM service account that is already a member of the appropriate IAM roles hence the Cloud Function will need to authenticate to the Dataproc service using that service account. What is the most appropriate way for a Cloud Function to authenticate to other GCP services/APIs using a service account?
Options I suspect include:
* running the function as that service account
* providing a JSON key file & setting GOOGLE_APPLICATION_CREDENTIALS environment variable
Is there a recognised way of achieving this?
I have had a look at :
* https://cloud.google.com/docs/authentication/
* https://cloud.google.com/docs/authentication/getting-started
but they are not specific to Cloud Functions.
I've also looked at
* https://cloud.google.com/functions/docs/writing/http
but that seems more concerned with how the caller of the function can authenticate.
I think this is what you're looking for: https://cloud.google.com/functions/docs/concepts/iam
At runtime, Cloud Functions defaults to using the App Engine default service account (PROJECT_ID#appspot.gserviceaccount.com), which has the Editor role on the project. You can change the roles of this service account to limit or extend the permissions for your running functions. You can also change which service account is used by providing a non-default service account on a per-function basis.
tl;dr gcloud functions deploy FUNCTION_NAME --service-account SERVICE_ACCOUNT_EMAIL
By the way, if you ever need more complex scheduling logic, consider looking into Cloud Composer (managed Apache Airflow): https://cloud.google.com/composer/

How does the code for each API exposed via AZURE API Gateway Stored?

I am new to Azure API Manager, I have used Apigee Edge before where you can store each api proxy code in either git or SVN. But in Azure I am not sure how each API that is exposed via the gateway is stored. I can see there is a repository for the whole API Manager instance. Does that mean all the APIs are bundled to the same Gateway Instance and stored there?
I am planning to build a CI/CD pipeline to create the APIs in the API Manager for that I need to understand how the APIs code will be stored.
Your help is appreciated. Thanks.
Besides the GIT repository for the apimanagement instance, you can fetch it in form of ARM templates. Refer this blog.
https://azure.microsoft.com/en-in/blog/build-a-ci-cd-pipeline-for-api-management/

Working with azure(mysql database) in node javascript with cloud API

I'm working with an API app on Azure by deploying an API written in NodeJs which stores data in MongoDb.
Make a new API for web & mobile apps from Azure portal.
Choose MongoDb by adding MongoLab module from Azure.
Create a table (collection) and populate it with few entries.
Prepare our Git repository from Azure portal and link it to our local Git on computers.
Decide which NodeJs modules to use to set the dependencies.
Edit the configuration file for NodeJs.
Make the main API file with the following functionalities:
Connection to the database.
Running the service.Making CRUD operation services (CREATE, READ,DELETE...)
Testing our API on a browser.
Making an application using our API
My question: how to use these steps to store data in mysql database(azure)?
I cannot fully understand your requirement, do you want to use the MySQL database to store your data in your API application in Node.js? If not, please clarify your purpose.
To implement connection to MySQL in Node.js, you can use some 3rd part MySQL handler modules.
For example:
node-mysql - A pure node.js JavaScript Client implementing the MySql protocol
or
Sequelize - A promise-based ORM for Node.js and io.js
Any further concern, please feel free to let me know.