Giter VIP home page Giter VIP logo

functions-action's Introduction

GitHub Actions for deploying to Azure Functions

master dev
Coverage master coverage dev coverage
Unit Test master unit test dev unit test
.NETCore Windows master .netcore windows e2e dev .netcore windows e2e
.NETCore Linux master .netcore linux e2e dev .netcore linux e2e
Java Windows master java windows e2e dev java windows e2e
Java Linux master java linux e2e dev java linux e2e
Node JS Windows master nodejs windows e2e dev nodejs windows e2e
Node JS Linux master nodejs linux e2e dev nodejs linux e2e
PowerShell Windows master powershell windows e2e dev powershell windows e2e
Python Linux master python linux e2e dev python linux e2e

With the Azure Functions GitHub Action, you can automate your workflow to deploy Azure Functions.

Get started today with a free Azure account!

The repository contains a GitHub Action to deploy your function app project into Azure Functions. If you are looking for a GitHub Action to deploy your customized container image into an Azure Functions container, please consider using functions-container-action.

The definition of this GitHub Action is in action.yml.

Kudu zip deploy method is used by the action for deployment of Functions.

End-to-End Sample workflow

Workflow Templates

Templates Windows Linux
DotNet windows-dotnet-functionapp-on-azure.yml linux-dotnet-functionapp-on-azure.yml
Node windows-node.js-functionapp-on-azure.yml linux-node.js-functionapp-on-azure.yml
PowerShell windows-powershell-functionapp-on-azure.yml linux-powershell-functionapp-on-azure.yml
Java windows-java-functionapp-on-azure.yml linux-java-functionapp-on-azure.yml
Python - linux-python-functionapp-on-azure.yml

If you have extension project(s) in your repo, these templates will NOT resolve the extensions.csproj in your project. If you want to use binding extensions (e.g. Blob/Queue/EventHub Triggers), please consider registering Azure Functions binding extensions in your host.json.

Alternatively, you can add a - run: dotnet build --output ./bin step before functions-action step.

"Remove additional files at destination" is not supported by Kudu deploy method used in this action and should be handled separately. When a new build is deployed with zipdeploy, files and directories that were created by the previous deployment but are no longer present in the build will be deleted. Any other files and directories found in the site that aren't being overwritten by the deployment, such as those placed there via FTP or created by your app during runtime, will be preserved.

Supported Languages and versions

Using Publish Profile as Deployment Credential (recommended)

Using publish profile as deployment credential is recommended if you are not the owner of your Azure subscription. Follow these steps to configure your workflow to use the publish profile from your function app.

NOTE: If you are using a Custom handler with the Linux consumption SKU, this deployment process will not work . You must use a Service Principal and authenticate with the azure/login action.

  1. In Azure portal, go to your function app.
  2. Click Get publish profile and download .PublishSettings file.
  3. Open the .PublishSettings file and copy the content.
  4. Paste the XML content to your GitHub Repository > Settings > Secrets > Add a new secret > AZURE_FUNCTIONAPP_PUBLISH_PROFILE
  5. Use one of the above workflow templates as a reference to build your workflow in .github/workflows/ directory.
  6. Change variable values in env: section according to your function app.
  7. Commit and push your project to GitHub repository, you should see a new GitHub workflow initiated in Actions tab.

Using Azure Service Principal for RBAC as Deployment Credential

NOTE: If you want to deploy to Linux Consumption plan and your app contains executable file(custom handler, chrome in Puppeteer/Playwright etc), you need to use this way in order to keep executable permission.

Follow these steps to configure your workflow to use an Azure Service Principal for RBAC and add them as a GitHub Secret in your repository.

  1. Download Azure CLI from here, run az login to login with your Azure credentials.
  2. Run Azure CLI command
   az ad sp create-for-rbac --name "myApp" --role contributor \
                            --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Web/sites/{app-name} \
                            --sdk-auth

  # Replace {subscription-id}, {resource-group}, and {app-name} with the names of your subscription, resource group, and Azure function app.
  # The command should output a JSON object similar to this:

  {
    "clientId": "<GUID>",
    "clientSecret": "<GUID>",
    "subscriptionId": "<GUID>",
    "tenantId": "<GUID>",
    (...)
  }
  1. Copy and paste the json response from above Azure CLI to your GitHub Repository > Settings > Secrets > Add a new secret > AZURE_RBAC_CREDENTIALS
  2. Use Windows DotNet Function App RBAC template as a reference to build your workflow in .github/workflows/ directory. Ensure that you use azure/login action and that you are not using the publish-profile parameter
  3. Change variable values in env: section according to your function app.
  4. Commit and push your project to GitHub repository, you should see a new GitHub workflow initiated in Actions tab.

Azure Functions GitHub Action is supported for the Azure public cloud as well as Azure government clouds ('AzureUSGovernment' or 'AzureChinaCloud') and Azure Stack ('AzureStack') Hub. Before running this action, login to the respective Azure Cloud using Azure Login by setting appropriate value for the environment parameter.

Manged Identities for Storage Account Access and Package Deployments on Linux Consumption SKU

If the function app uses managed identities for accessing the storage account (i.e. AzureWebJobsStorage is not set) then the action will use the RBAC account to publish a package deployment to the storage account defined in AzureWebJobsStorage__accountName. The app setting WEBSITE_RUN_FROM_PACKAGE will be created during deployment and will not include a SAS token.

If WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID is defined then user-assigned manage identity will be used, otherwise system-assigned manage identity. The RBAC account will require Microsoft.Storage/storageAccounts/listkeys/action if AzureWebJobsStorage is not set.

GitHub Action Parameters

