Open ottosulin opened 2 years ago
Hello @ottosulin according to this part of the error message:
The api-version query parameter (?api-version=) is required for all requests
you need to add ?api-version=
to your import statement e.g.
pulumi import \
azure-native:operationalinsights:workspace dev-logs \
/subscriptions/xx/resourcegroups/xx/providers/microsoft.operationalinsights/workspaces/dev-logs?api-version=[INSERT_VERSION_HERE]
Actually, it looks like that's an internal message. Will look into what's the correct incantation is to get the import working.
@ottosulin @danielrbradley I seem to recall seeing this before, If my memory serves correctly I think it was down to the resource type being case sensitive, e.g. azure-native:operationalinsights:workspace
should be azure-native:operationalinsights:Workspace
Don't quote me on that though. I could be misremembering.
I can verify that the case is significant here. For example: pulumi import azure-native:network:applicationgateway
fails but pulumi import azure-native:network:ApplicationGateway
works.
Thank you both for the feedback, will re-close as resolved then.
@danielrbradley Changes either to the message or making the command case insensitive would be a good idea, as it's still confusing if you aren't aware of that quirk.
It always fails when importing Azure front door rule even though ?api-version=2022-11-01-preview
was added.
the error message:
azure-native:cdn:Rule (name):
error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="One or more rules contains actions 'RouteConfigurationOverride' that are not supported in the current API version. Please use the correct API version to retrieve the resource."
pulumi:pulumi:Stack (FrontdoorIac-ZenoProd):
error: update failed
related module: https://www.pulumi.com/registry/packages/azure-native/api-docs/cdn/rule/
but same URL works when testing with https://learn.microsoft.com/en-us/rest/api/frontdoor/azurefrontdoorstandardpremium/rules/get#code-try-0
Hello @ottosulin according to this part of the error message:
The api-version query parameter (?api-version=) is required for all requests
you need to add
?api-version=
to your import statement e.g.pulumi import \ azure-native:operationalinsights:workspace dev-logs \ /subscriptions/xx/resourcegroups/xx/providers/microsoft.operationalinsights/workspaces/dev-logs?api-version=[INSERT_VERSION_HERE]
@gainskills the comment you quoted was incorrect - you should not need to include the api-version - this is automatically resolved by the provider. The issue identified by scp-mb and mikaahopelto is that the type token must be an exact match - including case.
The message you're getting is different
One or more rules contains actions 'RouteConfigurationOverride' that are not supported in the current API version. Please use the correct API version to retrieve the resource.
My first suggestion would be to look at the features you're using on the resource as it sounds like Azure is refusing to let you use and older version of the API which doesn't support the feature. You could instead use an explicit version of the resource such as azure-native:cdn/v20230501:Rule
or azure-native:cdn/v20221101preview:Rule
@gainskills the comment you quoted was incorrect - you should not need to include the api-version - this is automatically resolved by the provider. The issue identified by scp-mb and mikaahopelto is that the type token must be an exact match - including case.
The message you're getting is different
One or more rules contains actions 'RouteConfigurationOverride' that are not supported in the current API version. Please use the correct API version to retrieve the resource.
My first suggestion would be to look at the features you're using on the resource as it sounds like Azure is refusing to let you use and older version of the API which doesn't support the feature. You could instead use an explicit version of the resource such as
azure-native:cdn/v20230501:Rule
orazure-native:cdn/v20221101preview:Rule
awesome, it works with
pulumi import azure-native:cdn/v20221101preview:Rule ruleName "/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Cdn/profiles/afdName/ruleSets/rulesetName/rules/ruleName?api-version=2022-11-01-preview"
thanks for your help @danielrbradley
What happened?
I was trying to run:
Steps to reproduce
I was able to import a virtual network, but not a resource group or log analytics workspace, which is quite strange.
Expected Behavior
Generated code would appear.
Actual Behavior
But I got the following response (no more details even with increased verbosity and debug flag):
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).