-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provision command doesn`t work in Pipelines because it always asks for login #13024
Comments
👋 Hi @bastianveltin, Thank you for reporting this issue! We want to let you know that: ⏱️ Our team will personally review your issue ✨ This is an AI-generated initial response The issue you are encountering is due to the Here are some steps and suggestions to resolve this issue:
- name: "Azure Login as Service Principal"
run: |
npx teamsapp auth login azure --username ${{ vars.GA_WORKFLOW_CLIENT_ID }} \
--service-principal true \
--tenant ${{ vars.AZURE_TENANT_ID }} \
--password ${{ secrets.GA_WORKFLOW_CLIENT_SECRET }} \
--interactive false
env:
M365_ACCOUNT_NAME: ${{ secrets.M365_ACCOUNT_NAME }}
M365_ACCOUNT_PASSWORD: ${{ secrets.M365_ACCOUNT_PASSWORD }}
CI_ENABLED: true
M365_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
name: CI/CD Pipeline
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
- name: "Setup Node ${{ env.NODE_VERSION }}"
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: "Install CLI"
run: |
npm install -g @microsoft/teamsapp-cli@${{ env.TEAMSAPP_CLI_VERSION }}
- name: "Azure Login as Service Principal"
run: |
npx teamsapp auth login azure --username ${{ vars.GA_WORKFLOW_CLIENT_ID }} \
--service-principal true \
--tenant ${{ vars.AZURE_TENANT_ID }} \
--password ${{ secrets.GA_WORKFLOW_CLIENT_SECRET }} \
--interactive false
env:
M365_ACCOUNT_NAME: ${{ secrets.M365_ACCOUNT_NAME }}
M365_ACCOUNT_PASSWORD: ${{ secrets.M365_ACCOUNT_PASSWORD }}
CI_ENABLED: true
M365_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
- name: "Provision resources to hosting environment"
run: |
npx teamsapp provision --env ${{ inputs.environment }} --verbose --interactive false
- name: "Deploy to hosting environment"
run: |
npx teamsapp deploy --env ${{ inputs.environment }} --verbose --interactive false Following these steps and incorporating the necessary environment variables should help you bypass the login prompt during the
|
@bastianveltin - Thank you for bringing this issue to our attention. Could you please share the document you are following for this? |
Hi @bastianveltin , |
Describe the bug
We wanna do the whole build and deployment process within a Github Actions Pipeline.
But The 'teamsapp provision' command is always asking for a login via Link:
'Log in to your Microsoft 365 account - opening default web browser at ....'
The 'deploy' step works fine without asking for a login.
To Reproduce
This is the github Action:
`
`
Expected behavior
Execute the provision step without user interaction.
Screenshots
VS Code Extension Information (please complete the following information):
CLI Information (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: