Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

Error: bash: /_temp/AZ_CLI_GITHUB_ACTION_1631195248537.sh: No such file or directory #19512

Open htranaj opened 3 years ago

htranaj commented 3 years ago

Resource Provider storage blob upload

Description of Feature or Work Requested Am trying to execute the following command to upload files to my storage blob using the azure/cli az storage blob upload-batch -s $GITHUB_WORKSPACE/AJE -d '$interactives-code' --account-name interactivesstaging and am getting an error indicating that no such file or directory exists.

The following are the contents of my yml: `name: CI

on: pull_request: branches:

jobs: build: runs-on: [self-hosted, interactives]

steps:
  - uses: actions/checkout@v2 # GitHub Actions plugin to checkout repositories
  - uses: azure/login@v1
    with:
      creds: ${{ secrets.AZURE_CREDENTIALS }}

  - name: Upload to blob storage
    uses: azure/cli@v1
    with:
      azcliversion: 2.0.72
      inlineScript: |
        az storage blob upload-batch -s $GITHUB_WORKSPACE/AJE -d '$interactives-code' --account-name interactivesstaging

  - name: logout
    run: |
        az logout
    if: always()`

This is the output I am receiving: `Run azure/login@v1 with: creds: *** enable-AzPSSession: false environment: azurecloud allow-no-subscriptions: false /usr/bin/az cloud set -n azurecloud Done setting cloud: "azurecloud" Login successful. 1s Run azure/cli@v1 with: azcliversion: 2.0.72 inlineScript: az storage blob upload-batch -s $GITHUB_WORKSPACE/AJE -d '$interactives-code' --account-name interactivesstaging

env: AZURE_HTTP_USER_AGENT: AZUREPS_HOST_ENVIRONMENT: Starting script execution via docker image mcr.microsoft.com/azure-cli:2.0.72 Error: Error: bash: /_temp/AZ_CLI_GITHUB_ACTION_1631195248537.sh: No such file or directory

cleaning up container... MICROSOFT_AZURE_CLI_1631195248439_CONTAINER`

I would be very grateful if you can point me in a direction to sort out why I am getting this 'No such file or directory' error.

Minimum API Version Required default

Swagger Link n/a

Target Date 16 Sept 2021

yonzhan commented 3 years ago

storage

evelyn-ys commented 3 years ago

Please upgrade CLI version. The latest CLI is 2.28.0. 2.0.72 is too old

htranaj commented 3 years ago

Updated to use latest CLI version, and am still getting same error.

evelyn-ys commented 3 years ago

az storage blob upload-batch will list all files under $GITHUB_WORKSPACE/AJE directory and then upload one by one. It seems /_temp/AZ_CLI_GITHUB_ACTION_1631195248537.sh was somehow deleted before uploading.

Another suggestion: upload-batch will upload serially, you can try az storage copy for efficiency.