Required parameters for all function app plans:

  • app-name: The function app name on Azure (e.g. if your app's homepage is https://your-site-name.azurewebsites.net/, then app-name should be your-site-name).
  • package: This is the location in your project to be published. By default, this value is set to ., which means all files and folders in the GitHub repository will be deployed.

Parameters specific to the Flex Consumtion plan:

  • sku: Set this to flexconsumption when authenticating with publish-profile. When using RBAC credentials or deploying to a non-Flex Consumption plan, the Action can resolve the value, so the parameter does not need to be included.
  • remote-build: Set this to true to enable a build action from Kudu when the package is deployed to a Flex Consumption app. Oryx build is always performed during a remote build in Flex Consumption; do not set scm-do-build-during-deployment or enable-oryx-build. By default, this parameter is set to false.

Parameters specific to the Consumption, Elastic Premium, and App Service (Dedicated) plans:

  • scm-do-build-during-deployment: Allow the Kudu site (e.g. https://your-site-name.scm.azurewebsites.net/) to perform pre-deployment operations. By default, this is set to false. If you don't want to resolve the dependencies in the GitHub Workflow, and instead, you want to control the deployments in Kudu / KuduLite, you may want to change this setting to true. For more information on SCM_DO_BUILD_DURING_DEPLOYMENT setting, please visit our Kudu doc.
  • enable-oryx-build: Allow Kudu site to resolve your project dependencies with Oryx. By default, this is set to false. If you want to use Oryx to resolve your dependencies (e.g. remote build) instead of the GitHub Workflow, set scm-do-build-during-deployment and enable-oryx-build to true.

Optional parameters for all function app plans:

  • slot-name: This is the slot name to be deployed to. By default, this value is empty, which means the GitHub Action will deploy to your production site. When this setting points to a non-production slot, please ensure the publish-profile parameter contains the credentials for the slot instead of the production site. Currently not supported in Flex Consumption.
  • publish-profile: The credentials that will be used during the deployment. It should contain a piece of XML content from your .PublishSettings file. You can acquire .PublishSettings by visiting the Azure Portal -> Your Function App -> Overview -> Get Publish Profile. We highly recommend setting the content in GitHub secrets since it contains sensitive information such as your site URL, username, and password. When the publish profile is rotated in your function app, you also need to update the GitHub secret. Otherwise, a 401 error will occur when accessing the /api/settings endpoint.
  • respect-pom-xml: Allow the GitHub Action to derive the Java function app's artifact from pom.xml for deployments. By default, it is set to false, which means the package parameter needs to point to your Java function app's artifact (e.g. ./target/azure-functions/). It is recommended to set package to . and respect-pom-xml to true when deploying Java function apps.
  • respect-funcignore: Allow the GitHub Action to parse your .funcignore file and exclude files and folders defined in it. By default, this value is set to false. If your GitHub repo contains .funcignore file and you want to exclude certain paths (e.g. text editor configs .vscode/, Python virtual environment .venv/), we recommend setting this to true.

Dependencies on other GitHub Actions

  • Checkout Checkout your Git repository content into GitHub Actions agent.
  • Azure Login Login with your Azure credentials for function app deployment authentication.
  • Environment setup actions
    • Setup DotNet Build your DotNet core function app or function app extensions.
    • Setup Node Resolve Node function app dependencies using npm.
    • Setup Python Resolve Python function app dependencies using pip.
    • Setup Java Resolve Java function app dependencies using maven.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

functions-action's People

Contributors

20shivangi avatar ahmelsayed avatar aksm-ms avatar alfredodeza avatar amrutakawade avatar arroyc avatar balaga-gayatri avatar dependabot[bot] avatar hazhzeng avatar horihiro avatar im-samz avatar jamiemagee avatar jordanfinners avatar kamperiadis avatar kanika1894 avatar mamidenn avatar microsoftopensource avatar msftgits avatar n-usha avatar nexxai avatar orta avatar patelchandni avatar roopeshnair avatar solvaholic avatar suaggar avatar timowilhelm avatar tomkerkhove avatar zainuvk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

functions-action's Issues

Linux ElasticPremium plan is not yet supported

The workflow working for Functions Consumption plan does not work for Functions Premium plan.

Github Action step:

..............
    - name: 'Login via Azure CLI'
      uses: azure/login@v1
      with:
        creds: ${{ secrets.AZURE_RBAC_CREDENTIALS }}

    - name: 'Deploy Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}-${{ env.ENVIRONMENT }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
..............

Result:

Run Azure/functions-action@v1
##[Initialize]
##[ValidateParameter]
##[ValidateAzureResource]
Using RBAC for authentication, GitHub Action will perform resource validation.
Sucessfully acquired site configs from function app!
Detected function app sku: ElasticPremium
Sucessfully acquired app settings from function app (RBAC)!
Detected function app language: Python
##[error]Execution Exception (state: ValidateAzureResource) (step: ChangeContext)
##[error]  At ValidateAzureResource, Function Runtime : Linux ElasticPremium plan is not yet supported.
##[error]Deployment Failed!

Unable to deploy function app with RBAC

I had trouble deploying a function app using a service principal. The latest Azure/functions-action@v1 seems to always use SCM credentials, even if no publish profile is specified.

Logs:

2020-11-15T05:00:31.7682000Z ##[group]Run Azure/functions-action@v1
2020-11-15T05:00:31.7682891Z with:
2020-11-15T05:00:31.7683719Z   app-name: ***
2020-11-15T05:00:31.7684604Z   package: ***
~~~
2020-11-15T05:00:31.7692175Z ##[endgroup]
2020-11-15T05:00:32.2293298Z ##[Initialize]
2020-11-15T05:00:32.2352987Z ##[ValidateParameter]
2020-11-15T05:00:32.2370259Z ##[ValidateAzureResource]
2020-11-15T05:00:32.2376919Z Using SCM credential for authentication, GitHub Action will not perform resource validation.
2020-11-15T05:00:32.3097967Z ##[error]Execution Exception (state: ValidateAzureResource) (step: Invocation)
2020-11-15T05:00:32.3116888Z ##[error]  When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings (SCM)
2020-11-15T05:00:32.3120900Z ##[error]    Failed to fetch Kudu App Settings.
Bad Request (CODE: 400)
2020-11-15T05:00:32.3130134Z ##[error]      Error: Failed to fetch Kudu App Settings.
Bad Request (CODE: 400)
    at Kudu.<anonymous> (D:\a\_actions\Azure\functions-action\v1\node_modules\azure-actions-appservice-rest\Kudu\azure-app-kudu-service.js:62:23)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\Azure\functions-action\v1\node_modules\azure-actions-appservice-rest\Kudu\azure-app-kudu-service.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
2020-11-15T05:00:32.3138642Z ##[error]Deployment Failed!

I think this creds was changed to a non-null value recently

let creds: IScmCredentials = Builder.GetDefaultScmCredential();
if (publishProfile === undefined || publishProfile.trim() === "") {
return creds;
}

and then context.authenticationType is always Scm.
context.authenticationType = this._scmCredentials ? AuthenticationType.Scm : AuthenticationType.Rbac;

I'm using Azure/[email protected] for now and it's working.

.NET 6 and v4 tooling

Hi,

According to this page, one should be able to test Azure Functions on .NET 6 running in dotnet-isolated mode.

They mention publishing using the following command

$ func azure functionapp publish myapp --dotnet-version 6.0

Is it possible to provide that last parameter --dotnet-version 6.0 somehow using this GH action?

Action runs indefinitely on step Waiting for function app to spin up after app settings change

Hi, I'm trying to use the Functions Action and it will run indefinitely on this step. Here is the YAML.


name: .NET Core

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
    - name: Install dependencies
      run: dotnet restore
    - name: Build
      run: dotnet build --configuration Release --no-restore
    - name: Test
      run: dotnet test --no-restore --verbosity normal
    - name: Upload artifact
      uses: actions/[email protected]
      with:
        # Artifact name
        name: portalapi 
        # Directory containing files to upload
        path: /home/runner/work/portal-api/portal-api/FunctionApp1/bin/Release/netcoreapp3.1/bin/ng6users.api.dll
    - name: Azure Login  
      uses: azure/login@v1
      with:
        creds: ${{ secrets.AZURE_AUTH }}
    - name: Azure Functions Action
      uses: Azure/[email protected]
      with:
        # Name of the Azure Function App
        app-name: ghusersapi
        # Path to package or folder. *.zip or a folder to deploy
        package: /home/runner/work/portal-api/portal-api/FunctionApp1/bin/Release/netcoreapp3.1/bin/

Thanks,
Mike

Function deployment with slot and SPN as deployment credential is not working

Hi Team, I am using azure function action and using slot name and SPN as deployment credentials. Here is my workflow
https://github.com/tiwarishub/samples/actions/runs/560242979/workflow
image

I am getting the below error
image

Here is a sample run with debug flag ACTIONS_STEP_DEBUG set to true https://github.com/tiwarishub/samples/runs/1885323454?check_suite_focus=true

I looked into the code and found that for this scenario, you are expecting Publish profile to present

private validateScmCredentialsSlotName(state: StateConstant): void {

It has reference to this._scmCredentials. And this scmCredentials with being set to default value
public static GetDefaultScmCredential(): IScmCredentials {

when publish profile is not present and in that URL is set to undefined . which is causing this issue

Action continues when appname-slotname mismatches SCM credentials

The function app will still be deployed to production when using SCM credentials even if the slot-name is set. Due to the limitation of the SCM credentials, the GitHub Action only have access to 1 site (either production or slot).

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: hazeng-fa-node-stage
        package: '.'
        publish-profile: ${{ secrets.SCM_CREDENTIALS }}
        slot-name: this-will-be-ignored

There's a way to mitigate this, that is to add a dash with slotname in the app-name, and use SCM_CREDENTIALS of the slot for deployment.

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: hazeng-fa-node-stage-slotnamehere
        package: '.'
        publish-profile: ${{ secrets.SCM_CREDENTIALS_OF_THE_SLOT }}

Extensions missing from docs

I've tried to use the example yml file, but the deployed app did not start on azure. Inspecting the differences between the zip deployed by this action, and the zip deployed by the vscode azure functions extension, there was one difference. The bin and obj folders were missing.

The doc should include extension installation before deployment. The bin and obj folders are in the .gitignore by default, so they should be generated on deployment. The working code:

`

  • name: 'Run npm'
    shell: pwsh
    run: |
    npm install
    dotnet build extensions.csproj -o bin --no-incremental
    `

With this code, the action runs for 4 minutes. Maybe there is another way of installing extensions, but making the whole process faster.

All my function apps have stopped deploying since 16th November

I have a couple of workflows that use azure/functions-action@v1 that have stopped working in the last day or so i do recall mention of set-env deprecation in the logs a few days ago but I was focusing on something else so didn't follow-up.

I have a number of applications that use this action, and as it happens they have all stopped working overnight. I suspect they may be related to this. There have been no other relevant changes in my repos. Take a look at these:

https://github.com/nikkh/heracles-ai/runs/1411302955
https://github.com/nikkh/heracles-ai/runs/1406173184
https://github.com/nikkh/zodiac/runs/1407855810

This is a log from a successful run for the first failure above:

https://github.com/nikkh/heracles-ai/runs/1397235421

Unfortunately, since I am mainly developing the workflows I have a cleanup job that deletes successfully deployed azure resources so I cant go back and look at (e.g.) kudo logs for successful deployments.

I'm an MS-FTE you can ping nhill to get in touch.

How to preserve file permissions in zip package

When deploying zip package to Linux function app on consumption plan using this action, the deployment was succeeded but executable permission for each file is lost.
Could you please let me know how to preserve the permissions after the deployment?

I'm trying to deploy the package including puppeteer to Linux consumption function app from this repository and it needs executable permission for the binary file chrome.

According to the action's log, the binary chrome was executable before archiving.

2020-12-06T00:03:32.7725518Z -rwxr-xr-x 1 runner docker 268577208 Dec 6 00:03 ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome

After the deployment, the permission is lost and it cannot become executable.
# this can be checked by /api/showchromepermission in the above my repo
image

The permission lost causes failure to launch chrome

The action and full log are followings.

yaml for GitHub Action
name: Deploy Node.js project to Azure Function App

on:
  [push]

env:
  AZURE_FUNCTIONAPP_NAME: puppeteerga      # set this to your application's name
  AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'      # set this to the path to your web app project, defaults to the repository root
  NODE_VERSION: '12.x'                     # set this to the node version to use (supports 8.x, 10.x, 12.x)

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Node ${{ env.NODE_VERSION }} Environment
      uses: actions/setup-node@v1
      with:
        node-version: ${{ env.NODE_VERSION }}

    - name: 'Resolve Project Dependencies Using Npm'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        npm install
        npm run build --if-present
        npm run test --if-present
        ls -al ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome
        popd
    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
Full GitHub Action's log

2020-12-06T00:03:09.7677286Z ##[section]Starting: Request a runner to run this job 2020-12-06T00:03:09.9550839Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:09.9550941Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:09.9551324Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:10.1008331Z ##[section]Finishing: Request a runner to run this job 2020-12-06T00:03:17.6831500Z Current runner version: '2.274.2' 2020-12-06T00:03:17.6867533Z ##[group]Operating System 2020-12-06T00:03:17.6868680Z Ubuntu 2020-12-06T00:03:17.6869163Z 18.04.5 2020-12-06T00:03:17.6869678Z LTS 2020-12-06T00:03:17.6870182Z ##[endgroup] 2020-12-06T00:03:17.6870837Z ##[group]Virtual Environment 2020-12-06T00:03:17.6871566Z Environment: ubuntu-18.04 2020-12-06T00:03:17.6872224Z Version: 20201129.1 2020-12-06T00:03:17.6873559Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201129.1/images/linux/Ubuntu1804-README.md 2020-12-06T00:03:17.6874546Z ##[endgroup] 2020-12-06T00:03:17.6877960Z Prepare workflow directory 2020-12-06T00:03:17.7720424Z Prepare all required actions 2020-12-06T00:03:17.7732627Z Getting action download info 2020-12-06T00:03:17.9846961Z Download action repository 'actions/checkout@master' 2020-12-06T00:03:20.0390907Z Download action repository 'actions/setup-node@v1' 2020-12-06T00:03:20.2143423Z Download action repository 'Azure/functions-action@v1' 2020-12-06T00:03:22.5790613Z ##[group]Run actions/checkout@master 2020-12-06T00:03:22.5791307Z with: 2020-12-06T00:03:22.5791971Z repository: horihiro/puppeteer-permission-cicd 2020-12-06T00:03:22.5793289Z token: *** 2020-12-06T00:03:22.5793803Z ssh-strict: true 2020-12-06T00:03:22.5794320Z persist-credentials: true 2020-12-06T00:03:22.5794813Z clean: true 2020-12-06T00:03:22.5795198Z fetch-depth: 1 2020-12-06T00:03:22.5795593Z lfs: false 2020-12-06T00:03:22.5795973Z submodules: false 2020-12-06T00:03:22.5796359Z env: 2020-12-06T00:03:22.5796826Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:22.5797422Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:22.5797886Z NODE_VERSION: 12.x 2020-12-06T00:03:22.5798283Z ##[endgroup] 2020-12-06T00:03:23.5414567Z Syncing repository: horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5415630Z ##[group]Getting Git version info 2020-12-06T00:03:23.5417070Z Working directory is '/home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd' 2020-12-06T00:03:23.5420670Z [command]/usr/bin/git version 2020-12-06T00:03:23.5427850Z git version 2.29.2 2020-12-06T00:03:23.5437988Z ##[endgroup] 2020-12-06T00:03:23.5439780Z Deleting the contents of '/home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd' 2020-12-06T00:03:23.5442079Z ##[group]Initializing the repository 2020-12-06T00:03:23.5443694Z [command]/usr/bin/git init /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:23.5449421Z Initialized empty Git repository in /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/.git/ 2020-12-06T00:03:23.5452485Z [command]/usr/bin/git remote add origin https://github.com/horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5453906Z ##[endgroup] 2020-12-06T00:03:23.5454458Z ##[group]Disabling automatic garbage collection 2020-12-06T00:03:23.5455288Z [command]/usr/bin/git config --local gc.auto 0 2020-12-06T00:03:23.5455781Z ##[endgroup] 2020-12-06T00:03:23.5457312Z ##[group]Setting up auth 2020-12-06T00:03:23.5458205Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand 2020-12-06T00:03:23.5459694Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || : 2020-12-06T00:03:23.5461344Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader 2020-12-06T00:03:23.5463655Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || : 2020-12-06T00:03:23.5465712Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic *** 2020-12-06T00:03:23.5466607Z ##[endgroup] 2020-12-06T00:03:23.5467126Z ##[group]Fetching the repository 2020-12-06T00:03:23.5468827Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +eb18d606763ef6417647df90d95b8f77da64ac9a:refs/remotes/origin/master 2020-12-06T00:03:23.5470445Z remote: Enumerating objects: 27, done. 2020-12-06T00:03:23.5471046Z remote: Counting objects: 3% (1/27) 2020-12-06T00:03:23.5471615Z remote: Counting objects: 7% (2/27) 2020-12-06T00:03:23.5472167Z remote: Counting objects: 11% (3/27) 2020-12-06T00:03:23.5472738Z remote: Counting objects: 14% (4/27) 2020-12-06T00:03:23.5473292Z remote: Counting objects: 18% (5/27) 2020-12-06T00:03:23.5473859Z remote: Counting objects: 22% (6/27) 2020-12-06T00:03:23.5474411Z remote: Counting objects: 25% (7/27) 2020-12-06T00:03:23.5474977Z remote: Counting objects: 29% (8/27) 2020-12-06T00:03:23.5475690Z remote: Counting objects: 33% (9/27) 2020-12-06T00:03:23.5476242Z remote: Counting objects: 37% (10/27) 2020-12-06T00:03:23.5476906Z remote: Counting objects: 40% (11/27) 2020-12-06T00:03:23.5477472Z remote: Counting objects: 44% (12/27) 2020-12-06T00:03:23.5478034Z remote: Counting objects: 48% (13/27) 2020-12-06T00:03:23.5478607Z remote: Counting objects: 51% (14/27) 2020-12-06T00:03:23.5479154Z remote: Counting objects: 55% (15/27) 2020-12-06T00:03:23.5479717Z remote: Counting objects: 59% (16/27) 2020-12-06T00:03:23.5480267Z remote: Counting objects: 62% (17/27) 2020-12-06T00:03:23.5480831Z remote: Counting objects: 66% (18/27) 2020-12-06T00:03:23.5481381Z remote: Counting objects: 70% (19/27) 2020-12-06T00:03:23.5481941Z remote: Counting objects: 74% (20/27) 2020-12-06T00:03:23.5482491Z remote: Counting objects: 77% (21/27) 2020-12-06T00:03:23.5483224Z remote: Counting objects: 81% (22/27) 2020-12-06T00:03:23.5483780Z remote: Counting objects: 85% (23/27) 2020-12-06T00:03:23.5484350Z remote: Counting objects: 88% (24/27) 2020-12-06T00:03:23.5485001Z remote: Counting objects: 92% (25/27) 2020-12-06T00:03:23.5485517Z remote: Counting objects: 96% (26/27) 2020-12-06T00:03:23.5486230Z remote: Counting objects: 100% (27/27) 2020-12-06T00:03:23.5486907Z remote: Counting objects: 100% (27/27), done. 2020-12-06T00:03:23.5487487Z remote: Compressing objects: 4% (1/22) 2020-12-06T00:03:23.5488047Z remote: Compressing objects: 9% (2/22) 2020-12-06T00:03:23.5488619Z remote: Compressing objects: 13% (3/22) 2020-12-06T00:03:23.5489175Z remote: Compressing objects: 18% (4/22) 2020-12-06T00:03:23.5489754Z remote: Compressing objects: 22% (5/22) 2020-12-06T00:03:23.5490329Z remote: Compressing objects: 27% (6/22) 2020-12-06T00:03:23.5490889Z remote: Compressing objects: 31% (7/22) 2020-12-06T00:03:23.5491457Z remote: Compressing objects: 36% (8/22) 2020-12-06T00:03:23.5492014Z remote: Compressing objects: 40% (9/22) 2020-12-06T00:03:23.5492590Z remote: Compressing objects: 45% (10/22) 2020-12-06T00:03:23.5493157Z remote: Compressing objects: 50% (11/22) 2020-12-06T00:03:23.5493737Z remote: Compressing objects: 54% (12/22) 2020-12-06T00:03:23.5494297Z remote: Compressing objects: 59% (13/22) 2020-12-06T00:03:23.5494872Z remote: Compressing objects: 63% (14/22) 2020-12-06T00:03:23.5495447Z remote: Compressing objects: 68% (15/22) 2020-12-06T00:03:23.5496008Z remote: Compressing objects: 72% (16/22) 2020-12-06T00:03:23.5496582Z remote: Compressing objects: 77% (17/22) 2020-12-06T00:03:23.5497135Z remote: Compressing objects: 81% (18/22) 2020-12-06T00:03:23.5497707Z remote: Compressing objects: 86% (19/22) 2020-12-06T00:03:23.5498264Z remote: Compressing objects: 90% (20/22) 2020-12-06T00:03:23.5498837Z remote: Compressing objects: 95% (21/22) 2020-12-06T00:03:23.5499395Z remote: Compressing objects: 100% (22/22) 2020-12-06T00:03:23.5500026Z remote: Compressing objects: 100% (22/22), done. 2020-12-06T00:03:23.5501094Z remote: Total 27 (delta 2), reused 22 (delta 2), pack-reused 0 2020-12-06T00:03:23.5627784Z From https://github.com/horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5629185Z * [new ref] eb18d606763ef6417647df90d95b8f77da64ac9a -> origin/master 2020-12-06T00:03:23.5704090Z ##[endgroup] 2020-12-06T00:03:23.5705721Z ##[group]Determining the checkout info 2020-12-06T00:03:23.5706296Z ##[endgroup] 2020-12-06T00:03:23.5706919Z ##[group]Checking out the ref 2020-12-06T00:03:23.5708291Z [command]/usr/bin/git checkout --progress --force -B master refs/remotes/origin/master 2020-12-06T00:03:23.5810259Z Reset branch 'master' 2020-12-06T00:03:23.5818337Z Branch 'master' set up to track remote branch 'master' from 'origin'. 2020-12-06T00:03:23.5829756Z ##[endgroup] 2020-12-06T00:03:23.5894113Z [command]/usr/bin/git log -1 --format='%H' 2020-12-06T00:03:23.5927565Z 'eb18d606763ef6417647df90d95b8f77da64ac9a' 2020-12-06T00:03:23.6119413Z ##[group]Run actions/setup-node@v1 2020-12-06T00:03:23.6119872Z with: 2020-12-06T00:03:23.6120266Z node-version: 12.x 2020-12-06T00:03:23.6120719Z always-auth: false 2020-12-06T00:03:23.6121096Z env: 2020-12-06T00:03:23.6121660Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:23.6122168Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:23.6123120Z NODE_VERSION: 12.x 2020-12-06T00:03:23.6123481Z ##[endgroup] 2020-12-06T00:03:23.7178836Z [command]/opt/hostedtoolcache/node/12.20.0/x64/bin/node --version 2020-12-06T00:03:23.8586454Z v12.20.0 2020-12-06T00:03:23.8606809Z [command]/opt/hostedtoolcache/node/12.20.0/x64/bin/npm --version 2020-12-06T00:03:24.4434245Z 6.14.8 2020-12-06T00:03:24.4587005Z ##[group]Run pushd './.' 2020-12-06T00:03:24.4587588Z �[36;1mpushd './.'�[0m 2020-12-06T00:03:24.4587993Z �[36;1mnpm install�[0m 2020-12-06T00:03:24.4588486Z �[36;1mnpm run build --if-present�[0m 2020-12-06T00:03:24.4589029Z �[36;1mnpm run test --if-present�[0m 2020-12-06T00:03:24.4589851Z �[36;1mls -al ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome�[0m 2020-12-06T00:03:24.4590647Z �[36;1mpopd�[0m 2020-12-06T00:03:24.4634831Z shell: /bin/bash --noprofile --norc -e -o pipefail {0} 2020-12-06T00:03:24.4635380Z env: 2020-12-06T00:03:24.4635904Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:24.4636531Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:24.4637045Z NODE_VERSION: 12.x 2020-12-06T00:03:24.4637460Z ##[endgroup] 2020-12-06T00:03:24.4721956Z ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:26.3530588Z 2020-12-06T00:03:26.3540247Z > [email protected] install /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/node_modules/puppeteer 2020-12-06T00:03:26.3562048Z > node install.js 2020-12-06T00:03:26.3575027Z 2020-12-06T00:03:27.3031708Z 2020-12-06T00:03:32.1249937Z Chromium (818858) downloaded to /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/node_modules/puppeteer/.local-chromium/linux-818858 2020-12-06T00:03:32.2191270Z npm WARN [email protected] No description 2020-12-06T00:03:32.2264835Z npm WARN [email protected] No repository field. 2020-12-06T00:03:32.2336300Z npm WARN [email protected] No license field. 2020-12-06T00:03:32.2338077Z 2020-12-06T00:03:32.2376647Z added 54 packages from 75 contributors and audited 54 packages in 7.128s 2020-12-06T00:03:32.2848891Z 2020-12-06T00:03:32.2850642Z 8 packages are looking for funding 2020-12-06T00:03:32.2851668Z run `npm fund` for details 2020-12-06T00:03:32.2852358Z 2020-12-06T00:03:32.2866170Z found 0 vulnerabilities 2020-12-06T00:03:32.2866778Z 2020-12-06T00:03:32.7582878Z 2020-12-06T00:03:32.7585936Z > [email protected] test /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:32.7587402Z > echo "No tests yet..." 2020-12-06T00:03:32.7587875Z 2020-12-06T00:03:32.7627240Z No tests yet... 2020-12-06T00:03:32.7725518Z -rwxr-xr-x 1 runner docker 268577208 Dec 6 00:03 ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome 2020-12-06T00:03:32.7727913Z ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:32.7797223Z ##[group]Run Azure/functions-action@v1 2020-12-06T00:03:32.7797767Z with: 2020-12-06T00:03:32.7798319Z app-name: puppeteerga 2020-12-06T00:03:32.7798947Z package: . 2020-12-06T00:03:32.7812817Z publish-profile: *** 2020-12-06T00:03:32.7813236Z env: 2020-12-06T00:03:32.7813710Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:32.7814295Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:32.7814755Z NODE_VERSION: 12.x 2020-12-06T00:03:32.7815147Z ##[endgroup] 2020-12-06T00:03:33.0583209Z ##[Initialize] 2020-12-06T00:03:33.0586869Z ##[ValidateParameter] 2020-12-06T00:03:33.0755526Z Successfully passed SCM crednetial from new publishProfile 2020-12-06T00:03:33.0762441Z ##[ValidateAzureResource] 2020-12-06T00:03:33.0765405Z Using SCM credential for authentication, GitHub Action will not perform resource validation. 2020-12-06T00:03:34.0168472Z Sucessfully acquired app settings from function app (SCM)! 2020-12-06T00:03:34.0169735Z ##[PreparePublishContent] 2020-12-06T00:03:34.0172906Z Will archive . into /home/runner/work/_temp/temp_web_package_6067574154394939.zip as function app content 2020-12-06T00:03:46.0712750Z Will use api/zipdeploy to deploy (scm credential) 2020-12-06T00:03:47.0199292Z ##[PublishContent] 2020-12-06T00:03:47.0202226Z Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false 2020-12-06T00:03:47.0203563Z Update using Client.updateAppSettingViaKudu 2020-12-06T00:03:47.9001928Z Response with status code 204 2020-12-06T00:03:53.7477813Z App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container 2020-12-06T00:03:53.7479212Z Setting ENABLE_ORYX_BUILD in Kudu container to false 2020-12-06T00:03:53.7480613Z Update using Client.updateAppSettingViaKudu 2020-12-06T00:03:54.6186544Z Response with status code 204 2020-12-06T00:04:00.5242077Z App setting ENABLE_ORYX_BUILD propagated to Kudu container 2020-12-06T00:04:00.5243558Z Package deployment using ZIP Deploy initiated. 2020-12-06T00:05:28.8878013Z Deploy logs can be viewed at https://puppeteerga.scm.azurewebsites.net/api/deployments/be7da561f3974c39a19a7b4d071cdde0/log 2020-12-06T00:05:28.8882435Z Successfully deployed web package to App Service. 2020-12-06T00:05:30.5999946Z Successfully updated deployment History at https://puppeteerga.scm.azurewebsites.net/api/deployments/eb18d606763ef6417647df90d95b8f77da64ac9a1607213129742 2020-12-06T00:05:31.4270716Z Response with status code 204 2020-12-06T00:05:32.2973086Z Response with status code 204 2020-12-06T00:05:33.1667686Z Response with status code 204 2020-12-06T00:05:33.1683152Z ##[ValidatePublishedContent] 2020-12-06T00:05:33.1873948Z Post job cleanup. 2020-12-06T00:05:33.2977258Z [command]/usr/bin/git version 2020-12-06T00:05:33.3045521Z git version 2.29.2 2020-12-06T00:05:33.3089172Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand 2020-12-06T00:05:33.3133776Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || : 2020-12-06T00:05:33.3415339Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader 2020-12-06T00:05:33.3454712Z http.https://github.com/.extraheader 2020-12-06T00:05:33.3464375Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader 2020-12-06T00:05:33.3511821Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || : 2020-12-06T00:05:33.3833341Z Cleaning up orphan processes

FYI: Comparison to other deployment ways

  1. publish by func command w/ --build remote
    -> permissions is preserved
    image

  2. publish by func
    -> permissions is not preserved
    image
    But it can be changed to executable.
    After invoking /api/makechromexecutable in above my repo, the binary becames executable.
    image

Failed to fetch Kudu App Settings. Internal Server Error (CODE: 500)

Type: Bug

Enter Task Name: Azure/functions-action@v1

Environment

  • Server - Github actions

Issue Description

My app was working for months and I recently tried to update it and got this error.

I have searched the 'net high and low and have found similar errors, but nothing that matches this. None of the suggestions in those Issues/SO posts have helped. Examples:

https://stackoverflow.com/questions/64873031/azure-functions-deploy-from-github-actions-results-in-error-failed-to-fetch-ku

https://docs.microsoft.com/en-us/answers/questions/137869/publish-profile-publishurl-needs-to-be-adjusted-af.html

Here's my Action log:

Run Azure/functions-action@v1
  with:
    app-name: porscheoptioncodes
    slot-name: production
    package: Api/output
    publish-profile: ***
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_FUNCTIONAPP_PACKAGE_PATH: Api
    DOTNET_VERSION: 3.1.301
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings from https://<scmsite>/api/settings with publish-profile
Error:     Failed to fetch Kudu App Settings.
Internal Server Error (CODE: 500)
Error:       Error: Failed to fetch Kudu App Settings.
Internal Server Error (CODE: 500)
    at Kudu.<anonymous> (D:\a\_actions\Azure\functions-action\v1\node_modules\azure-actions-appservice-rest\Kudu\azure-app-kudu-service.js:62:23)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\Azure\functions-action\v1\node_modules\azure-actions-appservice-rest\Kudu\azure-app-kudu-service.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Deployment Failed!

My yaml:

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: 'porscheoptioncodes'
        slot-name: 'production'
        package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
        publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_xxx}}

My PublishSettings file which is stored in:

<publishData>
    <publishProfile profileName="PorscheOptionCodes - Web Deploy" 
       publishMethod="MSDeploy" 
       publishUrl="porscheoptioncodes.scm.azurewebsites.net:443" 
       msdeploySite="PorscheOptionCodes" 
       userName="$PorscheOptionCodes" 
       userPWD="<pwd>" 
       destinationAppUrl="http://porscheoptioncodes.azurewebsites.net" 
       SQLServerDBConnectionString="" 
       mySQLDBConnectionString="" 
       hostingProviderForumLink="" 
       controlPanelLink="http://windows.azure.com" 
       webSystem="WebSites">
       <databases />
    </publishProfile>
...
</publishData>

I went to the Azure Portal/Deployment Center and did Disconnect and reconnected, having it re-generate the workflow file.

image

After doing this, I found I had to change 'AZURE_FUNCTIONAPP_PACKAGE_PATHfrom.toApi` (because that's what my client for this function expects).

So now my .yml is:

# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy dotnet core app to Azure Function App - PorscheOptionCodes

on:
  push:
    branches:
      - master
  workflow_dispatch:

env:
  AZURE_FUNCTIONAPP_PACKAGE_PATH: 'Api' # set this to the path to your web app project, defaults to the repository root
  DOTNET_VERSION: '3.1.301'  # set this to the dotnet version to use

jobs:
  build-and-deploy:
    runs-on: windows-latest
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@v2

    - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ env.DOTNET_VERSION }}

    - name: 'Resolve Project Dependencies Using Dotnet'
      shell: pwsh
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        dotnet build --configuration Release --output ./output
        popd

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: 'PorscheOptionCodes'
        slot-name: 'production'
        package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
        publish-profile: ${{ secrets.AzureAppService_PublishProfile_xyz }}
  

