Hi @Joey Liu ,
However, I cannot find any relevant documentation/example on how to do that. Can we configure the GitHub action in bicep or we still need to define the workflow in our GitHub repo?
https://learn.microsoft.com/en-us/azure/app-service/provision-resource-bicep has a template that demonstrates Microsoft.Web/sites/sourcecontrols
. You can use the following bicep in your GitHub action.
param webAppName string = uniqueString(resourceGroup().id) // Generate unique String for web app name
param sku string = 'F1' // The SKU of App Service Plan
param linuxFxVersion string = 'NODE|14-lts' // The runtime stack of web app
param location string = resourceGroup().location // Location for all resources
param repositoryUrl string = 'https://github.com/Azure-Samples/nodejs-docs-hello-world'
param branch string = 'master'
var appServicePlanName = toLower('AppServicePlan-${webAppName}')
var webSiteName = toLower('wapp-${webAppName}')
resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: appServicePlanName
location: location
properties: {
reserved: true
}
sku: {
name: sku
}
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
name: hostingPlanName
location: location
sku: {
name: skuName
}
properties:{
reserved: true
}
}
}
resource appService 'Microsoft.Web/sites@2020-06-01' = {
name: webSiteName
location: location
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
linuxFxVersion: linuxFxVersion
}
}
}
resource srcControls 'Microsoft.Web/sites/sourcecontrols@2021-01-01' = {
name: '${appService.name}/web'
properties: {
repoUrl: repositoryUrl
branch: branch
isManualIntegration: true
}
}
For example, I want to deploy a spring boot app to Azure app service. So in the GitHub action, I would normally do a Gradle build and similar stuff. Now, with bicep, Can I configure all this within bicep or I still need to define the build in GitHub
Bicep is for deploying resources to Azure, another tool for ARM deployments. Anything related to the build of resources will still need to be done in your GitHub action. Where those artifacts are deployed to can be handled by your bicep file.