Implement Azure Security
203 questions
You are developing an ASP.NET Core web application hosted on an Azure App Service. The application must retrieve database connection strings from an Azure Key Vault. The security architecture requires that:
1. The application must authenticate to Azure Key Vault without storing any credentials or secrets in code or configuration files.
2. The identity used for authentication must be shared across multiple web applications in the same environment to simplify access control management.
Which configuration should you implement to meet these requirements?
An organization is migrating an ASP.NET Core web application to Azure App Service. The application must retrieve a database connection string from Azure Key Vault `kv-prod` using Azure App Configuration. The web application is configured to use a user-assigned managed identity named `id-app-prod`. The Azure Key Vault uses Azure role-based access control (Azure RBAC) for authorization. You need to configure the App Configuration key-vault reference and ensure the App Service web application can retrieve the database connection string. Which two configuration steps must you perform? (Select TWO)
Select all that apply
You are developing a daemon application named 'BillingJob' that runs nightly as a background service on an Azure Virtual Machine. The application must query Microsoft Graph to retrieve the profile details of all users in the Microsoft Entra ID tenant to generate monthly billing reports. No user is signed in when the application runs.
You need to configure the permissions for the application registration in Microsoft Entra ID while adhering to the principle of least privilege.
Which configuration should you implement?
You are developing a secure .NET web application using the `Azure.Storage.Blobs` SDK (v12). The application must generate a Shared Access Signature (SAS) token for an Azure Blob Storage container named `invoices`.
The security requirements are as follows:
- The token must be signed using Microsoft Entra ID credentials (a User Delegation SAS) instead of the storage account key.
- The client must only be allowed to read and list the contents of the container.
- The SAS must restrict access to requests originating from the client IP address range `198.51.100.0/24`.
- The token must enforce the use of HTTPS only.
- The token must account for potential clock skew by setting the start time to 15 minutes before the current time.
You write the following method to generate the SAS token:
csharp
public async Task<string> GenerateContainerSasUriAsync(BlobServiceClient client, string containerName, string accountName)
{
UserDelegationKey delegationKey = await client.GetUserDelegationKeyAsync(
DateTimeOffset.UtcNow.AddMinutes(-15),
DateTimeOffset.UtcNow.AddHours(2)
);
BlobSasBuilder builder = new BlobSasBuilder()
{
BlobContainerName = containerName,
Resource = "c",
StartsOn = DateTimeOffset.UtcNow.AddMinutes(-15),
ExpiresOn = DateTimeOffset.UtcNow.AddHours(2)
};
// INSERT CODE HERE
BlobSasQueryParameters sasParams = builder.ToSasQueryParameters(delegationKey, accountName);
return $"{client.Uri}{containerName}?{sasParams}";
}
Which code segment should you insert to complete the method and meet the requirements?
builder.Protocol = SasProtocol.Https;
builder.IPRange = IPAddressRange.Parse("198.51.100.0/24");
builder.Protocol = SasProtocol.HttpsAndHttp;
builder.IPRange = IPAddressRange.Parse("198.51.100.0/24");
builder.Protocol = SasProtocol.Https;
builder.IPRange = IPAddressRange.Parse("198.51.100.0/24");
builder.Protocol = SasProtocol.Https;
builder.IPRange = IPAddressRange.Parse("198.51.100.0/24");
You are designing a security architecture for three Azure Function apps that must retrieve database connection secrets from a single Azure Key Vault. The solution must use managed identities, minimize administrative overhead, and grant only the minimum permissions required to read the secrets.
Which two configuration steps should you perform?
Select all that apply
You are developing a C# daemon application that runs on an Azure Virtual Machine. The application must automate the renewal of an Azure Key Vault certificate named 'ssl-cert' which is issued by a non-integrated internal Certificate Authority (CA).
The application must run under a user-assigned managed identity named 'app-identity'. The renewal workflow requires:
1. Retrieving the pending Certificate Signing Request (CSR) generated by Key Vault.
2. Submitting the CSR to the CA and receiving the signed certificate.
3. Merging the signed certificate back into Key Vault to complete the process.
You need to configure the required permissions and implement the code using the Azure.Security.KeyVault.Certificates library.
Which of the following configurations and code segments should you implement?
var client = new CertificateClient(new Uri("https://vault.vault.azure.net/"), new DefaultAzureCredential());
CertificateOperation operation = await client.GetCertificateOperationAsync("ssl-cert");
byte[] csr = operation.Csr;
// Submit to CA and receive signedCertBytes
await client.MergeCertificateAsync(new MergeCertificateOptions("ssl-cert", new[] { signedCertBytes }));
var client = new CertificateClient(new Uri("https://vault.vault.azure.net/"), new DefaultAzureCredential());
CertificateOperation operation = await client.GetCertificateOperationAsync("ssl-cert");
byte[] csr = operation.Csr;
// Submit to CA and receive signedCertBytes
await client.MergeCertificateAsync(new MergeCertificateOptions("ssl-cert", new[] { signedCertBytes }));
var client = new CertificateClient(new Uri("https://vault.vault.azure.net/"), new DefaultAzureCredential());
CertificateOperation operation = await client.GetCertificateOperationAsync("ssl-cert");
byte[] csr = operation.Csr;
// Submit to CA and receive signedCertBytes
await client.MergeCertificateAsync(new MergeCertificateOptions("ssl-cert", new[] { signedCertBytes }));
var client = new CertificateClient(new Uri("https://vault.vault.azure.net/"), new DefaultAzureCredential());
CertificateOperation operation = await client.GetCertificateOperationAsync("ssl-cert");
byte[] csr = operation.Csr;
// Submit to CA and receive signedCertBytes
await client.MergeCertificateAsync(new MergeCertificateOptions("ssl-cert", new[] { signedCertBytes }));
An organization is implementing a client-side Single Page Application (SPA) named ClientConnect. The application must authenticate users using Microsoft Entra ID and access a secure downstream web API named DataAPI on behalf of the signed-in user. The DataAPI exposes a custom scope named Data.Write.
You register both ClientConnect and DataAPI in Microsoft Entra ID.
Which two configuration steps should you perform in Microsoft Entra ID to implement the required permissions and consent? Select two.
Select all that apply
You are developing a native mobile application named FleetApp that allows delivery drivers to view their own calendar events from Microsoft Graph and upload telemetry data to a custom backend web API named RouteAPI. You register RouteAPI in Microsoft Entra ID and expose a custom scope named Telemetry.Write.
You register FleetApp in Microsoft Entra ID. The application must perform all actions on behalf of the signed-in driver, allow drivers to consent to permissions themselves, and adhere to the principle of least privilege.
Which permissions should you configure for the FleetApp registration?
You are deploying a Node.js microservice to an Azure Kubernetes Service (AKS) cluster. The microservice uses a user-assigned managed identity named `mi-node-app` via workload identity.
The microservice must load configuration settings from an Azure App Configuration store named `appconfig-prod`. The store contains several configurations, including Key Vault references pointing to database credentials in an Azure Key Vault named `kv-prod`.
You need to configure the minimum required role assignments to allow the microservice to successfully fetch all configurations and resolve the Key Vault references.
Which two actions should you perform? Select two.
Select all that apply
A secure C# Web API is hosted on an Azure App Service instance that has a system-assigned managed identity enabled. The Web API needs to retrieve a database connection string stored as a secret in an Azure Key Vault named kv-prod. The Key Vault is configured to use the Azure role-based access control (Azure RBAC) permission model. During testing, the Web API receives a 403 Forbidden error when attempting to retrieve the secret. You need to resolve the authorization issue while adhering to the principle of least privilege. What should you do?
You are configuring a secure ASP.NET Core web application hosted in an Azure App Service to load configuration settings from an Azure App Configuration store. The configuration store contains key-values that reference secrets stored in an Azure Key Vault. You want to use a system-assigned managed identity to authenticate and authorize all access between these resources without storing credentials. In which order should you perform the steps to configure the security and connection between these services?
Drag items to arrange them in the correct order
A development team is configuring a new collaboration portal registered in Microsoft Entra ID. The portal must allow users from any corporate or academic Microsoft Entra ID tenant to authenticate, while strictly blocking personal Microsoft Accounts (such as Xbox, Skype, or Outlook.com accounts).
Which combination of application manifest settings and token authority endpoints should the team implement?
You are deploying a C# background service as an Azure Function App named func-processor-prod. The application must securely retrieve a connection string from an Azure Key Vault named kv-prod using a user-assigned managed identity named id-processor-prod. The resource ID of the user-assigned identity is /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id-processor-prod.
You have already assigned the managed identity to the Function App and granted it the Key Vault Secrets User role on the Key Vault. You need to configure the Function App's application settings to resolve the database secret.
Which configuration steps and reference syntax must you use?
You are developing a multi-tenant web application that will be registered in Microsoft Entra ID. The application must allow authentication for users with work or school accounts from any Microsoft Entra ID tenant, as well as users with personal Microsoft accounts (such as Outlook.com or Xbox Live accounts).
Which two configurations must you implement in the application registration and code? (Select two.)
Select all that apply
A developer is configuring a multi-tenant web application in Microsoft Entra ID. The application manifest has the signInAudience parameter configured as AzureADMultipleOrgs. The developer wants to configure the authentication middleware in the application to redirect users to the correct Microsoft identity platform endpoint so that users from any organizational tenant can sign in, but personal Microsoft accounts (such as Xbox or Outlook accounts) are excluded. Which authority URL should the developer configure for the authentication endpoint?
You are configuring a multi-tenant web application registration in Microsoft Entra ID. The application must allow users from any organizational Microsoft Entra ID tenant to sign in, but it must explicitly block users signing in with personal Microsoft accounts (such as outlook.com or hotmail.com). Which two configurations should you implement to satisfy this requirement? (Select two)
Select all that apply
An independent software vendor (ISV) is registering a new multi-tenant line-of-business application in Microsoft Entra ID. The application is designed to allow employees from any enterprise customer to log in with their work credentials, but it must reject sign-in attempts from personal Microsoft accounts.
Which configuration should the developer apply to the application manifest and the application's authentication endpoint?
You are deploying an ASP.NET Core web application to an Azure App Service. The application must securely retrieve a database password stored as a secret in Azure Key Vault. You decide to use a system-assigned managed identity and Key Vault references to configure the application.
Which sequence of steps should you perform to configure the Azure resources and the App Service to resolve the secret?
Drag items to arrange them in the correct order
An application named App1 needs to be configured in Microsoft Entra ID. The application will be consumed by multiple external business partners who use their own corporate Entra ID directories, alongside external consultants who will sign in using their personal Microsoft accounts.
Which two configurations are required to support this authentication requirement? (Select two.)
Select all that apply
A developer is deploying a Go-based web application to Azure App Service. The application must retrieve a database connection string stored in an Azure Key Vault named `kv-prod-westus`. A system-assigned managed identity is enabled for the App Service.
You configure an application setting in the App Service with the key `DbConnectionString` and the value `@Microsoft.KeyVault(VaultName=kv-prod-westus;SecretName=DbConnectionString)`.
During testing, the application fails to retrieve the secret value and instead reads the raw reference string.
Which of the following is the most likely cause of this issue?