Skip to content
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

[BUG] Resource ID for create backend in APIM not working as expected #29531

Open
Thomaz-Peres opened this issue Jun 20, 2024 · 1 comment
Open
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@Thomaz-Peres
Copy link

Thomaz-Peres commented Jun 20, 2024

API Spec link

API Spec version

2023-05-01-preview

Describe the bug

The error happens when I try to create the backend in APIM with the resource ID, and it doesn't find the resource.

I'm using terraform, but following the documentation, it looks like an Azure problem with the resource ID.

However, resource_id isn't found only with the resource_ID. You need to put https://management.azure.com/ before the resource_id.

Like this after formatting:
https://management.azure.com/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1

Expected behavior

Create the APIM backend with only the resource ID, /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1.

Actual behavior

Not creating the APIM backend with only the resource ID

Reproduction Steps

As I said before, I'm using terraform.

To reproduce can use this example to test the error:

resource "azurerm_api_management_backend" "example" {
  name                = format("%s%s", "example", var.env)
  description         = format("%s%s", "example", var.env)
  api_management_name = var.apim_name
  resource_group_name = var.resource_group_name
  protocol            = "http"
  url                 = format("%s%s%s", "https://example", var.env, ".azurewebsites.net/api")
  resource_id         = var.example_id

  tls {
    validate_certificate_chain = false
    validate_certificate_name  = false
  }
}

And to reproduce without the error:

resource "azurerm_api_management_backend" "example" {
  name        = format("%s%s", "example", var.env)
  description = format("%s%s", "example", var.env)

  api_management_name = var.apim_name
  resource_group_name = var.resource_group_name

  protocol    = "http"
  url         = format("%s%s%s", "https://***", var.env, ".azurewebsites.net/api")
  resource_id = format("%s%s", "https://management.azure.com", var.example)

  tls {
    validate_certificate_chain = false
    validate_certificate_name  = false
  }
}

Environment

No response

@Thomaz-Peres Thomaz-Peres added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 20, 2024
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Jun 21, 2024
@v-jiaodi
Copy link
Member

@solankisamir Please help take a look, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants