skip to Main Content

I’ve created an Azure Function App (Linux) running on an App Service Plan Y1 and have my sources in Azure DevOps Git. The functions are written in C# on DOTNET 6.

Below you can see my YAML definitions for the CI and a separated CD pipeline. When I execute the pipeline everything works well (both are green). After the deployment however this is how my Azure Portal looks in the Functions blade:

Azure Portal

Using the VS Code Azure Extension and looking into the files of the function app I get:

404 for bin

When I look in the artifact of the CI pipeline everything looks good (explorer view of the downloaded zip):

ZIP Content

The bin-folder is populated there.

Some key points:

  • I have no slots in the function app.
  • The deployments are visible in the associated App Insights.
  • My reference point is Microsoft Learn

So is it normal to get the 404 when searching in VS code and did somebody experience something similar or even know the solution?

Sidenote:

I used to deploy my function using VS Code with extensions install. Today I now get a weired error message after the deployment:

Telemetry error in VS Code

CI YAML

pool:
    vmImage: 'ubuntu-latest'

trigger: none

variables:
    - name: 'Solution'
      value: '**/MyProject.sln'
    - name: 'ProjectFilter'
      value: '**/*.csproj'    
    - name: 'BuildConfiguration'
      value: 'Release'

steps:   
    - task: UseDotNet@2
      displayName: Use DotNet 6
      inputs:
          version: '6.0.x'
    - task: DotNetCoreCLI@2
      displayName: Restore
      inputs:
          command: restore
          projects: '$(ProjectFilter)'
    - task: DotNetCoreCLI@2
      displayName: Build
      inputs:
          projects: '$(ProjectFilter)'
          arguments: '--no-restore --configuration $(BuildConfiguration)'    
    - task: DotNetCoreCLI@2
      displayName: Publish Image Converter
      inputs:
          command: publish
          projects: src/Functions/**/MyProject.csproj
          publishWebProjects: false
          arguments: '--no-restore --no-build --configuration $(BuildConfiguration) --output $(Build.DefaultWorkingDirectory)/function_publish_output'
          zipAfterPublish: false
    - task: ArchiveFiles@2
      displayName: Archive Image Converter
      inputs:
          rootFolderOrFile: '$(Build.DefaultWorkingDirectory)/function_publish_output'
          includeRootFolder: false
          archiveFile: '$(Build.ArtifactStagingDirectory)/MyProject.zip'
    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact'
      inputs:
          PathtoPublish: '$(Build.ArtifactStagingDirectory)'
      condition: succeededOrFailed()

CD YAML

variables:
  - name: 'vmImageName'
    value: 'ubuntu-latest'
  - name: 'serviceConnectionName'
    value: 'MYCONN'
  - name: 'project'
    value: 'MYPROJECT'

resources:
  pipelines:
    - pipeline: ci
      source: 'NAMEOFCI'
      trigger: true

pool:
  vmImage: $(vmImageName)

trigger: none

stages:
  - stage: Production
    displayName: Production
    jobs:
      - deployment: Deploy
        displayName: 'Deploy'
        environment: 'Production'
        pool:
          vmImage: $(vmImageName)
        strategy:
          runOnce:
            deploy:
              steps:
                - download: ci
                  displayName: 'Download Artifact'
                  artifact: drop
                - task: AzureFunctionApp@1
                  displayName: 'Deploy Image Converter Function'
                  inputs:
                    azureSubscription: '$(serviceConnectionName)'
                    appType: functionAppLinux
                    appName: 'fapp-**********-prod'
                    package: '$(Pipeline.Workspace)/ci/drop/MyProject.zip'
                    runtimeStack: 'DOTNET|6.0'

UPDATE

I decided to redeploy my function and could deploy using VS Code directly again when switching from Y1 to S1. Using the Azure DevOps Pipeline still gives me a green checkmark there but no function triggers visible in the portal. Switching back to Y1 brings the error in VS Code back.

2

Answers


  1. Can you check what exactly you see on the file system? You can use console or Advanced tools:

    enter image description here

    Login or Signup to reply.
  2. we had a similar issue and had to add a parameter to app settings. In our case directly via terraform.

    app_settings = {
     WEBSITE_RUN_FROM_PACKAGE = "1"
    }
    

    Cheers

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search