An Azure service that provides an event-driven serverless compute platform.
The host.json affects all functions within the instance. Meaning your service1 and service2 will have to be deployed separately to different function app instances. Both instances can be assigned to the same app service plan. Having said that,
If service1 host.json has the same setting like service2 host.json (eg. maxConcurentCalls) but with different values, does the Azure Service know which setting to use for each Azure Function?
The app will only look at a single host.json and apply to all functions running under that instance.
Does Azure Service merge the host.json files using specific rule? Should be the host.json identical?
No, it doesn't merge any files.
Under your current structure, you can either configure two separate GitHub actions for service1 and service2; this way when changes are merged with the trunk, the updates can be applied to both function app instances. Another option within a single yaml pipeline, you separate service1 and service2 into their respective artifact folders and include two different function app deployments.
name: Deploy to Azure Functions
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy function1
uses: Azure/functions-action@v1
with:
app-name: 'function1'
package: './function1'
publish-profile: ${{ secrets.function1_publish_profile }}
- name: Deploy function2
uses: Azure/functions-action@v1
with:
app-name: 'function2'
package: './function2'
publish-profile: ${{ secrets.function2_publish_profile }}