Hello, I am running into issues trying to import an existing azure subscription into a local tfstate file.
On the resource page there is a notice on the bottom of the page that says the following (emphasis mine):
“When importing a Subscription that was not created programmatically, either by this Terraform resource or using the Alias API, it will have no Alias ID to import via
terraform import .
In this scenario, the
subscription_id property can be completed and Terraform will assume control of the existing subscription by creating an Alias. See the
adding an Alias to an existing Subscription above. Terrafom requires an alias to correctly manage Subscription resources due to Azure Subscription API design.”
My interpretation of this is that an alias is required and by following the steps in the
adding an Alias to an existing Subscription, Terraform will add the alias to the resource and import it. The user here had the same interpretation and ran into the same issue I am seeing now that the import command errors out saying the Alias cannot be found.
In the github issue linked above, it is stated that the subscription must have an existing Alias before the import can be done, which contradicts what is said on the terraform resource page about Terraform creating the Alias. What is the correct process here? If the Alias needs to be manually applied through other means to a subscription before it can be imported, can the documentation please be updated to reflect this?