Azure ExpressRouter REST API ForbiddenError

민지 남 20 Reputation points
2023-03-09T04:35:28.9833333+00:00

Hi,

Azure REST API retuns ForbiddenError

How do I resolve the error?

REST API Request :

METHOD: GET

URL: https://management.core.windows.net/{subscription}/services/networking/dedicatedcircuits

header

Authoriztion: Bearer access_token

REST API Response:

<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

    <Code>ForbiddenError</Code>

    <Message>The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.</Message>

</Error>

accss_token make Request:

METHOD: POST

URL: https://login.microsoftonline.com/{tenant}/oauth2/token
grant_type:client_credentials
client_id: my_clienct
client_secret: my_client_secret
resource: https://management.core.windows.net/
Azure ExpressRoute
Azure ExpressRoute
An Azure service that provides private connections between Azure datacenters and infrastructure, either on premises or in a colocation environment.
323 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 35,251 Reputation points Microsoft Employee
    2023-03-13T13:29:12.4933333+00:00

    @민지 남

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I understand that you are trying to make a REST call to get Azure ExpressRoute Circuit.

    I am afraid I did not get what resource you are trying to "GET"

    For ExR Circuits, the reference is,

    GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}?api-version=2022-07-01

    However, I see you are doing a REST call to some other resource "dedicatedcircuit".

    Can you please provide more clarity on this?

    Cheers,

    Kapil


0 additional answers

Sort by: Most helpful