I have created an azure function app via Terraform and then deployed source code of function app into it via Azure DevOps CI & CD pipelines.
Next, I have deployed the Terraform scripts with some modifications then I am getting the following error for the first execution. But if I redeployed those TF scripts, then I am not getting the below error:
Error: failed to create App Service Source Control for "" (Resource Group ""): web.AppsClient#CreateOrUpdateSourceControl: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Operation not supported: RepoUrl VSTSRM is not supported." Details=[{"Message":"Operation not supported: RepoUrl VSTSRM is not supported."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"51024","Message":"Operation not supported: RepoUrl VSTSRM is not supported.","MessageTemplate":"Operation not supported: {0}","Parameters":["RepoUrl VSTSRM is not supported."]}}]
I am using the following terraform configuration:
terraform {
required_version = ">=0.14"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.40.0"
}
}
Function App terraform configuration file:
resource "azurerm_function_app" "function_app" {
name = var.fn_name
resource_group_name = var.rg_name
location = var.location
tags = var.tags
app_service_plan_id = var.app_service_plan_id
storage_account_name = var.sa_name
storage_account_access_key = var.sa_primary_access_key
version = var.runtime_version
enabled = var.enabled
https_only = var.https_only
client_affinity_enabled = var.client_affinity_enabled
app_settings = {
FUNCTIONS_WORKER_RUNTIME = "dotnet"
WEBSITE_NODE_DEFAULT_VERSION = "10.14.1"
FUNCTION_APP_EDIT_MODE = "readonly"
WEBSITE_RUN_FROM_PACKAGE = "1"
APPINSIGHTS_INSTRUMENTATIONKEY = var.instrumentation_key
}
identity {
type = var.identity_type
identity_ids = var.identity_type == "UserAssigned" ? var.identity_ids : null
}
site_config {
always_on = var.always_on
scm_type = "None"
cors {
allowed_origins = var.cors_allowed_origins
support_credentials = var.cors_support_credentials
}
}
lifecycle {
ignore_changes = [
app_settings["WEBSITE_RUN_FROM_PACKAGE"],
site_config["scm_type"]
]
}
}
Steps to reproduce:
- Deploy terraform config
- Deploy function app code via azure devops App Service task
- Make a tweak to terraform config (this might even be optional)
- Redeploy terraform
Before posting question here, I have spent lot of time on this issue in google and then found few articles related to this issue. But the issue remains same.
azurerm_app_service transient error - "RepoUrl VSTSRM is not supported"
So, can you please suggest me how to resolve the above error.