Azure APIM v2 Standard VNet Integration via Bicep

Syed Hussain 20 Reputation points
2024-04-16T23:06:47.02+00:00

Hello,

Trying to automate APIM v2 Standard with Bicep template, we are using VNet Integration hence need to add that to the Bicep as well but when we do it hits this error.

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/[subscriptionid]/resourceGroups/rg-group/providers/Microsoft.Resources/deployments/azuredeploy","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","message":"Request to resource 'https://management.azure.com/subscriptions/[subscription id]/providers/Microsoft.Web?api-version=2019-07-01' failed with StatusCode: Unauthorized for RequestId: b5366bd8-f26a-4690-bf9c-37114e7e6386. Exception message: The access token is from the wrong issuer 'https://sts.windows.net/[guid]/'. It must match the tenant 'https://sts.windows.net/[guid]/' associated with this subscription.

These are the Bicep relevant parts.

param apim_vnet string = '/subscriptions/${subscription_id}/resourceGroups/${resource_group_network}/providers/microsoft.network/virtualnetworks/vnet-name'
param apim_subnet string = '${apim_vnet}/subnets/snet-name'


virtualNetworkConfiguration: {
      subnetResourceId: apim_subnet
 }	

If I comment the above virtualNetworkConfiguration section, error goes away, only thing I could guess is that maybe having issue due to the subnet being in a different resource group? If yes, how do we deal with it?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,755 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 21,246 Reputation points
    2024-04-17T17:12:12.3466667+00:00

    @Syed Hussain Thanks for your patience. I had a discussion internally and confirmed its a Bug in the standard V2 APIM. Created a work item to fix this bug and being tracked internally. We don't have an exact ETA at the moment will revert back to you as soon as I have an update.

    We apologize for the inconvenience caused by the issue. Feel free to add a comment if any questions.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.


0 additional answers

Sort by: Most helpful