Module 1 · Platform, Identity and Storage · Lesson 2 of 8
Identity, Security & Configuration
Start with the failure
A workload can manage a storage account as Owner but receives 403 when reading a blob with its managed identity. A teammate proposes embedding an account key. First separate control-plane permissions, data permissions and network reachability.
Diagnose the access decision in layers
| Layer | Question to answer |
|---|---|
| Identity selection | Which principal did the configured credential actually choose? |
| Data authorization | Does that principal have the required Blob data operation at the right scope? |
| Control plane | Managing the account and assigning roles is different from directly reading blob data |
| Network | Does the client resolve and reach the permitted endpoint? |
| Secret/config reference | Which component resolves it, with which identity, and when does refresh occur? |
| Recovery | Soft-delete recovers the vault/object; related role assignments/subscriptions need separate restoration |
Interview reference
Question 7. What is a Managed Identity, how does it differ from a Service Principal, and when do you use system-assigned vs user-assigned?
A service principal is a tenant-local security identity, not the secret used to authenticate it. Application-type service principals can use secrets, certificates or workload identity federation. Managed identities are a different service-principal type; they do not require an associated app registration. A Managed Identity is a special service principal whose credentials are created and rotated by Azure and never exposed to you — eliminating secrets in code and config.
System-assigned identity is tied 1:1 to a single resource and deleted with it — ideal for a resource that needs its own identity. User-assigned identity is a standalone resource you can attach to many services and that survives them — useful when an identity and its role assignments must outlive compute redeployments. Reuse across workloads is possible, but sharing also shares permissions and blast radius; separate identities where least-privilege boundaries differ. The identity still needs appropriate resource permissions and secure token handling. Managed identities, federation.
Example
With DefaultAzureCredential, the same code can use your developer login locally and a managed identity in Azure without branching. Its credential chain can select other configured credentials first; choose and configure the production credential deliberately.
var cred = new DefaultAzureCredential();
var client = new BlobServiceClient(
new Uri("https://acct.blob.core.windows.net"), cred);
// Locally -> az login / VS credential.
// In Azure -> managed identity if selected by the configured credential chain.Analogy
A service principal is an identity badge, which can be authenticated using different credentials; a managed identity is a building keycard the facilities team issues, rotates, and revokes for you — you just tap in.
Question 8. Explain Azure RBAC: roles, scope, and assignments.
RBAC authorization is the triple (security principal, role definition, scope). The principal is a user, group, service principal, or managed identity. The role definition is a set of allowed actions (e.g. Storage Blob Data Reader). The scope is where it applies — management group, subscription, resource group, or a single resource.
Assignments inherit downward: a resource-group assignment applies its defined operations to relevant child resources, not unrestricted rights to every type of data. Effective access can also depend on applicable deny assignments and conditions. A data-plane role is not a substitute when the task genuinely needs management actions. Azure RBAC. Follow least privilege — prefer fine-grained data-plane roles (Storage Blob Data Contributor) over broad control-plane roles like Owner, and assign at the narrowest scope that works.
Question 9. How do you use Azure Key Vault from a .NET app, and what are soft-delete and purge protection?
Key Vault centrally stores secrets, keys, and certificates behind RBAC/access policies, with audit logging available when diagnostic logging is enabled. A .NET app authenticates with a managed identity (no bootstrap secret) and either reads secrets via SecretClient or uses Key Vault references. The App Configuration .NET provider still authenticates to Key Vault and retrieves the secret for the app; App Service app-setting references can instead be resolved by the platform.
Soft-delete is enabled by default for new vaults and cannot be disabled once enabled. Retention is configured at vault creation from 7–90 days (default 90) and cannot later be changed. Purge protection is a separate setting that prevents early permanent purge during that window; enable it for production. Recovery is not a complete restore of surrounding infrastructure: deleted-vault RBAC assignments and Event Grid subscriptions are not restored automatically. Soft-delete and purge protection.
Example
SDK fragment using Azure.Security.KeyVault.Secrets and Azure.Identity, with the relevant imports and an async calling context. Configure the selected credential's secret-read permission and network access. Retrieval exposes the secret value to the application; do not log it.
var client = new SecretClient(
new Uri("https://myvault.vault.azure.net"),
new DefaultAzureCredential());
KeyVaultSecret secret = await client.GetSecretAsync("SqlConn");
string conn = secret.Value;Analogy
Key Vault is a bank vault for secrets; soft-delete is the bank holding your safe-deposit box for its configured recovery period (90 days by default) after you 'close' it; purge protection means not even the manager can shred it early.
Question 10. Explain SAS tokens: account vs service vs user-delegation SAS, and the role of stored access policies.
A Shared Access Signature grants scoped, time-limited access to storage without sharing the account key. An account SAS can cover multiple services and is signed by the account key. A service SAS is scoped to one service (e.g. one container/blob), also signed by the account key. A user-delegation SAS is signed with a user delegation key obtained using Microsoft Entra ID, rather than the account key. Microsoft recommends it where possible; revoke the delegation key or relevant permissions to invalidate affected SAS tokens, not one arbitrary token independently.
A stored access policy can hold permissions and expiry for a service SAS; account SAS and user-delegation SAS do not support these policies. Changing or deleting the policy can revoke associated service SAS tokens. An ad-hoc SAS has no per-token stored-policy revocation, but rotating its signing account key or revoking its user delegation key or permissions can invalidate it before expiry.
Question 11. How does Azure App Configuration differ from Key Vault, and how are they used together?
App Configuration is a centralized store for non-secret settings and feature flags, with labels (for per-environment values), point-in-time snapshots, and change notifications. Key Vault is for secrets. They complement each other: App Configuration holds settings and can store references instead of secret values. The .NET configuration provider resolves Key Vault references by authenticating to Key Vault and reading the secret into the application; a raw App Configuration client returns the reference, not an automatically resolved secret. The app must have separate access to both services and still protect secrets in memory and logs. This gives you central config + feature management across many services and environments, while secrets remain protected and separately audited. Feature flags can change behavior without redeployment only when the app evaluates them and its configured refresh mechanism observes changes; a central edit is not an instantaneous push into every process or previously captured option value. Configure refresh, caching and outage behavior deliberately. App Configuration practices.
Check your decision
A managed identity has Owner on a storage account but no Blob data role. What should be checked before replacing identity authentication with an account key?
Show answer
Correct answer: A
Owner does not itself grant this Blob data operation, and a private endpoint supplies connectivity rather than data permission. DefaultAzureCredential can select another configured credential, so check the actual principal as well as the required data role, scope and network path. A shared account key bypass is not a diagnosis.
Hint: Identify the resource operation, not just the resource’s management role.
Practice before reading the answers
- A process reads an App Configuration Key Vault reference through the raw App Configuration client. Should it automatically receive the secret value?
- A team wants to revoke only one user-delegation SAS through a stored access policy. Why is that proposal wrong?
Answer check
- No. The .NET configuration provider can resolve references with separately authorized Key Vault access; the raw client returns the reference. The application still handles the resolved secret securely.
- User-delegation SAS does not support stored access policies or arbitrary individual-token revocation that way. Use short scope/expiry and a documented broader key/permission revocation plan, accounting for propagation.
TechInterviewNotes Editorial Team · Updated 28 Oct 2026 ·