An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hello D C!
Thank you for providing the detailed error payload. Please find the summary of our discussion and resolution over emails.
You tried below troubleshooting steps, but it did not work.
1. Update your Bicep API version (Highly Recommended) In your Bicep snippet, you are using the API version 2022-08-01. The Standard v2 pricing tier did not exist when the 2022-08-01 API specification was released. While ARM attempts backwards compatibility, sending a payload with an older API version against a newly introduced v2 tier can sometimes cause control-plane translation failures on the backend—which often result in the exact 502 HTML proxy error you are seeing.
- Action: Try updating the API version for all your APIM resources in this template (including the parent
existingresource) to a newer version that natively understands the v2 tiers, such as2023-09-01-previewor2024-03-01.
2. Avoid Bicep Race Conditions (dependsOn) Even though Bicep infers parent-child dependencies implicitly, array loops ([for api in apisToAdd]) creating mappings can sometimes fire an API request to the control plane just milliseconds before the actual API definitions (some-api, another-api) are fully committed across the APIM distributed backend. This race condition can sometimes cause the backend management plane to crash or hang, returning a 502.
- Action: Ensure you have an explicit
dependsOnproperty referencing the Bicep block that creates the APIs themselves, so the association loop doesn't jump the gun.
3. Test Manual/REST Association To instantly confirm if this is an Azure-side bug rather than a Bicep syntax issue, go into the Azure Portal for this Standard v2 instance and try manually associating some-api to the product. If the portal hangs or throws an error, you have confirmed the backend management plane for your instance is temporarily degraded.
Resolution: There was an outage on April 22, 2026 in v2 SKU of various APIM resources. The issue was resolved by the backend team, and you confirmed that issue is resolved.