https://pulumi.com logo
Title
r

ripe-school-9827

05/15/2023, 7:01 PM
Hi, trying to get started using Pulumi. I have my dev resource group populated with the resources I need. I'm trying to run the import cli tool to generate example for me, My command looks like this:
pulumi import azure-native:resources:resourceGroup [RESOURCE_GROUP_NAME] /subscription/[SUBSCRIPTION_ID]
However I'm getting the following error:
error: Preview failed: autorest/azure: Service returned an error. Status=400 Code="MissingApiVersionParameter" Message="The api-version query parameter (?api-version=) is required for all requests."
Any pointers where I am going wrong would be most appreciated
l

little-library-54601

05/15/2023, 7:32 PM
Have you seen this in the API docs for Azure Native: https://www.pulumi.com/registry/packages/azure-native/api-docs/resources/resourcegroup/#import The example command line has more after /subscription/[subscription-id]:
pulumi import azure-native:resources:ResourceGroup myResourceGroup /subscriptions/{subscription-id}/resourceGroups/myResourceGroup
r

ripe-school-9827

05/15/2023, 7:42 PM
Thanks, that did the trick. I tried that initially, but have azure-native:resource:resourceGroups maybe the ResourceGroup was the issue in the type name
l

little-library-54601

05/15/2023, 8:17 PM
FWIW, I keep an "import" stack in my project so I can do imports into a stack other than the one where I actually want Pulumi to manage the resources.