DEV Community

Cover image for 403 while being Owner
Antoine
Antoine

Posted on

1

403 while being Owner

Photo by Kyle Glenn on Unsplash

Our project is using Token provided by Microsoft.Azure.Services.AppAuthentication, like in this example.

For example, if you want to access KeyVault and database

using Microsoft.Azure.Services.AppAuthentication;
using Microsoft.Azure.KeyVault;
using System.Data.SqlClient

// Use AzureServiceTokenProvider’s built-in callback for KeyVaultClient
var azureServiceTokenProvider = new AzureServiceTokenProvider();
var kv = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));

// Request an access token for SqlConnection
sqlConnection = new SqlConnection(YourConnectionString)) 
{ 
    sqlConnection.AccessToken = azureServiceTokenProvider.GetAccessTokenAsync("https://database.windows.net"); 
    sqlConnection.Open(); 
}
Enter fullscreen mode Exit fullscreen mode

Note: the token is cached across AzureServiceTokenProvider instance as you can see.

In the example, we use the scope "https://database.windows.net". For Storage, we can use "https://storage.windows.net".
Everything went fine as long as we use Container, but we get 403 response when we download blob content.

403 ? even if i have the Owner role ! how is it possible ?

The answer is in this blog post. There are role for Content Plane (Owner / Contributor etc ..), and for Data Plane (Storage Blob Data Contributor / Storage Queue Data Reader). Once set, manipulation blob or queue was possible.

Hope this help !

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay