https://pulumi.com logo
Title
b

billions-spoon-83449

12/14/2020, 10:22 PM
Anyone know a way to import resources from Azure in the new AzureNextGen format?
I had hoped it would be as simple as replacing
azure:core:ResourceName
with
azure:nextgen:ResourceName
in the URN.
t

tall-librarian-49374

12/14/2020, 10:32 PM
Unfortunately, it’s more complicated. Resource names, property names, and shapes are different between the two. Right now, it’s a manual process where you’d delete the old resource from the state (
pulumi state delete
) and then import the new resource with the
import
option.
b

billions-spoon-83449

12/14/2020, 10:36 PM
Not sure how to import the new resource. For example, the NextGen ResourceGroup docs don’t show an example of the
import
statement. https://www.pulumi.com/docs/reference/pkg/azure-nextgen/resources/resourcegroup/
Does the old format work fine?
t

tall-librarian-49374

12/14/2020, 10:38 PM
Yes, we need to update the docs there. It’s the same command, you just need to get the URN right. E.g.
azure-nextgen:resources/latest:ResourceGroup
b

billions-spoon-83449

12/14/2020, 10:38 PM
ah, ok.
Thanks! I’ll give that a try.
So if I want to port a project over to NextGen, I’ll have to delete all the state and re-import it all using the updated URN, right?
t

tall-librarian-49374

12/14/2020, 10:44 PM
Yes. You can even start a new project, import everything there, and “forget” the old one.
b

billions-spoon-83449

12/14/2020, 10:47 PM
Ah, ok. Thanks!