Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, could you please help with following problem? How can I use different Azure Functions in test and production environments within an Azure Functions solution? I need to deploy my solution to multiple environments, but I want to use different Azure Functions in each environment. Any suggestions or best practices would be appreciated. Thank you!
To deploy your Azure Functions solution to multiple environments (e.g., test and production) and use different Azure Functions in each environment, you can use the following approach:
Example DevOps Pipeline
trigger:
branches:
include:
- main
jobs:
- job: Deploy_to_Test
displayName: Deploy to Test
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureFunctionApp@1
inputs:
azureSubscription: 'Your_Azure_Subscription'
appType: 'functionApp'
appName: 'your-function-app-test'
package: '$(System.DefaultWorkingDirectory)/path/to/your/functionapp.zip'
deploymentMethod: 'auto'
- job: Deploy_to_Prod
displayName: Deploy to Production
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureFunctionApp@1
inputs:
azureSubscription: 'Your_Azure_Subscription'
appType: 'functionApp'
appName: 'your-function-app-prod'
package: '$(System.DefaultWorkingDirectory)/path/to/your/functionapp.zip'
deploymentMethod: 'auto'