serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
266 stars 162 forks source link

throw in CI when credentials are missing instead of triggering login via browser #520

Open G-Rath opened 3 years ago

G-Rath commented 3 years ago

This is a Feature Proposal

Description

If the azure credentials are missing, serverless currently attempts to login to azure via a browser:

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Logging into Azure
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <code> to authenticate.

This is not really practical as it defeats the point of doing automatic deployment - I could see there being some situations where it's useful (depending on how the auth works), but that's assuming you can see the log (i.e. in Github Actions you can't see the log of steps that are in-progress - I was waiting for ~10 minutes before cancelling my job and finding out this was it was doing).

I think it would be better if serverless exits with an error if it's running in CI without credentials - this could be checked using the is-ci package.

Similar or dependent issues: