Getting error "The client with object id does not have authorization to perform action" using azure-sdk-for-go

Akhil PB 0 Reputation points
2024-04-17T18:37:23.15+00:00

Getting following error while trying to read/write privateDNSzone which is in the subscription "4a224af2-b22d-4a92-a556-fd0d0aa06847" from another subscription "017b8edd-1cb1-4c3e-aa2a-2f62880b1d3d" using azure-sdk-for-go.

GET https://management.azure.com/subscriptions/4a224af2-b22d-4a92-a556-fd0d0aa06847/resourceGroups/test-rg/providers/Microsoft.Network/privateDnsZones/privatelink.mysql.database.azure.com -------------------------------------------------------------------------------- RESPONSE 403: 403 Forbidden ERROR CODE: AuthorizationFailed -------------------------------------------------------------------------------- { "error": { "code": "AuthorizationFailed", "message": "The client 'eccbe23e-ce10-49ee-a742-9f8612377ef1' with object id 'eccbe23e-ce10-49ee-a742-9f8612377ef1' does not have authorization to perform action 'Microsoft.Network/privateDnsZones/read' over scope '/subscriptions/4a224af2-b22d-4a92-a556-fd0d0aa06847/resourceGroups/test-rg/providers/Microsoft.Network/privateDnsZones/privatelink.mysql.database.azure.com' or the scope is invalid. If access was recently granted, please refresh your credentials." } } --------------------------------------------------------------------------------

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
597 questions
{count} votes