Regressions were introduced when fixing
https://github.com/hashicorp/terraform/pull/8607 . Specifically when
resources in the statefile are deleted or missing in real life, then
terraform plan would exit with an error when it recieved a 404 not
found. The correct behaviour would be to show a plan with the offer to
create the missing resources.
The error was ignored causing Terraform to report that the deployments was
successful rather than in a bad state. This commit cause the apply operation
to report the error.
Added a test which attempts to create a storage account with a name longer
than the maximum permitted length to force a failure.
```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTemplateDeployment_ -timeout 120m
=== RUN TestAccAzureRMTemplateDeployment_basic
--- PASS: TestAccAzureRMTemplateDeployment_basic (377.78s)
=== RUN TestAccAzureRMTemplateDeployment_withParams
--- PASS: TestAccAzureRMTemplateDeployment_withParams (327.89s)
=== RUN TestAccAzureRMTemplateDeployment_withError
--- PASS: TestAccAzureRMTemplateDeployment_withError (226.64s)
PASS
ok github.com/hashicorp/terraform/builtin/providers/azurerm 932.440s
```