Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing and modifying existing Azure resources #904

Closed
akata72 opened this issue Nov 13, 2020 · 5 comments
Closed

Importing and modifying existing Azure resources #904

akata72 opened this issue Nov 13, 2020 · 5 comments
Labels
question Further information is requested

Comments

@akata72
Copy link

akata72 commented Nov 13, 2020

Hi,

We have a large migration project where we are using tools like Azure Migrate to migrate resources into Azure.
Azure Migrate will move and provision resources (like nics, vms and disks) outside any IaC scope.

However we would like to import/reference or somehow hook up these resources in our bicep file to start managing these through code (i.e adding a new disk). So we are looking for something similar to terraform import feature.

@akata72 akata72 added the enhancement New feature or request label Nov 13, 2020
@ghost ghost added the Needs: Triage 🔍 label Nov 13, 2020
@anthony-c-martin
Copy link
Member

Out of interest, are you able to use the ARM Export Template functionality today to fetch an ARM Template for these resources?

If so, I believe that once #402 has been implemented, you should be able to fetch a template containing these resources from Azure and convert to .bicep.

@alex-frankel alex-frankel added question Further information is requested and removed Needs: Triage 🔍 enhancement New feature or request labels Nov 17, 2020
@akata72
Copy link
Author

akata72 commented Nov 18, 2020

Hi, thanks for the response. It would be possible to export the resources to an ARM template and eventually convert to bicep, but I was hoping for a more «programmatic» way of achieving this. Not sure exactly what I am looking for though. 😀

@akata72 akata72 closed this as completed Nov 18, 2020
@alex-frankel
Copy link
Collaborator

In theory, we could add a command like:

bicep export -f main.bicep --resource-id "path/to/resource"

Which could do the export, convert it to bicep and add it to the file of your choosing (in this case main.bicep). That could be pretty cool. Though we want to be careful not to recreate functionality, so it may make more sense to add it to the az group export. Definitely an interesting idea.

@chudytom
Copy link

chudytom commented Oct 1, 2021

Is there any progress on this idea?
It would work like a better version of Terraform Import https://www.terraform.io/docs/cli/import/index.html
Because Terraform only imports resources to the state, does not create the actual configuration in code

@pdahlgren
Copy link

@Azure Azure locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants