I have designed a simple dialogflow and tried to enable basicauth by providing username and password in the code.It works.It is shown below(refer check_auth function):
app.py
The dialogflow works fine with the given username and password.I tried deploying to cloudrun via the CI/CD using cloudbuild.yaml and it works fine.
Now,I want to use secret manager to store the username and password instead of giving it in the code.
So,I created name:secret-username,value:myuser and name:secret-password,value:mypassword in the secret manager .Also,I reference the secrets in cloudrun as shown below:
Secret manager screenshot is shown below:
Also,I made changes to the code as shown below(I am referring the secret name to username instead of hardcoding my username value):
It got deployed successfuly to cloudrun via cloudbuild.But ,Dialogflow does not accept my username and password.It gives unauthenticated error when I dont give any credentials in dialogflow which is expected.But,when I give my username and password as ""myuser" and "mypassword" as mentioned in the secretmanager value,it gives webhookcallfailed:error:unavailable which is shown below:
The cloudbuild.yaml file is given below:
Also,I have enabled all the required permissions(secret manager,serviceaccount,cloudrun) in cloud build settings. Could you please help me out with this?Is this related to any permission issues or anything with the code?