You are developing a local console application that runs on an on-premises developer workstation. The application must periodically upload application diagnostic logs to a specific container in an Azure Storage account. You plan to configure the application to authenticate using a Microsoft Entra ID service principal with a client secret, adhering to the principle of least privilege.
Which sequence of steps should you perform to configure the identity, permissions, and application code?
- 1Register the application in Microsoft Entra ID to establish its application object and automatically create its home tenant service principal.
- 2Generate a new client secret under the Certificates & secrets configuration of the registered application.
- 3Assign the Storage Blob Data Contributor role to the application's service principal at the scope of the target blob container.
- 4Configure the console application code to instantiate a ClientSecretCredential using the application ID, tenant ID, and client secret to access the blob container.
Answer
First register the application in Microsoft Entra ID, then generate a new client secret under Certificates & secrets, next assign the Storage Blob Data Contributor role to the service principal at the scope of the storage container, and finally configure the application code to use the ClientSecretCredential.
The correct sequence begins with registering the application in Microsoft Entra ID to create the security principal. Next, a client secret is generated to authenticate this registration. Then, the service principal is granted the Storage Blob Data Contributor role at the container scope to ensure proper authorization. Finally, the developer instantiates a ClientSecretCredential in code to perform authentication.
Step-by-Step Solution
Key Concept
App Registrations, Service Principals, and Client Secrets configuration flow
Estimated Time:1m 30s