Closed lamontadams closed 4 months ago
After some experimentation, this appears to work, assuming I am able to use a user account token and not a user-independent api key (and I'd certainly prefer to not have my automatic deployments tied to a single user's account from a security point-of-view):
twilio-run deploy --functions-folder dist/functions --assets-folder dist/assets -l debug --username $TWILIO_ACCOUNT_SID --password $TWILIO_AUTH_TOKEN
My experiments lead me to believe environment variables and .env files approaches that are documented just don't work. Is this intended?
This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
Issue Summary
I am trying to source credentials from environment variables for a CI/CD environment. Following documentation here: https://www.twilio.com/docs/twilio-cli/general-usage/profiles#use-environment-variables It seems that I should be able to define as below:
with values sourced from the Twilio console for the API key in question. However when I do this and execute a command that requires authentication (e.g.
twilio-run deploy
) I receive the following error message:Edit: This doesn't seem to work when they are saved in a twilio.env file either, as implied by https://www.twilio.com/docs/usage/secure-credentials#mac--linux.
So what's the correct way to source these from the environment? Can I trust any of the documentation here? What's the recommendation for authenticating in a CI/CD environment if this simple stuff doesn't work?
Steps to Reproduce
As above.
Technical details:
-l debug
to the end of the command):│ ERROR Missing Credentials │ │ We couldn't find any Twilio credentials for you. │ │ Please enter ACCOUNT_SID and AUTH_TOKEN in your .env file. │ │ Alternatively you can specify them via the command-line using "--username" and "--password" │ │ For more information use "--help"