terraform-provider-azurerm: azurerm_app_service transient error - "RepoUrl VSTSRM is not supported"
Community Note
- Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave ā+1ā or āme tooā comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and AzureRM Provider) Version
$ /c/tools/Terraform/terraform0_12_29.exe -v
Terraform v0.12.29
+ provider.azuread v0.11.0
+ provider.azurerm v2.23.0
+ provider.local v1.4.0
+ provider.random v2.3.0
Affected Resource(s)
azurerm_function_app
,azurerm_app_service
Terraform Configuration Files
resource "azurerm_function_app" "mgmtportal_fa" {
name = "${local.resourceNamePrefix}${local.nameschemeAffixes.azureFunction}${var.functionAppName}"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
app_service_plan_id = "${azurerm_app_service_plan.mgmtportal_asp.id}"
storage_connection_string = "${azurerm_storage_account.mgmtportal_sa.primary_connection_string}"
version = "~3"
app_settings = {
// ...
}
site_config {
always_on = true
}
identity {
type = "SystemAssigned"
}
}
Debug Output
Error Message
Error: failed to create App Service Source Control for "aitifdevaffunctions" (Resource Group "aitdevelopment"): 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."]}}]
on main.tf line 369, in resource "azurerm_function_app" "mgmtportal_fa":
369: resource "azurerm_function_app" "mgmtportal_fa" {
Failing Request
2020-08-19T10:03:49.1545190Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: PUT /subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/sourcecontrols/web?api-version=2019-08-01 HTTP/1.1
2020-08-19T10:03:49.1545852Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Host: management.azure.com
2020-08-19T10:03:49.1546672Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: User-Agent: Go/go1.14.5 (amd64-windows) go-autorest/v14.0.0 Azure-SDK-For-Go/v44.2.0 web/2019-08-01 HashiCorp Terraform/0.12.29 (+https://www.terraform.io) Terraform Plugin SDK/1.13.1 terraform-provider-azurerm/2.23.0 VSTS_3a20467b-7171-4b7e-a40b-19e133f2093a_build_354_0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
2020-08-19T10:03:49.1547477Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Length: 135
2020-08-19T10:03:49.1547949Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Type: application/json; charset=utf-8
2020-08-19T10:03:49.1548480Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: c1d1a14c-1989-abf4-4e88-a526f0abfa49
2020-08-19T10:03:49.1548981Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Accept-Encoding: gzip
2020-08-19T10:03:49.1549387Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:03:49.1549989Z 2020-08-19T12:03:49.151+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: {"properties":{"repoUrl":"VSTSRM","branch":"master","isManualIntegration":false,"deploymentRollbackEnabled":false,"isMercurial":false}}
2020-08-19T10:03:49.3271152Z 2020/08/19 12:03:49 [TRACE] dag/walk: vertex "local_file.mgmt_sql_init_sql" is waiting for "azurerm_function_app.mgmtportal_fa"
2020-08-19T10:03:49.6218201Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/sourcecontrols/web?api-version=2019-08-01:
2020-08-19T10:03:49.6219247Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: HTTP/2.0 400 Bad Request
2020-08-19T10:03:49.6219696Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Length: 459
2020-08-19T10:03:49.6220135Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Cache-Control: no-cache
2020-08-19T10:03:49.6220609Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Type: application/json; charset=utf-8
2020-08-19T10:03:49.6221096Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Date: Wed, 19 Aug 2020 10:03:49 GMT
2020-08-19T10:03:49.6221550Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Expires: -1
2020-08-19T10:03:49.6221961Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Pragma: no-cache
2020-08-19T10:03:49.6222398Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Server: Microsoft-IIS/10.0
2020-08-19T10:03:49.6222891Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Strict-Transport-Security: max-age=31536000; includeSubDomains
2020-08-19T10:03:49.6223396Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Aspnet-Version: 4.0.30319
2020-08-19T10:03:49.6224054Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Content-Type-Options: nosniff
2020-08-19T10:03:49.6224588Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: c1d1a14c-1989-abf4-4e88-a526f0abfa49
2020-08-19T10:03:49.6225716Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Ratelimit-Remaining-Subscription-Writes: 1195
2020-08-19T10:03:49.6226250Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Request-Id: e2b2adc5-b93e-4fd8-b715-0aec297c41cd
2020-08-19T10:03:49.6226845Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Routing-Request-Id: GERMANYWESTCENTRAL:20200819T100349Z:e2b2adc5-b93e-4fd8-b715-0aec297c41cd
2020-08-19T10:03:49.6227761Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Powered-By: ASP.NET
2020-08-19T10:03:49.6228480Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:03:49.6229625Z 2020-08-19T12:03:49.621+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: {"Code":"BadRequest","Message":"Operation not supported: RepoUrl VSTSRM is not supported.","Target":null,"Details":[{"Message":"Operation not supported: RepoUrl VSTSRM is not supported."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"51024","MessageTemplate":"Operation not supported: {0}","Parameters":["RepoUrl VSTSRM is not supported."],"Code":"BadRequest","Message":"Operation not supported: RepoUrl VSTSRM is not supported."}}],"Innererror":null}
Likely problematic response (before the error happens)
2020-08-19T10:02:11.7321231Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] AzureRM Request:
2020-08-19T10:02:11.7322258Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: GET /subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/config/web?api-version=2019-08-01 HTTP/1.1
2020-08-19T10:02:11.7323280Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Host: management.azure.com
2020-08-19T10:02:11.7324605Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: User-Agent: Go/go1.14.5 (amd64-windows) go-autorest/v14.0.0 Azure-SDK-For-Go/v44.2.0 web/2019-08-01 HashiCorp Terraform/0.12.29 (+https://www.terraform.io) Terraform Plugin SDK/1.13.1 terraform-provider-azurerm/2.23.0 VSTS_3a20467b-7171-4b7e-a40b-19e133f2093a_build_354_0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
2020-08-19T10:02:11.7325998Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: 51f9c150-2d49-80c3-8936-9a9e9470cf5b
2020-08-19T10:02:11.7326770Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Accept-Encoding: gzip
2020-08-19T10:02:11.7327382Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:11.7327947Z 2020-08-19T12:02:11.729+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:11.8261663Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/config/web?api-version=2019-08-01:
2020-08-19T10:02:11.8263146Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: HTTP/2.0 200 OK
2020-08-19T10:02:11.8263968Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Cache-Control: no-cache
2020-08-19T10:02:11.8264764Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Type: application/json
2020-08-19T10:02:11.8266111Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Date: Wed, 19 Aug 2020 10:02:08 GMT
2020-08-19T10:02:11.8266953Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Expires: -1
2020-08-19T10:02:11.8267411Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Pragma: no-cache
2020-08-19T10:02:11.8267845Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Server: Microsoft-IIS/10.0
2020-08-19T10:02:11.8268346Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Strict-Transport-Security: max-age=31536000; includeSubDomains
2020-08-19T10:02:11.8268843Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Vary: Accept-Encoding
2020-08-19T10:02:11.8269291Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Aspnet-Version: 4.0.30319
2020-08-19T10:02:11.8269757Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Content-Type-Options: nosniff
2020-08-19T10:02:11.8270269Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: 51f9c150-2d49-80c3-8936-9a9e9470cf5b
2020-08-19T10:02:11.8271571Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Ratelimit-Remaining-Subscription-Reads: 11990
2020-08-19T10:02:11.8272384Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Request-Id: 6f279179-6bcb-4308-8fb6-a2007b1fc03a
2020-08-19T10:02:11.8273954Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Routing-Request-Id: GERMANYWESTCENTRAL:20200819T100209Z:02ad04d3-0df4-400e-a381-6fca02eefb8c
2020-08-19T10:02:11.8275023Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Powered-By: ASP.NET
2020-08-19T10:02:11.8275456Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:11.8282150Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: {"id":"/subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/config/web","name":"aitifdevaffunctions","type":"Microsoft.Web/sites/config","location":"West Europe","tags":{},"properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","powerShellVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"acrUseManagedIdentityCreds":false,"acrUserManagedIdentityID":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$aitifdevaffunctions","publishingPassword":null,"appSettings":null,"azureStorageAccounts":{},"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"VSTSRM","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":true,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":true,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","vnetRouteAllEnabled":false,"siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"aadClaimsAuthorization":null,"googleClientId":null,"googleClientSecret":null,"googleClientSecretSettingName":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookAppSecretSettingName":null,"facebookOAuthScopes":null,"gitHubClientId":null,"gitHubClientSecret":null,"gitHubClientSecretSettingName":null,"gitHubOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"twitterConsumerSecretSettingName":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountClientSecretSettingName":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":[],"supportCredentials":false},"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":18048,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":false,"minTlsVersion":"1.2","scmMinTlsVersion":"1.0","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"functionAppScaleLimit":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null,"minimumElasticInstanceCount":0}}
2020-08-19T10:02:11.8288880Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] AzureRM Request:
2020-08-19T10:02:11.8289568Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: GET /subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/sourcecontrols/web?api-version=2019-08-01 HTTP/1.1
2020-08-19T10:02:11.8290242Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Host: management.azure.com
2020-08-19T10:02:11.8291069Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: User-Agent: Go/go1.14.5 (amd64-windows) go-autorest/v14.0.0 Azure-SDK-For-Go/v44.2.0 web/2019-08-01 HashiCorp Terraform/0.12.29 (+https://www.terraform.io) Terraform Plugin SDK/1.13.1 terraform-provider-azurerm/2.23.0 VSTS_3a20467b-7171-4b7e-a40b-19e133f2093a_build_354_0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
2020-08-19T10:02:11.8291936Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: 51f9c150-2d49-80c3-8936-9a9e9470cf5b
2020-08-19T10:02:11.8292439Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Accept-Encoding: gzip
2020-08-19T10:02:11.8292846Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:11.8293223Z 2020-08-19T12:02:11.825+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:12.0698984Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/sourcecontrols/web?api-version=2019-08-01:
2020-08-19T10:02:12.0700200Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: HTTP/2.0 200 OK
2020-08-19T10:02:12.0700650Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Cache-Control: no-cache
2020-08-19T10:02:12.0701303Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Content-Type: application/json
2020-08-19T10:02:12.0702116Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Date: Wed, 19 Aug 2020 10:02:08 GMT
2020-08-19T10:02:12.0702732Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Etag: "1D6760C83016480"
2020-08-19T10:02:12.0703273Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Expires: -1
2020-08-19T10:02:12.0703782Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Pragma: no-cache
2020-08-19T10:02:12.0704297Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Server: Microsoft-IIS/10.0
2020-08-19T10:02:12.0704926Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Strict-Transport-Security: max-age=31536000; includeSubDomains
2020-08-19T10:02:12.0705541Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: Vary: Accept-Encoding
2020-08-19T10:02:12.0706074Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Aspnet-Version: 4.0.30319
2020-08-19T10:02:12.0706640Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Content-Type-Options: nosniff
2020-08-19T10:02:12.0707522Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Correlation-Request-Id: 51f9c150-2d49-80c3-8936-9a9e9470cf5b
2020-08-19T10:02:12.0708539Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Ratelimit-Remaining-Subscription-Reads: 11989
2020-08-19T10:02:12.0709402Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Request-Id: d994b01a-c9d6-4290-9c66-169b9b0e4214
2020-08-19T10:02:12.0710015Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Ms-Routing-Request-Id: GERMANYWESTCENTRAL:20200819T100209Z:fc3f0e7c-d8cc-4c54-a93d-f76d7a79757a
2020-08-19T10:02:12.0710570Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: X-Powered-By: ASP.NET
2020-08-19T10:02:12.0710978Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe:
2020-08-19T10:02:12.0712046Z 2020-08-19T12:02:12.068+0200 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: {"id":"/subscriptions/99e0a02c-f0ab-41ad-8de7-d621ce36a09e/resourceGroups/aitdevelopment/providers/Microsoft.Web/sites/aitifdevaffunctions/sourcecontrols/web","name":"aitifdevaffunctions","type":"Microsoft.Web/sites/sourcecontrols","location":"West Europe","tags":{},"properties":{"repoUrl":"VSTSRM","branch":null,"isManualIntegration":false,"isGitHubAction":false,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"Succeeded"}}
Expected Behavior
Deployment should work
Actual Behavior
apply fails with error
Steps to Reproduce
terraform apply
in our CI pipeline
Important Factoids
I feel like this has been introduced in #7945, as we donāt even want to set/use these fields. My assumption is that when we deploy to the webapp via Azure DevOps (different pipeline) that the field is set with the VSTSRM
-Value and then terraform somehow reads that and tries to change it (it shows in the diff, that it tries to change to None
).
Interestingly, even when I set
lifecycle {
ignore_changes = [
site_config.0.scm_type,
source_control
]
}
the deployment fails. Iām not sure why the terraform provider should ever try to write this field, given the above configurations.
Iām still testing but I think downgrading to 2.22.0
should work.
We have a function app and a web app, and it seems like either both work or both fail in a single deployment. If my assumption is correct that this happens when the function or web app are deployed (or are being deployed) by the other pipeline this seems reasonable. This also explains why I cannot reproduce this with another infrastructure I have deployed myself, this only happens in our CI/CD pipeline.
References
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 66
- Comments: 42 (6 by maintainers)
I have now (Iām head-down on another issue at the moment) - ADO appears to be a special case there. The API prevents updating the source_control items if
site_config.scm_type
is set, which is why itās cleared on update. It might be that we can excludeVSTSRM
from that (that value has only relatively recently been supported by the SDK). Iāll take a look as soon as I can for a potential solution.Iām confused why this doesnāt have a bug label? It looks like a Bug to me?
I reverted to 2.22.0, removed the source_control object attributes manual_integration, rollback_enabled and use_mercurial in my state file, and it worked.
Iām still seeing this error on 2.29. Whatās really strange is that the Error 400 on āApplyā happens every other build. My repo is in github and my pipeline is in ADO. I donāt have this issue on 2.22, but confirmed it started on 2.23.
Error: failed to create App Service Source Control for "<redacted>" (Resource Group "<redacted>"): 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 donāt have
scm_type
defined in my azure function and the plan doesnāt show anything changing in this regard.My function app:
I think I may be able to help with this having smashed by head against it for over a month.
What I have found is that this is actually not an issue with Terraform at all in our case, but is instead an issue caused by the way we are applying infrastructure changes. Here is what we haveā¦
Terraform (obviously) that builds our resource groups and components (including an app_service) Azure Devops Release pipeline with a stage that uses the āAzure App Service deployā step to deploy our web site
This step in the azure dev ops release pipeline deploys the code using a ZIP deploy method (thatās built-in behavior) but it seems it does a little more than that. It actually sets the startup command ānode app.jsā AND the scm_type to āVSTSRMā
So, we have the terraform scripts that set scm_type to NONE and then the āAzure App Service deployā step was setting it to VSTSRM. When we next ran terraform it attempts to change the setting in situ and BANG!!!
Setting scm_type to VSTSRM in the terraform now means that it never tries to unset it.
@MelHarbour findings tie up with what weāre seeing as well
Setting
site_config{ scm_type = "None" }
didnāt work for me@jackofallops have you seen this already by any chance? Might be related to the change where you exposed
source_control
.After much debugging and trying simple cases, weāve been able to pin down a little more accurately whatās going wrong, and we believe that some of the problems are coming from the Azure CLI (or whatever the provider is using to connect to Azure under the hood).
Do the first two steps suggested by @kensykora in the steps to reproduce and then run the following command with the Azure CLI against your newly created App Service:
Then youāll get some output that will show you (amongst other things, a repoUrl of
VSTSRM
. If you then try and run the following command:It will error (with much the same error as quoted in the original issue). Our conclusion - the values from Microsoft donāt round trip correctly. The Terraform provider is attempting to run a command to send updates to the source config section as above (not sure why it does, since nothing has changed).
If you let a
terraform apply
fail as above and then look at the source config using the CLI, youāll see that repoUrl has become set to null. Which you also canāt round trip into the CLI.Not really sure what that means with regard to a fix. It feels like the provider shouldnāt really be calling out to Azure to set something that hasnāt changed, but then it also feels like the values ought to round trip.
Do you try this :
site_config { scm_type = āVSTSRMā }
lifecycle { ignore_changes = [ app_settings[āWEBSITE_RUN_FROM_PACKAGEā], app_settings[āMSDEPLOY_RENAME_LOCKED_FILESā], site_config[āremote_debugging_enabledā],
site_config[āremote_debugging_versionā],
site_config[āscm_typeā],
id, ] }
When i have added site_config[āscm_typeā] i not longer get the error.
Kind regards,
@kensykora a potential work around is to use
AzureCLI@2
and aaz functionapp deployment source config-zip
script instead. this is what we do now. TBH I found theAzureFunctionApp@1
unreliable and opaque.Hi @sonic1981 - Iām just back form vacation, so Iāve not delved deeply into this, but in your example above you appear to explicitly set
scm_type = "None"
on a resource that has existingVSTSRM
typesource_control
. This will prevent the workaround in PR8531 from skipping over the code that would try to resend the source_control config, resulting in the previous issue. Are you able to try without overriding thescm_type
?Iāve just upgraded to 2.29.0 and Iāve just received this error message:
So I donāt think this is fixed @jackofallops
Hereās the plan that triggers the issue:
Hereās the terraform file for the above:
Looks at your changes in the PR Iād expect this to work?
We are not using continous deployments via scm. Explicitly setting
site_config{ scm_type = "None" }
Has resolved the issue in our case
We tried this, but it did not work around the issue. The issue goes away if you redeploy terraform. The issue only pops back up on subsequent application code deployments to app service, and on the following terraform deployment.
Steps to reproduce
Expected: applies change Actual: Errors with message in original post
Note: After step 4, you can continue redeploying terraform without incident. Again, The error only shows up after step 2 when you deploy app code.
Indeed it should get a note in the documentation that this parameter is not optional in any case eg. when using VSTS/AzureDevops!
https://www.terraform.io/docs/providers/azurerm/r/app_service.html#scm_type
@didaskein
Kudos! I can confirm that adding
site_config["scm_type"]
to lifecycle -> ignore_changes resolved the issue - at least in my case for aazurerm_function_app
resource.