Scenario
I’m attempting to deploy a sample .NET Hello World Webapp to Azure, referencing a forked GitHub repository. The deployment process indicates that it is referencing my forked repository, but the GitHub Actions workflow does not trigger, and the web app is not deployed from the forked repo. I’ve tinkered with various settings with the terraform config, to no avail.
Issue
Despite configuring the repository and providing the GitHub authentication token, the GitHub Actions workflow is not triggered, and the web app is not deployed from the forked repository. I’ve also tinkered with setting the manual_integration
variable of the source control slot to no avail.
Question:
Is there an additional authentication step or configuration that I’m missing between GitHub and the Azure portal to ensure the deployment triggers and pulls the code from my forked repository?
I am being patient post-deployment and waiting 10 minutes for the site to show. And it does work when deployed manually in the Azure portal.
Any help would be greatly appreciated! Thank you!
Terraform config:
webapp.tf
resource "azurerm_service_plan" "srv_plan" {
name = "${local.prefix}service-plan"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku_name = var.webapp_sku
os_type = var.webappos
tags = local.common_tags
}
resource "azurerm_windows_web_app" "dot_net_web_app" {
name = "${local.prefix}dotnet-app"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
service_plan_id = azurerm_service_plan.srv_plan.id
https_only = true
public_network_access_enabled = false
enabled = true
webdeploy_publish_basic_authentication_enabled = true
site_config {
always_on = true
minimum_tls_version = var.tls_version
application_stack {
current_stack = var.stack
dotnet_version = var.stack_version
}
}
}
resource "azurerm_source_control_token" "source_token" {
type = "GitHub"
token = var.github_auth_token
token_secret = var.github_auth_token
}
resource "azurerm_windows_web_app_slot" "slot" {
name = "${local.prefix}app-slot"
app_service_id = azurerm_windows_web_app.dot_net_web_app.id
site_config {}
}
resource "azurerm_app_service_source_control_slot" "git_source" {
slot_id = azurerm_windows_web_app_slot.slot.id
repo_url = var.webapp_repo_url
branch = var.webapp_repo_branch
use_mercurial = false
use_manual_integration = false
depends_on = [azurerm_source_control_token.source_token]
github_action_configuration {
generate_workflow_file = false
}
}
variables.tf
variable "webapp_sku" {
type = string
default = "P1v2"
}
variable "webappos" {
type = string
default = "Windows"
}
variable "tls_version" {
type = string
default = "1.2"
}
variable "stack" {
type = string
default = "dotnet"
}
variable "stack_version" {
type = string
default = "v7.0"
}
variable "subresource" {
type = list(string)
default = ["sites"]
}
variable "webapp_repo_url" {
type = string
default = "https://github.com/ZimCanIT/hello-world-webapp"
}
variable "webapp_repo_branch" {
type = string
default = "main"
}
variable "github_auth_token" {
type = string
sensitive = true
description = "Token for authorization"
}