hashicorp / terraform-provider-azure-classic

Terraform Azure Classic (Service Management) provider
https://www.terraform.io/docs/providers/azure/
Mozilla Public License 2.0
2 stars 11 forks source link

azure: error parsing settings_file as XML: EOF #11

Closed hashibot closed 6 years ago

hashibot commented 7 years ago

This issue was originally opened by @ravbaba as hashicorp/terraform#4054. It was migrated here as part of the provider split. The original body of the issue is below.


Hi, I get the error with azure provider:

[ERROR] root: eval: *terraform.EvalSequence, err: Warnings: ["settings_file": [DEPRECATED] Use the publish_settings field instead]. Errors: [error parsing settings_file as XML: EOF]

I changed settings_file to publish_settings and I still get the same issue.

provider "azure" {
  publish_settings = "${file(var.azure_settings_file)}"
}
hashibot commented 7 years ago

This comment was originally opened by @jen20 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-159579478. It was migrated here as part of the provider split. The original comment is below.


Hi @ravbaba, thanks for opening the issue. Can you confirm that the file you're referencing is in fact valid XML? Do you have the azure_settings_file variable set anywhere?

hashibot commented 7 years ago

This comment was originally opened by @ravbaba as https://github.com/hashicorp/terraform/issues/4054#issuecomment-159593065. It was migrated here as part of the provider split. The original comment is below.


Hi @jen20, yes, I have a valid XML file and azure_settings_file variable is set in a different file. All my configuration worked before I changed terraform version to 0.6.7.

I tested it on two different machines (mac and ubuntu) and I got the same error. I tried to use those two arguments instead of publish_settings or settings_file:

subscription_id
certificate

but I got the same error.

Please let me know if you need more details.

hashibot commented 7 years ago

This comment was originally opened by @xied75 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-159952336. It was migrated here as part of the provider split. The original comment is below.


Related to avoid a new issue I'll put it here.

It seems although the warning information is about settings_file is DEPRECATED, yet if I don't specify this in tf and use publish_settings, I still get the same warning (plus a prompt for settings_file value, if I just enter I'll get the warning). If I set both, I no longer got prompt but the warning will still display.

Might be in the source code settings_file is NOT optional, thus the required status.

hashibot commented 7 years ago

This comment was originally opened by @progre55 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-162134368. It was migrated here as part of the provider split. The original comment is below.


I can confirm the failures. Was using tf 0.6.6, with settings_file and everything was fine. Upgraded to tf 0.6.8, now nothing works. I have renamed settings_file to publish_settings, but still get a prompt for settings_file, and then it fails with EOF as follows

terraform plan -target=module.azure-instance-01

provider.azure.publish_settings
  Enter a value: azure.publishsettings

There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Warnings:

  * module.azure-instance-01.provider.azure: "settings_file": [DEPRECATED] Use the publish_settings field instead

Errors:

  * module.azure-instance-01.provider.azure: error parsing publish_settings as XML: EOF

Here is my provider declaration:

provider "azure" {
  publish_settings = "${file(var.azure_publish_settings)}"
}

I am sure that the file is a valid XML file. Used to work well with 0.6.6.

hashibot commented 7 years ago

This comment was originally opened by @davehodgson as https://github.com/hashicorp/terraform/issues/4054#issuecomment-162263653. It was migrated here as part of the provider split. The original comment is below.


I have exactly the same behaviour after upgrading 0.6.6 to 0.6.8, it worked with no issues before - the only change I made was in response to the warning about deprecation and that was to change settings_file to publish_settings as above

hashibot commented 7 years ago

This comment was originally opened by @joaocc as https://github.com/hashicorp/terraform/issues/4054#issuecomment-178501810. It was migrated here as part of the provider split. The original comment is below.


+1

hashibot commented 7 years ago

This comment was originally opened by @bdelamotte as https://github.com/hashicorp/terraform/issues/4054#issuecomment-185907477. It was migrated here as part of the provider split. The original comment is below.


Hi, is this still broken in 0.6.11?

hashibot commented 7 years ago

This comment was originally opened by @joaocc as https://github.com/hashicorp/terraform/issues/4054#issuecomment-186094248. It was migrated here as part of the provider split. The original comment is below.


Yeap. I have since moved to ARM, which is the "new and recommended thing" and, most importantly, works :)

hashibot commented 7 years ago

This comment was originally opened by @BigCheeze45 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-187948856. It was migrated here as part of the provider split. The original comment is below.


@joaocc could you be so kind as to share a sample Terraform file using ARM. I've been trying to move over to ARM but haven't had much success on that front. Thanks in advance!

hashibot commented 7 years ago

This comment was originally opened by @joaocc as https://github.com/hashicorp/terraform/issues/4054#issuecomment-187982096. It was migrated here as part of the provider split. The original comment is below.


Hi @BigCheeze45. What problem are you facing? I managed to get it working by setting auth as environment variables:

export ARM_SUBSCRIPTION_ID=xxxxxxxx-xxx-xxx-xxx-xxxxxxx
export ARM_CLIENT_ID=
export ARM_CLIENT_SECRET=
export ARM_TENANT_ID=

and defining and empty provider

provider "azurerm" {
}
hashibot commented 7 years ago

This comment was originally opened by @BigCheeze45 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-187999555. It was migrated here as part of the provider split. The original comment is below.


@joaocc, I get this error message: Error refreshing state: 1 error(s) occurred:

The subscription id I have no problem finding but it's the other ones I'm on quite confused on. And I've looked at resources online to see how to generate those (Client and Tenant ID and Client Secret) but nothing seems to be working. I'm on version 0.6.11. Will tryout your solution and see if it works on my end. Again, thanks for the help.

hashibot commented 7 years ago

This comment was originally opened by @joaocc as https://github.com/hashicorp/terraform/issues/4054#issuecomment-188512195. It was migrated here as part of the provider split. The original comment is below.


@BigCheeze45, pls check the instructions here. This is how I was able to generate those keys. J

hashibot commented 7 years ago

This comment was originally opened by @BigCheeze45 as https://github.com/hashicorp/terraform/issues/4054#issuecomment-190831371. It was migrated here as part of the provider split. The original comment is below.


Just wanted to say thanks for the help @joaocc. I was able to generate all the necessary key. I'm getting a 403 (Forbidden) error but I think I can tinker with it from here. Thanks again :+1: :+1: :smile:

vancluever commented 6 years ago

Hello!

Thank you for opening this issue and participating in the discussion. Today (December 19, 2017) we’ve announced the deprecation and archival of the Azure Classic Provider. Matching Microsoft’s commitment to gradually remove access to Azure Classic (or Service Management) which is outlined in this blog post, we are closing all open PR's and Issues here. This repository will remain available here on GitHub, but in an archived state, and no longer receiving support or new releases.

The Azure (Resource Manager) Provider remains fully supported and is our recommended approach for managing Azure with Terraform. More information about this process is available in the blog post linked above.

Thanks! The Terraform Team