-
Notifications
You must be signed in to change notification settings - Fork 190
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
Tool can't parse the Service level scope defined in Azure API Management #444
Comments
@mirzos The error seems derive from the provider: https://github.com/hashicorp/terraform-provider-azurerm/blob/8f356e27d0daad612a75308e801c5ba9374d525e/internal/services/apimanagement/api_management_subscription_resource.go#L247-L260 // check if the subscription is for all apis or a specific product/ api
if props.Scope != "" && !strings.HasSuffix(props.Scope, "/apis") {
// the scope is either a product or api id
parseId, err := product.ParseProductIDInsensitively(props.Scope)
if err == nil {
productId = parseId.ID()
} else {
parsedApiId, err := api.ParseApiIDInsensitively(props.Scope)
if err != nil {
return fmt.Errorf("parsing scope into product/ api id %q: %+v", props.Scope, err)
}
apiId = parsedApiId.ID()
}
} Would you mind to manually run |
@magodo Thanks for your reply and I tried with Terraform directly to import the configs and I was able to do so. |
Hi @mirzos, just to be sure you are importing the exact same resource: |
Hi @magodo yes, this is the exact resource I am trying to import |
Hi @magodo, could you find the issue? |
I've tried to run Since there is nothing we can do here, I prefer to skip this resource for now. |
Hi @magodo thanks for your answer. I will skip this resource for now (y) |
@magodo do you have any updates to this issue? |
I am trying this tool to import configuration for a vanilla Azure API Management instance. When I try to import it into Terraform code it throws an error. This error is related to the built-in subscription for Service scope called "Built-in all-access subscription". Seems like the tool is not able to interpret this scope.
Failed to import /subscriptions/0000-0000-0000-0000-0000/resourceGroups/resource-group-name/providers/Microsoft.ApiManagement/service/apim-instance-name/subscriptions/master as azurerm_api_management_subscription.res-33: exit status 1
Error: parsing scope into product/ api id "/subscriptions/0000-0000-0000-0000-0000/resourceGroups/resource-group-name/providers/Microsoft.ApiManagement/service/apim-instance-name/": ID was missing the
apiselement
The text was updated successfully, but these errors were encountered: