Skip to content
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

[BUG]: 'Publish failed' for deploying new Zip Files to Azure Linux Functions App (restart required before this works) #19272

Open
4 of 7 tasks
mrowles opened this issue Nov 14, 2023 · 1 comment

Comments

@mrowles
Copy link

mrowles commented Nov 14, 2023

New issue checklist

Task name

Deploy Function App

Task version

No response

Issue Description

I have to restart my Azure Linux Functions App before I can redeploy using Zip File deploys. I have read that this is due to file locks, but the fixes I've attempted to use do not work. Hopefully someone from the Azure Functions team sees this and can assist.

I use the Terraform CDK to do this deployment - but this shouldn't matter as the underlying process is the same, but here is the code just in case:

    ...
    this.servicePlan = new ServicePlan(this, 'sp', {
      name: 'my-app',
      location: 'eastus',
      resourceGroupName: 'some-resource-group',
      osType: 'Linux',
      skuName: 'EP1', // have tried other plans such as 'EP1', 'EP3' etc.
    });

    new LinuxFunctionApp(this, 'lfa', {
      dependsOn: [
        this.servicePlan,
        this.applicationInsights,
        this.storageAccount,
      ],

      name: 'my-app',
      location: 'eastus',
      resourceGroupName: 'some-resource-group',
      servicePlanId: this.servicePlan.id,
      storageAccountName: this.storageAccount.name,
      storageAccountAccessKey: this.storageAccount.primaryAccessKey,
      functionsExtensionVersion: '~4',
      httpsOnly: true,
      zipDeployFile: 'path/to/package.zip',

      appSettings: {
        AZURE_STORAGE_CONNECTION_STRING: this.azureStorageConnectionString.value,
        FUNCTIONS_WORKER_RUNTIME: 'node',
        MSDEPLOY_RENAME_LOCKED_FILES: '1', // this does not fix it!
        WEBSITE_RUN_FROM_PACKAGE: '0', // this does not fix it!
        SCM_DO_BUILD_DURING_DEPLOYMENT: 'true',
        AzureWebJobsFeatureFlags: 'EnableWorkerIndexing',
        WEBSITES_ENABLE_APP_SERVICE_STORAGE: 'false',
      },

      siteConfig: {
        applicationInsightsConnectionString: this.applicationInsights.connectionString,
        applicationInsightsKey: this.applicationInsights.instrumentationKey,
        applicationStack: {
          nodeVersion: '18',
        },
        alwaysOn: false,
        elasticInstanceMinimum: 1,
        healthCheckPath: '/api/health',
        appCommandLine: 'node dist/index.js',
      },
    });

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

No response

Operation system

Linux

Relevant log output

Error: publishing source (assets/product-functions-ta/XXXAAADDD123/functions.zip) to site product-functions (Resource Group product-group): waiting for Zip Deployment to complete

Full task logs with system.debug enabled

No response

Repro steps

No response

@FinVamp1
Copy link
Contributor

FinVamp1 commented Feb 6, 2024

@mrowles do you have a date and time for when this happens? You've opened this on the Azure Pipelines task and from the Terraform Template it looks like you are just using ZipDeploy directly via the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants