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?