Describe the bug
When trying to run a continuous deployment process (eg. from GitHub Actions), the interactive login mode blocks the CI.
Additional context (copy of internal discussion)
Wassim Chegham 4 days ago
Last time I investigated this, I hit an issue regarding the login process while trying to deploy from the Github Action. TBH, I was expecting this! So the issue is that we are using an interactive login method interactiveLoginWithAuthResponse on @azure/ng-deploy.
Describe the bug When trying to run a continuous deployment process (eg. from GitHub Actions), the interactive login mode blocks the CI.
Additional context (copy of internal discussion)
Last time I investigated this, I hit an issue regarding the login process while trying to deploy from the Github Action. TBH, I was expecting this! So the issue is that we are using an interactive login method
interactiveLoginWithAuthResponse
on@azure/ng-deploy
.I was thinking we should switch to a
loginWithServicePrincipalSecretWithAuthResponsez
login method when we are in a CI environment. See https://github.com/Azure/ms-rest-nodeauth#service-principal-and-secret-based-loginThen, in the pipeline or CI config, we should create and use Github secrets like this:
I had this feature on my todo list for some time now. I'd be happy to send a PR, I just need to find some time to work on it.
I forgot to mention that prior to this, we need to create a SP. We can do it from the CLI:
which will give us the following content
Demo repo
See https://github.com/manekinekko/github-action-deploy-to-azure/blob/c7ec9ec03919554c24b221bfc560dd5221927fa8/.github/workflows/nodejs.yml#L1-L34