Prerequisite: You have updated index.js to include the cloud function which Dialogflow will use
Once you have modified index.js, you will be deploying it to Cloud Functions.
From the original project directory (FirebaseTestSimple, not functions) type the following into your terminal
firebase deploy --only functions
If this is the first time you are deploying the function, when the function is completely deployed, the function URL will be displayed in the terminal. Future updates to the code and subsequent deployments will not show the function URL. Notice that the URL ends with the function name we used.
Now copy the function URL and paste it into your Dialogflow project's webhook URL.
We are almost there. The cloud function is now available for you to call from your Dialogflow agent. But there is one more thing to do.