Closed middiu closed 1 year ago
@middiu Here is a reference template for steps before functions-actions: https://github.com/Azure/actions-workflow-samples/blob/master/FunctionApp/windows-dotnet-functionapp-on-azure.yml
@middiu Here is a reference template for steps before functions-actions: https://github.com/Azure/actions-workflow-samples/blob/master/FunctionApp/windows-dotnet-functionapp-on-azure.yml
This is exactly where I started from, and the issue was still there.
Any idea?
This issue is idle because it has been open for 14 days with no activity.
@middiu Firstly, there is a typo in your template: Change from "#package" to "package". You cannot comment a required parameter.
Second, are you trying to switch between publish profiles for 2 slots? If so, then you will have to add slot-name parameter for functions-action task: slot-name: This parameter is the slot name to be deployed to. By default, this value is empty, which means the GitHub Action will deploy to your main production site. When this setting points to a non-production slot, please ensure the publish-profile parameter contains the credentials from the function app slot instead of the main production site.
Hi,
I am also having same issue for dotnet 6 Az Function project. It is working if it deployed from Visual Studio 22 local machine. But, It is not working if it deployed thourgh Github Actions.
I used below same template for Github Action.
Can anyone please help to solve this issue?
Hi, I am encountering the same issue. dotnet 8.0 Az Function project. It works if it is published from local VSE 2022 but does not work when it is published from GH Actions.
Hi Guys,
I'd need your help to understand what is wrong with my Github Workflow.
I have a dotnet 6 Az Function project that has been running for weeks. Before I was using Azure DevOps Pipelines for deployment and everything was working fine. Now I migrated my repo to Github and I'm trying to deploy the app using Github Actions.
The issue is when I deploy the Function App from Github, the action itself complete successfully but when invoked ALL the Functions raise an exception:
The requested service 'XXXXXX' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
Yes I do use Autofac for DI, but when I deploy from Visual Studio, Visual Studio Code or from Azure DevOps pipelines everything works fine, so it must be something related to how I compile/publish the function app in this workflow
This is Action: `jobs: build-and-deploy: runs-on: windows-latest environment: dev steps:
name: 'Checkout GitHub Action' uses: actions/checkout@master
run: echo ${{github.ref}}
name: 'Set ENVs for Development' run: | echo 'AZURE_FUNCTIONAPP_NAME=xxxx' >> $env:GITHUB_ENV echo 'AZURE_PUB_PROFILE=${{ secrets.DEV_AZ_FA_API_PUBLISH_PROFILE }}' >> $env:GITHUB_ENV if: github.ref == 'refs/heads/development'
name: 'Set ENVs for PROD' run: | echo 'AZURE_FUNCTIONAPP_NAME=xxx' >> $env:GITHUB_ENV echo 'AZURE_PUB_PROFILE=${{ secrets.PROD_AZ_FA_API_PUBLISH_PROFILE }}' >> $env:GITHUB_ENV if: github.ref == 'refs/heads/main'
name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment uses: actions/setup-dotnet@v2 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 /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary popd
name: 'Deploy API Azure Functions' uses: Azure/functions-action@v1 id: fa with: app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
I also tried setting scm-do-build-during-deployment and enable-oryx-build to true but the result doesn't change.
Any idea? Anything I can try?
Cheers