VSTSRM value in repo_url in function_app

When I deploy a “azurerm_function_app” via Terraform, it creates a “source_control” properties block, with repo_url set to “”, which is correct.

When we then deploy a function into that function app, and run the infrastructure pipeline again, it changes that repo_url to “VSTSRM” in the state file… and then fails with:

Error: failed to create App Service Source Control for “sr-dm-tst-we-app” (Resource Group “SR-DM-TST-WE-RG”): 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.”]}}]

It also deletes the existing function from the azurerm_function_app.

Where is that VSTSRM coming from? We don’t specify it anywhere, but Terraform seems to create it, and then fail because it’s there.

Any ideas on how to resolve this?

Thanks,
Wayne