The same error occurs.

I'm at my wits end. As I note this was working for months (last working commit was last September). Something changed between then on the Azure side that broke this, I believe.

Happy to be proven wrong, but I don't know how to dive deeper to figure it out.

Action outage?

At some point between 15:42 and 16:05 UTC, all attempts to run this action began throwing an error immediately on invocation:

Error: File not found: '/home/runner/work/_actions/Azure/functions-action/v1/lib/main.js'

SCM_DO_BUILD_DURING_DEPLOYMENT is set to False leading new packages define in requirement.txt are not getting loaded

Hi Team,

We found that if we are doing Kudo zip deployment and want to upload new module then we need to set both SCM_DO_BUILD_DURING_DEPLOYMENT and ENABLE_ORYX_BUILD are set to true.

https://docs.microsoft.com/en-us/azure/azure-functions/recover-python-functions?tabs=manual#mitigate-modulenotfounderror

Now, when we do deployments via Github actions it sets both the variables to false automatically and there is no way we can change this behavior.

Logs:
Run Azure/functions-action@v1
with:
app-name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
package: .
publish-profile: ***
respect-pom-xml: false
respect-funcignore: false
env:
AZURE_FUNCTIONAPP_NAME: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AZURE_FUNCTIONAPP_PACKAGE_PATH: .
PYTHON_VERSION: 3.6
pythonLocation: /opt/hostedtoolcache/Python/3.6.12/x64
Successfully passed SCM crednetial from new publishProfile
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (SCM)!
Will archive . into /home/runner/work/_temp/temp_web_package_48933186187879785.zip as function app content
Will use api/zipdeploy to deploy (scm credential)
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.

ZipDeploy doesn't seem to work

I'm experiencing a problem after upgrading from Dynamic Y1 to Premium P1v2 tier. Deployment seems to finish successfully but I can't see a function being deployed (listed in a Functions tab).

This is my setup - I'm using RBAC (also tested with SCM, but no difference)

- name: Deploy to Azure Function
  uses: Azure/functions-action@v1
  with:
    app-name: my-amazing-app

Output

Run Azure/functions-action@v1
##[Initialize]
##[ValidateParameter]
##[ValidateAzureResource]
Using RBAC for authentication, GitHub Action will perform resource validation.
Sucessfully acquired site configs from function app!
Detected function app sku: Dedicated
Sucessfully acquired app settings from function app (RBAC)!
Detected function app language: Node
##[PreparePublishContent]
Will archive . into /home/runner/work/_temp/temp_web_package_6074844557873911.zip as function app content
Will use api/zipdeploy to deploy (rbac authentication)
##[PublishContent]
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://xxxxxxxx.scm.azurewebsites.net/api/deployments/a3e60b2a32c74a95b53cce61ec99a591/log
Successfully deployed web package to App Service.
Successfully updated deployment History at https://xxxxxxxx.scm.azurewebsites.net/api/deployments/e963aa28e1ed240701f5ffa1b3df88388d2ec5191591886369847
##[ValidatePublishedContent]

private derivePublishMethod(

I see the action is using WEBSITE_RUN_FROM_PACKAGE publisher for Linux consumption plans and ZipDeploy for others.

With Y1 and WEBSITE_RUN_FROM_PACKAGE, everything worked fine but now I'm unable to deploy my function with ZipDeploy.

Am I perhaps missing something?

Failed to check app setting propagation for SCM_DO_BUILD_DURING_DEPLOYMENT and ENABLE_ORYX_BUILD.

First observed yesterday, our deployment action is having some issues. We're using node.js, our action is based on this template.

After Client.updateAppSettingViaKudu is called and returns 204, we get stuck in a timeout / retry cycle for about 3 minutes. See Github job log below.

Run Azure/functions-action@v1
  with:
    app-name: REDACTED
    package: .
    publish-profile: ***
    slot-name: REDACTED
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_FUNCTIONAPP_NAME: REDACTED
    AZURE_FUNCTIONAPP_PACKAGE_PATH: .
    NODE_VERSION: 10.x
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (with SCM credential)!
Will archive . into /home/runner/work/_temp/temp_web_package_47007169786336567.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
Warning: Failed to check app setting propagation for SCM_DO_BUILD_DURING_DEPLOYMENT, remaining retry 19
App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 19
Warning: Failed to check app setting propagation for SCM_DO_BUILD_DURING_DEPLOYMENT, remaining retry 18
...truncated...
Warning: Failed to check app setting propagation for SCM_DO_BUILD_DURING_DEPLOYMENT, remaining retry 1
App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 1
Warning: Failed to check app setting propagation for SCM_DO_BUILD_DURING_DEPLOYMENT, remaining retry 0
App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 0
Warning: App setting SCM_DO_BUILD_DURING_DEPLOYMENT fails to propagate to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
Warning: Failed to check app setting propagation for ENABLE_ORYX_BUILD, remaining retry 19
App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 19
Warning: Failed to check app setting propagation for ENABLE_ORYX_BUILD, remaining retry 18
App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 18
...truncated...
Warning: Failed to check app setting propagation for ENABLE_ORYX_BUILD, remaining retry 1
App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 1
Warning: Failed to check app setting propagation for ENABLE_ORYX_BUILD, remaining retry 0
App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 0
Warning: App setting ENABLE_ORYX_BUILD fails to propagate to Kudu container
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at REDACTED
Successfully deployed web package to App Service.
Successfully updated deployment History at REDACTED
Response with status code 204
Response with status code 204
Response with status code 204

Here's some additional information.

  • The deploy itself seems to go as expected. But the retry cycle is significantly slowing down our releases.
  • We've observed this happening on both production & staging deploy slots.
  • We've observed this with both Windows & Linux Function Apps.
  • No similar issues are observed when deploying to the function app via VS Code (running in a dev docker container).
  • No changes were made to our workflow files since the last time it was working properly.

Here's a few things I've tried, to no effect.

  • Explicitly setting the scm-do-build-during-deployment and enable-oryx-build in the workfile (both true & false).
  • Knew it was probably unrelated, but tried tweaking the NODE_VERSION from 12.x to 10.x

I'd be happy to provide more information on request. Thanks for your help!

Support for functions that utilise identity auth to storage

As documented at https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference#connecting-to-host-storage-with-an-identity we can now use the settings AzureWebJobsStorage__accountName or AzureWebJobsStorage__serviceUri and the function managed identity to connect to storage (this is instead of AzureWebJobsStorage connection string)

There are a few warnings/assumptions in the codebase that this AzureWebJobsStorage property must exist when utilising this action.

It may also be the cause of an error I'm facing when deploying (relevant log section here)

Detected function app language: DotnetIsolated
Will directly deploy functions.zip as function app content.
Will use WEBSITE_RUN_FROM_PACKAGE to deploy since RBAC is detected and your function app is on Linux Consumption.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   At PublishContent, AzureWebjobsStorage : Failed to convert by semicolon delimeter.
Error:     Cannot read property 'trim' of undefined
Error:       TypeError: Cannot read property 'trim' of undefined

Include AppSettings

Hi,

how do I include any Github secrets (configurations for the function) that I would like to make use of in the Function?

publish-profile : should be a valid XML.

steps to reproduct:
add key value pair to Vault,
retrieve value with key in Github workflow,
run function:

  • name: "Run Azure Functions Action"
    uses: Azure/functions-action@v1
    id: fa
    with:
    app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
    package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
    publish-profile: ${{ steps.secrets.outputs.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

Error: Execution Exception (state: ValidateParameter) (step: Invocation)
Error: At ValidateParameter, publish-profile : should be a valid XML.
Error: Deployment Failed!

Releases 1.1.7 and 1.1.8 are not backwards compatible with 1.1.6

Based on the changes introduced in v1.1.7, my release to Azure job is getting the following error:

##[Initialize]
##[ValidateParameter]
Error: Execution Exception (state: ValidateParameter) (step: Invocation)
Error:   Cannot read property 'indexOf' of undefined
Error:     TypeError: Cannot read property 'indexOf' of undefined
    at ParameterValidator.validateScmCredentialsSlotName (D:\a\_actions\Azure\functions-action\v1.1.7\lib\handlers\parameterValidator.js:158:42)
    at ParameterValidator.<anonymous> (D:\a\_actions\Azure\functions-action\v1.1.7\lib\handlers\parameterValidator.js:56:18)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\Azure\functions-action\v1.1.7\lib\handlers\parameterValidator.js:24:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Deployment Failed!

My job is running on windows-latest and is currently working now that I've specifically pinned v1.1.6 as the version of this action to run.
My job is using a publish profile as the Deployment Credential, the publish profile was generated in July and has the following format (the names and passwords have been changed):

<publishData>
  <publishProfile profileName="my-api - Web Deploy" publishMethod="MSDeploy" publishUrl="my-api.scm.azurewebsites.net:443" msdeploySite="my-api" userName="$my-api" userPWD="***" destinationAppUrl="http://my-api.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
    <databases/>
  </publishProfile>
  <publishProfile profileName="my-api - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod-blu-095.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="my-api\$my-api" userPWD="***" destinationAppUrl="http://my-api.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
    <databases/>
  </publishProfile>
  <publishProfile profileName="my-api - ReadOnly - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod-blu-095dr.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="my-api\$my-api" userPWD="***" destinationAppUrl="http://my-api.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
    <databases/>
  </publishProfile>
</publishData>

Http Status 503 when deploying function app

When I try to deploy a function app I does not work properly. I encounter a 503 Status which will be retried for a very log time:

2019-12-11T08:23:38.1476676Z /d/a/jobreporter/jobreporter
2019-12-11T08:23:38.1736984Z ##[group]Run Azure/functions-action@v1
2019-12-11T08:23:38.1737167Z with:
2019-12-11T08:23:38.1737283Z   app-name: jobreporter-dev
2019-12-11T08:23:38.1737547Z   slot-name: staging
2019-12-11T08:23:38.1737652Z   package: ./dist
2019-12-11T08:23:38.1739072Z   publish-profile: ***
2019-12-11T08:23:38.1739194Z ##[endgroup]
2019-12-11T08:23:38.6519038Z ##[Initialize]
2019-12-11T08:23:38.7084531Z ##[ValidateParameter]
2019-12-11T08:23:38.7090779Z Finding files matching input: ./dist
2019-12-11T08:23:38.7091111Z ##[ValidateAzureResource]
2019-12-11T08:23:38.7095291Z Using SCM credential for authentication, GitHub Action will not perform resource validation.
2019-12-11T08:23:38.7096935Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:23:39.8100532Z Sucessfully acquired app settings from function app (SCM)!
2019-12-11T08:23:39.8138061Z ##[PreparePublishContent]
2019-12-11T08:23:39.8248726Z This is folder package 
2019-12-11T08:23:39.8249813Z Will archive ./dist into d:\a\_temp\temp_web_package_7695150422348975.zip as function app content
2019-12-11T08:23:39.8250727Z Archiving ./dist to d:\a\_temp\temp_web_package_7695150422348975.zip
2019-12-11T08:23:47.4235862Z Successfully created archive d:\a\_temp\temp_web_package_7695150422348975.zip
2019-12-11T08:23:47.4251341Z Will use api/zipdeploy to deploy (scm credential)
2019-12-11T08:23:47.4268170Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:23:48.0940558Z ##[PublishContent]
2019-12-11T08:23:48.0951576Z Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
2019-12-11T08:23:48.0952566Z Update using Client.updateAppSettingViaKudu
2019-12-11T08:23:48.0959278Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:23:49.0023080Z Response with status code 204
2019-12-11T08:23:54.0056713Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:23:55.2901895Z App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
2019-12-11T08:23:55.2902316Z Setting ENABLE_ORYX_BUILD in Kudu container to false
2019-12-11T08:23:55.2902721Z Update using Client.updateAppSettingViaKudu
2019-12-11T08:23:55.2904318Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:23:56.0990328Z Response with status code 204
2019-12-11T08:24:01.1078446Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-11T08:24:02.7097354Z App setting ENABLE_ORYX_BUILD propagated to Kudu container
2019-12-11T08:24:02.7098709Z Waiting for function app to spin up after app settings change.
2019-12-11T08:24:07.7115489Z [GET]http://jobreporter-dev.azurewebsites.net
2019-12-11T08:24:50.2085079Z Could not parse response: {}
2019-12-11T08:24:50.2087040Z Response: undefined
2019-12-11T08:24:50.2093970Z Encountered a retriable status code: 503. Message: 'Service Unavailable'.
2019-12-11T08:24:55.2201075Z [GET]http://jobreporter-dev.azurewebsites.net
2019-12-11T08:24:55.7204766Z Could not parse response: {}
2019-12-11T08:24:55.7207056Z Response: undefined
2019-12-11T08:24:55.7207503Z Encountered a retriable status code: 503. Message: 'Service Unavailable'.
2019-12-11T08:25:25.7264769Z [GET]http://jobreporter-dev.azurewebsites.net
2019-12-11T08:25:25.9490397Z Could not parse response: {}
2019-12-11T08:25:25.9492096Z Response: undefined
2019-12-11T08:25:25.9492738Z Encountered a retriable status code: 503. Message: 'Service Unavailable'.
2019-12-11T08:28:00.9522596Z [GET]http://jobreporter-dev.azurewebsites.net
2019-12-11T08:28:01.2803169Z Could not parse response: {}
2019-12-11T08:28:01.2803813Z Response: undefined
2019-12-11T08:28:01.2805049Z Encountered a retriable status code: 503. Message: 'Service Unavailable'.
2019-12-11T08:33:11.8229678Z ##[error]The operation was canceled.
2019-12-11T08:33:11.8272504Z Cleaning up orphan processes

when I stop the function app and the retrigger the github workflow the app gets deployed perfectly:


2019-12-12T07:21:19.9536094Z ##[group]Run Azure/[email protected]
2019-12-12T07:21:19.9536318Z with:
2019-12-12T07:21:19.9536446Z   app-name: jobreporter-dev
2019-12-12T07:21:19.9536569Z   slot-name: staging
2019-12-12T07:21:19.9536689Z   package: ./dist
2019-12-12T07:21:19.9537805Z   publish-profile: ***
2019-12-12T07:21:19.9537936Z ##[endgroup]
2019-12-12T07:21:20.5021745Z ##[Initialize]
2019-12-12T07:21:20.5119116Z ##[ValidateParameter]
2019-12-12T07:21:20.5131941Z Finding files matching input: ./dist
2019-12-12T07:21:20.5134233Z ##[ValidateAzureResource]
2019-12-12T07:21:20.5141610Z Using SCM credential for authentication, GitHub Action will not perform resource validation.
2019-12-12T07:21:20.5158336Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:21.4781663Z Sucessfully acquired app settings from function app (SCM)!
2019-12-12T07:21:21.4782596Z ##[PreparePublishContent]
2019-12-12T07:21:21.4944138Z This is folder package 
2019-12-12T07:21:21.4945458Z Will archive ./dist into d:\a\_temp\temp_web_package_3297521192034041.zip as function app content
2019-12-12T07:21:21.4947176Z Archiving ./dist to d:\a\_temp\temp_web_package_3297521192034041.zip
2019-12-12T07:21:29.7378151Z Successfully created archive d:\a\_temp\temp_web_package_3297521192034041.zip
2019-12-12T07:21:29.7388353Z Will use api/zipdeploy to deploy (scm credential)
2019-12-12T07:21:29.7401129Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:30.3968706Z ##[PublishContent]
2019-12-12T07:21:30.3980246Z Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
2019-12-12T07:21:30.3981977Z Update using Client.updateAppSettingViaKudu
2019-12-12T07:21:30.3988574Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:31.2416493Z Response with status code 204
2019-12-12T07:21:36.2433449Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:37.0166920Z App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
2019-12-12T07:21:37.0167454Z Setting ENABLE_ORYX_BUILD in Kudu container to false
2019-12-12T07:21:37.0167886Z Update using Client.updateAppSettingViaKudu
2019-12-12T07:21:37.0169562Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:37.6964260Z Response with status code 204
2019-12-12T07:21:42.9642073Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:21:43.2069025Z App setting ENABLE_ORYX_BUILD propagated to Kudu container
2019-12-12T07:21:43.2069702Z Waiting for function app to spin up after app settings change.
2019-12-12T07:21:48.2209700Z [GET]http://jobreporter-dev.azurewebsites.net
2019-12-12T07:21:48.4332097Z Could not parse response: {}
2019-12-12T07:21:48.4332992Z Response: undefined
2019-12-12T07:21:48.4334183Z Package deployment using ZIP Deploy initiated.
2019-12-12T07:21:48.4344847Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/zipdeploy?isAsync=true&deployer=GITHUB_ZIP_DEPLOY
2019-12-12T07:21:52.7600389Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:13.3857118Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:26.4042185Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:33.9184615Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:40.5830000Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:47.1492445Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:53.6213123Z [GET]https://jobreporter-dev.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY&time=2019-12-12_07-21-52Z
2019-12-12T07:22:55.1628692Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/deployments/87d2c4ce62994c0f8c2de7d16b7fa17f
2019-12-12T07:22:55.9502758Z Deploy logs can be viewed at https://jobreporter-dev.scm.azurewebsites.net/api/deployments/87d2c4ce62994c0f8c2de7d16b7fa17f/log
2019-12-12T07:22:55.9503420Z Successfully deployed web package to App Service.
2019-12-12T07:22:55.9512757Z [GET]***jobreporter-dev.scm.azurewebsites.net/api/vfs/site/deployments/87d2c4ce62994c0f8c2de7d16b7fa17f/manifest
2019-12-12T07:22:56.8565047Z Could not parse response: {}
2019-12-12T07:22:56.8566163Z Response: undefined
2019-12-12T07:22:56.8602105Z [PUT]***jobreporter-dev.scm.azurewebsites.net/api/vfs/site/deployments/87d2c4ce62994c0f8c2de7d16b7fa17f/manifest
2019-12-12T07:22:57.8399271Z [PUT]***jobreporter-dev.scm.azurewebsites.net/api/deployments/87266d56249c9ef341009c0e3f622457ae9af7db1576135377830
2019-12-12T07:22:58.9179120Z Successfully updated deployment History at https://jobreporter-dev.scm.azurewebsites.net/api/deployments/87266d56249c9ef341009c0e3f622457ae9af7db1576135377830
2019-12-12T07:22:58.9182502Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:22:59.4786322Z Response with status code 204
2019-12-12T07:22:59.4788438Z [POST]***jobreporter-dev.scm.azurewebsites.net/api/settings
2019-12-12T07:23:00.0953664Z Response with status code 204
2019-12-12T07:23:00.0960620Z [DELETE]***jobreporter-dev.scm.azurewebsites.net/api/settings/WEBSITE_RUN_FROM_PACKAGE
2019-12-12T07:23:00.6883853Z Response with status code 204
2019-12-12T07:23:00.6885279Z ##[ValidatePublishedContent]

Therefore it is not really clear to me what is happening and why I only can deploy when the function app is stopped.
Github Workflow is:

name: Azure_Deployment_Development

on:
  push:
    branches:
    - develop

jobs:
  build-and-deploy:
    runs-on: windows-latest
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Node 10.x
      uses: actions/setup-node@v1
      with:
        node-version: '10.x'

    - name: 'Run npm build and prepare deploy'
      shell: bash
      run: |
        pushd .
        npm ci
        npm run build --if-present
        npm run deploy:prepare
        popd

    - name: 'Deploy to Azure Function App'
      uses: Azure/[email protected]
      id: fa
      with:
        app-name: jobreporter-dev
        slot-name: staging
        # If your function app project is not located in your repository's root
        # Please consider prefixing the project path in this package parameter
        package: './dist'
        # If you want to use publish profile credentials instead of Azure Service Principal
        # Please uncomment the following line
        publish-profile: ${{ secrets.SCM_CREDENTIALS_DEV }}

Add documentation for .NET Isolated

  1. Add a new template for .NET Isolated deployment.
  • Same template as dotnet works for isolated too.
  1. Document the languages and language versions that we support in readme.md.
  • Added links in the readme.md.
  1. Add E2E test pipeline for .NET Isolated.

Azure Function app not removing old files after deployment using zipdeploy

I am trying to publish my functions into azure function app but my old functions are not getting removed after deployment. My new deployment package does not contain the old functions but they are still present in wwwroot kudu directory. I am using Azure RM module and Zipdeploy to publish my package.

Add support for custom handlers in Linux consumption plans

When I am attempting to deploy using this Action the deployment always fails. The same build can be deployed with the func azure functionapp publish command without any issue.

There are two different errors based on whether the WEBSITE_RUN_FROM_PACKAGE configuration option is set or not. We are using a Linux consumption plan, so when set it points to a blob storage containing the latest deployment zip. Obviously this option will be set after the first deployment so it should work in both cases.

Log when WEBSITE_RUN_FROM_PACKAGE is set
Run Azure/functions-action@v1
  with:
    app-name: func-REDACTED-staging-01
    package: ./build
    publish-profile: ***
    respect-funcignore: true
    respect-pom-xml: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (with SCM credential)!
Warning: The .funcignore file does not exist in your path ./build. Nothing will be changed.
Warning: The .funcignore file shares the same format as .gitignore. You can use it to exclude files from deployment.
Will archive ./build into /home/runner/work/_temp/temp_web_package_8964073453852144.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Error: Failed to deploy web package to App Service.
Successfully updated deployment History at func-REDACTED-staging-01.scm.azurewebsites.net/api/deployments/b5026f1058de8a11fedc3d0ef30729628f1c08011621435576470
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_8964073453852144.zip as ZipDeploy content
Error:     Failed to deploy web package to App Service.
Not Found (CODE: 404)
Error:       Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:175:23)
    at Generator.throw (<anonymous>)
    at rejected (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:6:65)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Deployment Failed!
Log when WEBSITE_RUN_FROM_PACKAGE is NOT set
Run Azure/functions-action@v1
  with:
    app-name: func-REDACTED-staging-01
    package: ./build
    publish-profile: ***
    respect-funcignore: true
    respect-pom-xml: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (with SCM credential)!
Warning: The .funcignore file does not exist in your path ./build. Nothing will be changed.
Warning: The .funcignore file shares the same format as .gitignore. You can use it to exclude files from deployment.
Will archive ./build into /home/runner/work/_temp/temp_web_package_7836364297632616.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, zipDepoy : WEBSITE_RUN_FROM_PACKAGE in your function app is set to an URL. Please remove WEBSITE_RUN_FROM_PACKAGE app setting from your function app.
Error: Deployment Failed!

The relevant settings from the workflow file:

      - name: Deploy
        uses: Azure/functions-action@v1
        with:
          app-name: func-REDACTED-staging-01
          package: ./build
          publish-profile: ${{ secrets.STAGING_PUBLISH_PROFILE }}
          respect-funcignore: true

The structure of my build folder:

func1-v1/
  - function.json
  - handler.js
func2-v1/
  - function.json
  - handler.js
shared/
node_modules/
  - <all required prod dependencies preinstalled before calling deployment>
host.json
local.settings.json
package.json
package-lock.json

What next steps can we take to solve this issue?

Azure Function actions are running longer than usual

Hello,
I've noticed that the step "Run Azure function action" is taking more time than usual.

image

Since I use GitHub actions with Azure Functions it usually took 5 minutes or less to run the action, it's a couple of week that it's running very slow sometimes, do you know if anything changed?

image

My functions are small and I'm pushing usually small changes to the function.

Thank you for your help.

'Cannot read property 'toLowerCase' of undefined' during slot deployment

I am trying to deploy to a slot using the action. I am not using a publishing profile to deploy, but instead a service principal. Looking through the 'ParameterValidator.validateScmCredentialsSlotName' it looks like to do a slotted deployment you are requiring a profile? I am passing in a valid slot name that exists, so I am not sure why I would get this error. Help is appreciated.

How to preserve file permissions in zip package

When deploying zip package to Linux function app on consumption plan using this action, the deployment was succeeded but executable permission for each file is lost.
Could you please let me know how to preserve the permissions after the deployment?

I'm trying to deploy the package including puppeteer to Linux consumption function app from this repository and it needs executable permission for the binary file chrome.

According to the action's log, the binary chrome was executable before archiving.

2020-12-06T00:03:32.7725518Z -rwxr-xr-x 1 runner docker 268577208 Dec 6 00:03 ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome

After the deployment, the permission is lost and it cannot become executable.
# this can be checked by /api/showchromepermission in the above my repo
image

The permission lost causes failure to launch chrome

The action and full log are followings.

yaml for GitHub Action
name: Deploy Node.js project to Azure Function App

on:
  [push]

env:
  AZURE_FUNCTIONAPP_NAME: puppeteerga      # set this to your application's name
  AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'      # set this to the path to your web app project, defaults to the repository root
  NODE_VERSION: '12.x'                     # set this to the node version to use (supports 8.x, 10.x, 12.x)

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Node ${{ env.NODE_VERSION }} Environment
      uses: actions/setup-node@v1
      with:
        node-version: ${{ env.NODE_VERSION }}

    - name: 'Resolve Project Dependencies Using Npm'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        npm install
        npm run build --if-present
        npm run test --if-present
        ls -al ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome
        popd
    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
Full GitHub Action's log

2020-12-06T00:03:09.7677286Z ##[section]Starting: Request a runner to run this job 2020-12-06T00:03:09.9550839Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:09.9550941Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:09.9551324Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest' 2020-12-06T00:03:10.1008331Z ##[section]Finishing: Request a runner to run this job 2020-12-06T00:03:17.6831500Z Current runner version: '2.274.2' 2020-12-06T00:03:17.6867533Z ##[group]Operating System 2020-12-06T00:03:17.6868680Z Ubuntu 2020-12-06T00:03:17.6869163Z 18.04.5 2020-12-06T00:03:17.6869678Z LTS 2020-12-06T00:03:17.6870182Z ##[endgroup] 2020-12-06T00:03:17.6870837Z ##[group]Virtual Environment 2020-12-06T00:03:17.6871566Z Environment: ubuntu-18.04 2020-12-06T00:03:17.6872224Z Version: 20201129.1 2020-12-06T00:03:17.6873559Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201129.1/images/linux/Ubuntu1804-README.md 2020-12-06T00:03:17.6874546Z ##[endgroup] 2020-12-06T00:03:17.6877960Z Prepare workflow directory 2020-12-06T00:03:17.7720424Z Prepare all required actions 2020-12-06T00:03:17.7732627Z Getting action download info 2020-12-06T00:03:17.9846961Z Download action repository 'actions/checkout@master' 2020-12-06T00:03:20.0390907Z Download action repository 'actions/setup-node@v1' 2020-12-06T00:03:20.2143423Z Download action repository 'Azure/functions-action@v1' 2020-12-06T00:03:22.5790613Z ##[group]Run actions/checkout@master 2020-12-06T00:03:22.5791307Z with: 2020-12-06T00:03:22.5791971Z repository: horihiro/puppeteer-permission-cicd 2020-12-06T00:03:22.5793289Z token: *** 2020-12-06T00:03:22.5793803Z ssh-strict: true 2020-12-06T00:03:22.5794320Z persist-credentials: true 2020-12-06T00:03:22.5794813Z clean: true 2020-12-06T00:03:22.5795198Z fetch-depth: 1 2020-12-06T00:03:22.5795593Z lfs: false 2020-12-06T00:03:22.5795973Z submodules: false 2020-12-06T00:03:22.5796359Z env: 2020-12-06T00:03:22.5796826Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:22.5797422Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:22.5797886Z NODE_VERSION: 12.x 2020-12-06T00:03:22.5798283Z ##[endgroup] 2020-12-06T00:03:23.5414567Z Syncing repository: horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5415630Z ##[group]Getting Git version info 2020-12-06T00:03:23.5417070Z Working directory is '/home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd' 2020-12-06T00:03:23.5420670Z [command]/usr/bin/git version 2020-12-06T00:03:23.5427850Z git version 2.29.2 2020-12-06T00:03:23.5437988Z ##[endgroup] 2020-12-06T00:03:23.5439780Z Deleting the contents of '/home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd' 2020-12-06T00:03:23.5442079Z ##[group]Initializing the repository 2020-12-06T00:03:23.5443694Z [command]/usr/bin/git init /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:23.5449421Z Initialized empty Git repository in /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/.git/ 2020-12-06T00:03:23.5452485Z [command]/usr/bin/git remote add origin https://github.com/horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5453906Z ##[endgroup] 2020-12-06T00:03:23.5454458Z ##[group]Disabling automatic garbage collection 2020-12-06T00:03:23.5455288Z [command]/usr/bin/git config --local gc.auto 0 2020-12-06T00:03:23.5455781Z ##[endgroup] 2020-12-06T00:03:23.5457312Z ##[group]Setting up auth 2020-12-06T00:03:23.5458205Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand 2020-12-06T00:03:23.5459694Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || : 2020-12-06T00:03:23.5461344Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader 2020-12-06T00:03:23.5463655Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || : 2020-12-06T00:03:23.5465712Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic *** 2020-12-06T00:03:23.5466607Z ##[endgroup] 2020-12-06T00:03:23.5467126Z ##[group]Fetching the repository 2020-12-06T00:03:23.5468827Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +eb18d606763ef6417647df90d95b8f77da64ac9a:refs/remotes/origin/master 2020-12-06T00:03:23.5470445Z remote: Enumerating objects: 27, done. 2020-12-06T00:03:23.5471046Z remote: Counting objects: 3% (1/27) 2020-12-06T00:03:23.5471615Z remote: Counting objects: 7% (2/27) 2020-12-06T00:03:23.5472167Z remote: Counting objects: 11% (3/27) 2020-12-06T00:03:23.5472738Z remote: Counting objects: 14% (4/27) 2020-12-06T00:03:23.5473292Z remote: Counting objects: 18% (5/27) 2020-12-06T00:03:23.5473859Z remote: Counting objects: 22% (6/27) 2020-12-06T00:03:23.5474411Z remote: Counting objects: 25% (7/27) 2020-12-06T00:03:23.5474977Z remote: Counting objects: 29% (8/27) 2020-12-06T00:03:23.5475690Z remote: Counting objects: 33% (9/27) 2020-12-06T00:03:23.5476242Z remote: Counting objects: 37% (10/27) 2020-12-06T00:03:23.5476906Z remote: Counting objects: 40% (11/27) 2020-12-06T00:03:23.5477472Z remote: Counting objects: 44% (12/27) 2020-12-06T00:03:23.5478034Z remote: Counting objects: 48% (13/27) 2020-12-06T00:03:23.5478607Z remote: Counting objects: 51% (14/27) 2020-12-06T00:03:23.5479154Z remote: Counting objects: 55% (15/27) 2020-12-06T00:03:23.5479717Z remote: Counting objects: 59% (16/27) 2020-12-06T00:03:23.5480267Z remote: Counting objects: 62% (17/27) 2020-12-06T00:03:23.5480831Z remote: Counting objects: 66% (18/27) 2020-12-06T00:03:23.5481381Z remote: Counting objects: 70% (19/27) 2020-12-06T00:03:23.5481941Z remote: Counting objects: 74% (20/27) 2020-12-06T00:03:23.5482491Z remote: Counting objects: 77% (21/27) 2020-12-06T00:03:23.5483224Z remote: Counting objects: 81% (22/27) 2020-12-06T00:03:23.5483780Z remote: Counting objects: 85% (23/27) 2020-12-06T00:03:23.5484350Z remote: Counting objects: 88% (24/27) 2020-12-06T00:03:23.5485001Z remote: Counting objects: 92% (25/27) 2020-12-06T00:03:23.5485517Z remote: Counting objects: 96% (26/27) 2020-12-06T00:03:23.5486230Z remote: Counting objects: 100% (27/27) 2020-12-06T00:03:23.5486907Z remote: Counting objects: 100% (27/27), done. 2020-12-06T00:03:23.5487487Z remote: Compressing objects: 4% (1/22) 2020-12-06T00:03:23.5488047Z remote: Compressing objects: 9% (2/22) 2020-12-06T00:03:23.5488619Z remote: Compressing objects: 13% (3/22) 2020-12-06T00:03:23.5489175Z remote: Compressing objects: 18% (4/22) 2020-12-06T00:03:23.5489754Z remote: Compressing objects: 22% (5/22) 2020-12-06T00:03:23.5490329Z remote: Compressing objects: 27% (6/22) 2020-12-06T00:03:23.5490889Z remote: Compressing objects: 31% (7/22) 2020-12-06T00:03:23.5491457Z remote: Compressing objects: 36% (8/22) 2020-12-06T00:03:23.5492014Z remote: Compressing objects: 40% (9/22) 2020-12-06T00:03:23.5492590Z remote: Compressing objects: 45% (10/22) 2020-12-06T00:03:23.5493157Z remote: Compressing objects: 50% (11/22) 2020-12-06T00:03:23.5493737Z remote: Compressing objects: 54% (12/22) 2020-12-06T00:03:23.5494297Z remote: Compressing objects: 59% (13/22) 2020-12-06T00:03:23.5494872Z remote: Compressing objects: 63% (14/22) 2020-12-06T00:03:23.5495447Z remote: Compressing objects: 68% (15/22) 2020-12-06T00:03:23.5496008Z remote: Compressing objects: 72% (16/22) 2020-12-06T00:03:23.5496582Z remote: Compressing objects: 77% (17/22) 2020-12-06T00:03:23.5497135Z remote: Compressing objects: 81% (18/22) 2020-12-06T00:03:23.5497707Z remote: Compressing objects: 86% (19/22) 2020-12-06T00:03:23.5498264Z remote: Compressing objects: 90% (20/22) 2020-12-06T00:03:23.5498837Z remote: Compressing objects: 95% (21/22) 2020-12-06T00:03:23.5499395Z remote: Compressing objects: 100% (22/22) 2020-12-06T00:03:23.5500026Z remote: Compressing objects: 100% (22/22), done. 2020-12-06T00:03:23.5501094Z remote: Total 27 (delta 2), reused 22 (delta 2), pack-reused 0 2020-12-06T00:03:23.5627784Z From https://github.com/horihiro/puppeteer-permission-cicd 2020-12-06T00:03:23.5629185Z * [new ref] eb18d606763ef6417647df90d95b8f77da64ac9a -> origin/master 2020-12-06T00:03:23.5704090Z ##[endgroup] 2020-12-06T00:03:23.5705721Z ##[group]Determining the checkout info 2020-12-06T00:03:23.5706296Z ##[endgroup] 2020-12-06T00:03:23.5706919Z ##[group]Checking out the ref 2020-12-06T00:03:23.5708291Z [command]/usr/bin/git checkout --progress --force -B master refs/remotes/origin/master 2020-12-06T00:03:23.5810259Z Reset branch 'master' 2020-12-06T00:03:23.5818337Z Branch 'master' set up to track remote branch 'master' from 'origin'. 2020-12-06T00:03:23.5829756Z ##[endgroup] 2020-12-06T00:03:23.5894113Z [command]/usr/bin/git log -1 --format='%H' 2020-12-06T00:03:23.5927565Z 'eb18d606763ef6417647df90d95b8f77da64ac9a' 2020-12-06T00:03:23.6119413Z ##[group]Run actions/setup-node@v1 2020-12-06T00:03:23.6119872Z with: 2020-12-06T00:03:23.6120266Z node-version: 12.x 2020-12-06T00:03:23.6120719Z always-auth: false 2020-12-06T00:03:23.6121096Z env: 2020-12-06T00:03:23.6121660Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:23.6122168Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:23.6123120Z NODE_VERSION: 12.x 2020-12-06T00:03:23.6123481Z ##[endgroup] 2020-12-06T00:03:23.7178836Z [command]/opt/hostedtoolcache/node/12.20.0/x64/bin/node --version 2020-12-06T00:03:23.8586454Z v12.20.0 2020-12-06T00:03:23.8606809Z [command]/opt/hostedtoolcache/node/12.20.0/x64/bin/npm --version 2020-12-06T00:03:24.4434245Z 6.14.8 2020-12-06T00:03:24.4587005Z ##[group]Run pushd './.' 2020-12-06T00:03:24.4587588Z �[36;1mpushd './.'�[0m 2020-12-06T00:03:24.4587993Z �[36;1mnpm install�[0m 2020-12-06T00:03:24.4588486Z �[36;1mnpm run build --if-present�[0m 2020-12-06T00:03:24.4589029Z �[36;1mnpm run test --if-present�[0m 2020-12-06T00:03:24.4589851Z �[36;1mls -al ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome�[0m 2020-12-06T00:03:24.4590647Z �[36;1mpopd�[0m 2020-12-06T00:03:24.4634831Z shell: /bin/bash --noprofile --norc -e -o pipefail {0} 2020-12-06T00:03:24.4635380Z env: 2020-12-06T00:03:24.4635904Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:24.4636531Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:24.4637045Z NODE_VERSION: 12.x 2020-12-06T00:03:24.4637460Z ##[endgroup] 2020-12-06T00:03:24.4721956Z ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:26.3530588Z 2020-12-06T00:03:26.3540247Z > [email protected] install /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/node_modules/puppeteer 2020-12-06T00:03:26.3562048Z > node install.js 2020-12-06T00:03:26.3575027Z 2020-12-06T00:03:27.3031708Z 2020-12-06T00:03:32.1249937Z Chromium (818858) downloaded to /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd/node_modules/puppeteer/.local-chromium/linux-818858 2020-12-06T00:03:32.2191270Z npm WARN [email protected] No description 2020-12-06T00:03:32.2264835Z npm WARN [email protected] No repository field. 2020-12-06T00:03:32.2336300Z npm WARN [email protected] No license field. 2020-12-06T00:03:32.2338077Z 2020-12-06T00:03:32.2376647Z added 54 packages from 75 contributors and audited 54 packages in 7.128s 2020-12-06T00:03:32.2848891Z 2020-12-06T00:03:32.2850642Z 8 packages are looking for funding 2020-12-06T00:03:32.2851668Z run `npm fund` for details 2020-12-06T00:03:32.2852358Z 2020-12-06T00:03:32.2866170Z found 0 vulnerabilities 2020-12-06T00:03:32.2866778Z 2020-12-06T00:03:32.7582878Z 2020-12-06T00:03:32.7585936Z > [email protected] test /home/runner/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:32.7587402Z > echo "No tests yet..." 2020-12-06T00:03:32.7587875Z 2020-12-06T00:03:32.7627240Z No tests yet... 2020-12-06T00:03:32.7725518Z -rwxr-xr-x 1 runner docker 268577208 Dec 6 00:03 ./node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome 2020-12-06T00:03:32.7727913Z ~/work/puppeteer-permission-cicd/puppeteer-permission-cicd 2020-12-06T00:03:32.7797223Z ##[group]Run Azure/functions-action@v1 2020-12-06T00:03:32.7797767Z with: 2020-12-06T00:03:32.7798319Z app-name: puppeteerga 2020-12-06T00:03:32.7798947Z package: . 2020-12-06T00:03:32.7812817Z publish-profile: *** 2020-12-06T00:03:32.7813236Z env: 2020-12-06T00:03:32.7813710Z AZURE_FUNCTIONAPP_NAME: puppeteerga 2020-12-06T00:03:32.7814295Z AZURE_FUNCTIONAPP_PACKAGE_PATH: . 2020-12-06T00:03:32.7814755Z NODE_VERSION: 12.x 2020-12-06T00:03:32.7815147Z ##[endgroup] 2020-12-06T00:03:33.0583209Z ##[Initialize] 2020-12-06T00:03:33.0586869Z ##[ValidateParameter] 2020-12-06T00:03:33.0755526Z Successfully passed SCM crednetial from new publishProfile 2020-12-06T00:03:33.0762441Z ##[ValidateAzureResource] 2020-12-06T00:03:33.0765405Z Using SCM credential for authentication, GitHub Action will not perform resource validation. 2020-12-06T00:03:34.0168472Z Sucessfully acquired app settings from function app (SCM)! 2020-12-06T00:03:34.0169735Z ##[PreparePublishContent] 2020-12-06T00:03:34.0172906Z Will archive . into /home/runner/work/_temp/temp_web_package_6067574154394939.zip as function app content 2020-12-06T00:03:46.0712750Z Will use api/zipdeploy to deploy (scm credential) 2020-12-06T00:03:47.0199292Z ##[PublishContent] 2020-12-06T00:03:47.0202226Z Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false 2020-12-06T00:03:47.0203563Z Update using Client.updateAppSettingViaKudu 2020-12-06T00:03:47.9001928Z Response with status code 204 2020-12-06T00:03:53.7477813Z App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container 2020-12-06T00:03:53.7479212Z Setting ENABLE_ORYX_BUILD in Kudu container to false 2020-12-06T00:03:53.7480613Z Update using Client.updateAppSettingViaKudu 2020-12-06T00:03:54.6186544Z Response with status code 204 2020-12-06T00:04:00.5242077Z App setting ENABLE_ORYX_BUILD propagated to Kudu container 2020-12-06T00:04:00.5243558Z Package deployment using ZIP Deploy initiated. 2020-12-06T00:05:28.8878013Z Deploy logs can be viewed at https://puppeteerga.scm.azurewebsites.net/api/deployments/be7da561f3974c39a19a7b4d071cdde0/log 2020-12-06T00:05:28.8882435Z Successfully deployed web package to App Service. 2020-12-06T00:05:30.5999946Z Successfully updated deployment History at https://puppeteerga.scm.azurewebsites.net/api/deployments/eb18d606763ef6417647df90d95b8f77da64ac9a1607213129742 2020-12-06T00:05:31.4270716Z Response with status code 204 2020-12-06T00:05:32.2973086Z Response with status code 204 2020-12-06T00:05:33.1667686Z Response with status code 204 2020-12-06T00:05:33.1683152Z ##[ValidatePublishedContent] 2020-12-06T00:05:33.1873948Z Post job cleanup. 2020-12-06T00:05:33.2977258Z [command]/usr/bin/git version 2020-12-06T00:05:33.3045521Z git version 2.29.2 2020-12-06T00:05:33.3089172Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand 2020-12-06T00:05:33.3133776Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || : 2020-12-06T00:05:33.3415339Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader 2020-12-06T00:05:33.3454712Z http.https://github.com/.extraheader 2020-12-06T00:05:33.3464375Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader 2020-12-06T00:05:33.3511821Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || : 2020-12-06T00:05:33.3833341Z Cleaning up orphan processes

FYI: Comparison to other deployment ways

  1. publish by func command w/ --build remote
    -> permissions is preserved
    image

  2. publish by func
    -> permissions is not preserved
    image
    But it can be changed to executable from function's code.
    After invoking /api/makechromexecutable in above my repo, the binary becames executable.
    image

Change the name of the action to fit the purpose

It's hard to understand this as an Action that deploys to Azure Functions by its current name. In fact, I didn't understand what Action does.

I think a name like Azure/functions-deploy would be more appropriate for the real world.

Unable to deploy Python to a Linux Premium App

Our workflow

I'm using Github actions to automatically deploy my production and staging Function Apps. My team is using Gitlab Flow, so we have a "master" branch (kind of a "dev" branch), which is then pushed to a "preproduction" branch, which is pushed to a "production" branch.

My actions

I set up two actions, to deploy to my function apps every time there is a push on the "preproduction" or "production" branches.

I have a .github/workflows/preproduction-deploy.yml and .github/workflows/production-deploy.yml which contain:

.github/workflows/preproduction-deploy.yml

name: Deploy on pre-production
on:
  push:
    branches:
      - preproduction


env:
  AZURE_FUNCTIONAPP_NAME: function-preprod
  AZURE_FUNCTIONAPP_PACKAGE_PATH: 'azure-functions/my-project' 
  PYTHON_VERSION: '3.8'             

jobs:
  build-and-deploy:
    runs-on: ubuntu-18.04
    environment: dev
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Python ${{ env.PYTHON_VERSION }} Environment
      uses: actions/[email protected]
      with:
        python-version: ${{ env.PYTHON_VERSION }}
    - name: 'Resolve Project Dependencies Using Pip'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        python -m pip install --upgrade pip
        pip install -r requirements.txt --target=".python_packages/lib/site-packages"
        popd
    - name: 'Run Azure Functions Action'
      uses: Azure/[email protected]
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

.github/workflows/production-deploy.yml

name: Déploiement OneDashboard en production
on:
  push:
    branches:
      - production

env:
  AZURE_FUNCTIONAPP_NAME: function-prod
  AZURE_FUNCTIONAPP_PACKAGE_PATH: 'azure-functions/my-project' 
  PYTHON_VERSION: '3.8'  

jobs:
  build-and-deploy:
    runs-on: ubuntu-18.04
    environment: dev
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Python ${{ env.PYTHON_VERSION }} Environment
      uses: actions/[email protected]
      with:
        python-version: ${{ env.PYTHON_VERSION }}
    - name: 'Resolve Project Dependencies Using Pip'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        python -m pip install --upgrade pip
        pip install -r requirements.txt --target=".python_packages/lib/site-packages"
        popd
    - name: 'Run Azure Functions Action'
      uses: Azure/[email protected]
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.MY_PROJECT_PROD_FUNCTIONAPP_PUBLISH_PROFILE }}

My problem

When I push on the "preproduction" branch, I see the action running, then when the action is done, I can check the App Files in the Portal, for my pre-production Function App, and I see the right code.

But when I push on the "production" branch, I see the action running, then succeeding, but the App Files do not reflect the right code. I see the same files that I deployed the time before, via Visual Studio Code.

  • when I check the deployment logs, I see "{\"type\":\"Deployment\",\"sha\":\"[the_correct_sha]\",\"repoName\":\"my_repo\",\"slotName\":\"production\"}", where [the_correct_sha] is the SHA of the last commit on "production"
  • When I go to the Azure Portal > my production Function App > Deployment Center > Deployment Logs, the last deployment has the correct commit ID ([the_correct_sha]), but there is another deployment that was made previously with "Commit Author: N/A" and the commit ID is not a commit ID on my project.

Failed to fetch Kudu App Settings

Run Azure/functions-action@v1
##[Initialize]
##[ValidateParameter]
Successfully parsed SCM credential from old publishProfile
##[ValidateAzureResource]
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings (SCM)
Error:     Failed to fetch Kudu App Settings.
Not Found (CODE: 404)
Error:       Error: Failed to fetch Kudu App Settings.
Not Found (CODE: 404)
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:62:23)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Deployment Failed!

I'm sorry the repo is a private repo so I can't share the function code, but this is something was working some time ago, and now my latest builds are getting this error

Use publish profile credential for functions-action

Currently, we are relying on Azure RBAC for authentication, but this requires the user to have owner role in their subscription scope.

We want to allow the customer to use publish profile's credential for publishing the function app, and this publish profile's credential is only accepted by api/zipdeploy endpoint.

But previously, there is no public api/zipdeploy endpoint for Linux Consumption function app, since we just released it at 10/1/2019 10:00AM PDT, we may want to enable this feature.

app-url always returns http:// URL

Even if the function has httpsOnly true, app-url still gets set to http://, not https://

I'm making use of app-url together with GitHub Environments deployments, so would be nice if app-url output value was correct and used https://

Support .PublishProfile with ZipDeploy section

The app service team slowly dropping the MSDeploy section from .publishSettings, currently causing an issue in ARC function app.
Our GitHub Action should be more resilient and able to parse the ZipDeploy section as well.
Here's an example of the new .publishSettings file:

<publishData>
    <publishProfile
        profileName="functionapp-name - Zip Deploy"
        publishMethod="ZipDeploy"
        publishUrl="functionapp-name.scm.arc-stamp.northcentralusstage.k4apps.io"
        userName="functionapp-username"
        userPWD="functionapp-password"
        destinationAppUrl="http://functionapp-name.arc-stamp.northcentralusstage.k4apps.io"
    />
</publishData>

Support Run from Package feature

First, thanks for your work! This was a long awaited Github action and finally we can run both CI and CD workflows in Github 🚀.

If I understand it correctly, currently the Action uses zip deploy strategy where it's copying files to the /home/site/wwwroot directory on the Function App host machine. This is where the runtime will read files from.

I wonder if you're planning to add support for Run from package? From what I gather it's a preferred way to run FAs since it has some advantages (atomicity, faster cold starts, etc) over normal copy-to-home-folder strategy.

Besides, run from package seems to be ON by default when deploying with Azure Functions Core Tools. It'd be great to see consistency among the tools!

.funcignore is (still) not respected

Recreating #36 (comment) as an issue for better visibility:

I gave this action a try and I can still see .funcignored files deployed to the target host.

Here's the repo to reproduce: https://github.com/maximivanov/azure-functions-cd-github-actions

respect-funcignore: true is set on the functions-action in the workflow file.
Among others, .funcignore includes .gitignore.

Once cloud resources are provisioned (I use Terraform for that), I trigger the CD workflow in the repo.

Expected:
.gitignore is not deployed.

Actual:
I can see .gitignore in the app files section in the Portal.

Screen Shot 2020-12-18 at 22 34 42

@N-Usha @Hazhzeng

Let me know if you need any further details. Thanks!

Unable to deploy a linux typescript functionapp

Not entirely sure if this is where I should write the issue. Technically not an issue of the action, but perhaps an underlying azure platform issue.

When I build and deploy my typescript functionapp, the deploy succeeds, but the function app is totally messed up. Here's what I've found.

  1. Github action logs indicate deployment was successful:
##[Initialize]
##[ValidateParameter]
##[ValidateAzureResource]
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (SCM)!
##[PreparePublishContent]
Will directly deploy ./app/app.zip as function app content
Will use api/zipdeploy to deploy (scm credential)
##[PublishContent]
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://app.scm.azurewebsites.net/api/deployments/<xxxxxx>/log
Successfully deployed web package to App Service.
Successfully updated deployment History at https://app.scm.azurewebsites.net/api/deployments/<xxxx>
  1. When I navigate to the function app and click on functions, no functions are present
  2. When I click on files, I can see the root files are there (host.json, package.json)
  3. When I go to the storage area and download the zip file and try to expand it, it fails saying it is an unsupported format (I'm on a mac).

If I switch over to use azure function core tools and use that to publish the function, it works without issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.