-
Notifications
You must be signed in to change notification settings - Fork 204
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 , If you really want to include the "provision" step in pipeline, you can disable 2FA for your m365 account and set these in the env: |
I understand the point with the App Creation. What we wanna do is to update the App Registration after changes in the aad.manifest.json automatically in our pipeline. If this is not possible to do within the provision step, we will try to update the app registration via cli. |
@bastianveltin If that's the case, you can follow my last reply to include "provision" step in pipeline:
I will close this issue for now. Please reopen if you need more help. |
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: