The terminal then displays the below error message:
Initializing the backend…
Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.
Error refreshing state: storage: service returned error: StatusCode=400, ErrorCode=,
ErrorMessage=Response body could no be unmarshaled: invalid character '<' looking for
beginning of value. Body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid URL</h2>
<hr><p>HTTP Error 400. The request URL is invalid.</p>
</BODY></HTML>
., RequestInitiated=Wed, 19 Feb 2020 13:30:00 GMT, RequestId=, API Version=,
QueryParameterName=, QueryParameterValue=
Could you try removing the backslash from key = "DEV\terraform.tfstate. I get the exact same error when I add a backslash to key in my backend configuration file.
terraform init -backend-config=config/prod_backend.tfvars
Initializing the backend...
Error refreshing state: storage: service returned error: StatusCode=400, ErrorCode=, ErrorMessage=Response body could no be unmarshaled: invalid character '<' looking for beginning of value. Body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid URL</h2>
<hr><p>HTTP Error 400. The request URL is invalid.</p>
</BODY></HTML>
., RequestInitiated=Wed, 19 Feb 2020 19:34:33 GMT, RequestId=, API Version=, QueryParameterName=, QueryParameterValue=