Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unit solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear if the review screen.
You use an Azure Pipelines pipeline to build and release web apps.
You need to configure the pipeline to meet the following requirements:
* Only run when there is a change in the /webapp folder.
* Only run when a pr is created.
Solution: You configure the pipeline definition by using the following elements.
Does this meet the goal?
Correct : A
Start a Discussions
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unit solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear if the review screen.
You use an Azure Pipelines pipeline to build and release web apps.
You need to configure the pipeline to meet the following requirements:
* Only run when there is a change in the /webapp folder.
* Only run when a pr is created.
Solution: You configure the pipeline definition by using the following elements.
Does this meet the goal?
Correct : B
Start a Discussions
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You need to use an Azure Pipelines pipeline to build and test an app and test the database of the app. The solution must meet the following requirements.
* The test stages must be run in parallel.
* The Publish_Test_Results stage must always be run.
* The test stages must be run after successful completion of the build stage.
* The PubHsh_Test_ftesuHs stage must be run after completion of all the test stages.
Solution: You include the following elements in the YAML definition of the pipeline.
Does this meet the goal?
Correct : B
Topic 5, Labs & Tasks
Start a Discussions
SIMULATION
Task 1
You need to ensure that an Azure Web App named az400-38443478-main can retrieve secrets from an Azure key vault named az400-3844J478-kv1 by using a system managed identity The solution must use the principle of least privilege.
Correct : A
To ensure that your Azure Web App named az400-38443478-main can retrieve secrets from an Azure Key Vault named az400-3844J478-kv1 using a system managed identity with the principle of least privilege, follow these detailed steps:
Enable a System Managed Identity for the Azure Web App:
Navigate to the Azure Portal.
Go to the Azure Web App az400-38443478-main.
Select Identity under the Settings section.
In the System assigned tab, switch the Status to On.
Click Save to apply the changes.
Grant the Web App Access to the Key Vault:
Go to the Azure Key Vault az400-3844J478-kv1.
Select Access policies under the Settings section.
Click on Add Access Policy.
Choose Secret permissions and select Get and List. This grants the app the ability to read secrets, adhering to the principle of least privilege.
Click on Select principal, search for your Web App name az400-38443478-main, and select it.
Click Add to add the policy.
Don't forget to click Save to save the access policy changes.
Retrieve Secrets in the Web App Code:
In your Web App's code, use the Azure SDK to retrieve the secrets.
For example, in a .NET application, you can use the Azure.Identity and Azure.Security.KeyVault.Secrets namespaces.
Utilize the DefaultAzureCredential class which will automatically use the system managed identity when running on Azure.
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
var client = new SecretClient(new Uri('https://az400-3844J478-kv1.vault.azure.net/'), new DefaultAzureCredential());
KeyVaultSecret secret = await client.GetSecretAsync('my-secret-name');
string secretValue = secret.Value;
Replace 'my-secret-name' with the actual name of the secret you want to retrieve.
By following these steps, your Azure Web App will be able to securely retrieve secrets from the Azure Key Vault using a system managed identity, without needing to store credentials in the code, and adhering to the principle of least privilege. Remember to replace the placeholder names with the actual names of your Web App and Key Vault.
Start a Discussions
SIMULATION
Task 2
You need to create an instance of Azure Application Insights named az400-38443478-main and configure the instance to receive telemetry data from an Azure web app named az400-38443478-main
You must create a Log Analytics workspace before this task.
Correct : A
To create an instance of Azure Application Insights named az400-38443478-main and configure it to receive telemetry data from an Azure web app with the same name, you'll need to follow these steps:
Create a Log Analytics Workspace:
Go to the Azure Portal.
Search for Log Analytics Workspaces and select Add.
Select a Subscription and either use an existing Resource Group or create a new one.
Provide a unique name for your Log Analytics workspace.
Choose the Region that is appropriate for you.
Review the settings and then select Create1.
Create an Azure Application Insights Instance:
In the Azure Portal, navigate to Application Insights.
Click on + Create.
Fill in the instance details, ensuring the name is az400-38443478-main.
Link the instance to the Log Analytics workspace you created in the previous step.
Review and create the Application Insights instance2.
Configure the Azure Web App to Send Telemetry Data:
Go to the Azure Web App az400-38443478-main.
Under Monitoring, select Application Insights.
Choose to use an existing resource and select the Application Insights instance you created.
Follow the prompts to set up the connection, which may involve adding the appropriate SDK to your web app and configuring the connection string or instrumentation key.
Verify Telemetry Data Reception:
After setting up, send some test traffic to your web app.
Then, go to the Application Insights instance and check the Overview or Performance sections to see if telemetry data is being received.
Remember to replace placeholder names with the actual names of your resources where necessary. These steps will help you set up Azure Application Insights to monitor your web app effectively.
Start a Discussions