Anyone know a way to import resources from Azure i...
# azure
b
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
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
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
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
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
Yes. You can even start a new project, import everything there, and “forget” the old one.
b
Ah, ok. Thanks!