[WebToolsE2E][Aspire]Error "failed to add files..." pop up after run command "azd pipeline config"
v-yuwzh opened this issue · comments
INSTALL STEPS
- Clean machine: Win11 x64 23h2 ENU
- Install Dev17.10.0 Preview 7 [rel.d17.10-34902.84] (Includes Aspire 8.0.0-preview.7.24251.11)
- Apply NuGet Feeds.
- Install azd use power shell
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' -OutFile 'install-azd.ps1'; ./install-azd.ps1 -Version 'daily'"
REPRO STEPS
1.File > New Project > .NET Aspire Starter Application > Make sure .NET 8.0 is select, ensure that Use Redis for caching(requires a supported container runtime) is checked.
2.Open a new terminal window and cd into the root of the project and type azd init.
3.Create a folder named .github at the root of your project, create a folder workflows in ".github" folder, create
azure-dev.yml in folder "workflows" then add below code to azure-dev.yml file.
on:
workflow_dispatch:
push:
# Run when commits are pushed to mainline branch (main or master)
# Set this to the mainline branch you are using
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install azd
uses: Azure/setup-azd@v0.1.0
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Log in with Azure (Federated Credentials)
if: ${{ env.AZURE_CLIENT_ID != '' }}
run: |
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
shell: pwsh
- name: Log in with Azure (Client Credentials)
if: ${{ env.AZURE_CREDENTIALS != '' }}
run: |
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
Write-Host "::add-mask::$($info.clientSecret)"
azd auth login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
shell: pwsh
- name: Provision Infrastructure
run: azd provision --no-prompt
- name: Deploy Application
run: azd deploy --no-prompt
4.Run the azd pipeline config command and type "y" when azd prompts you to commit and push your local changes to start the configured CI pipeline.
Note:
1.The workaround is sample, just close the vs and the command window, then reopen the command window, rerun the "azd pipeline config", this issue will not repro.
2.When do scenario Tutorial: Deploy a .NET Aspire app using the Azure Developer CLI and GitHub Actions meet this issue, can refer this for details info.
ACTUAL: Error pop up"failed to add files..."
ERROR: git push: adding files: failed to add files: exit code: 128, stdout: , stderr: warning: in the working copy of '.gitignore', LF will be replaced by CRLF the next time Git touches it
error: open(".vs/AspireSample/FileContentIndex/c963a3b7-5269-46f1-8405-9bf21f5b58c9.vsidx"): Permission denied
error: unable to index file '.vs/AspireSample/FileContentIndex/c963a3b7-5269-46f1-8405-9bf21f5b58c9.vsidx'
fatal: adding files failed
EXPECTED No Error pop up.
@rajeshkamal5050 , when add .vs/*
to .gitignore, this issue will not repro, thanks for your solution.
Hi @v-yuwzh, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.