Topic 4: Mix Questions Set
You plan to provision a self-hosted Linux agent Which authentication mechanism should you use to register the self-hosted agent?
A. SSH key
B. personal access token (PAT)
C. Alternate credentials
D. certificate
Note: PAT Supported only on Azure Pipelines and TFS 2017 and newer. After you choose PAT, paste the PAT token you created into the command prompt window. Use a personal access token (PAT) if your Azure DevOps Server or TFS instance and the agent machine are not in a trusted domain. PAT authentication is handled by your Azure DevOps Server or TFS instance instead of the domain controller.
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.
Answer: See the solution below in explanation.
Explanation:
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: uk.co.certification.simulator.questionpool.PList@15f68600 Grant the Web App Access to the Key Vault:
Retrieve Secrets in the Web App Code:
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.
You use GitHub for source control and project-related discussions. You receive a notification when an entry is made to any team discussion. You need to ensure that you receive email notifications only for discussions in which you commented or in which you are mentioned. Which two Notifications settings should you clear? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
A. Participating
B. Automatically watch repositories
C. Automatically watch teams
D. Watching
Task 6
You have an Azure function hosted in an App Service plan named az400-38443478-funct
You need to configure az400 38443478-funcl lo update the functions automatically whenever new code is committed to the main branch of https://githubcom/Azure- Samples/functions-quickstart.
NOTE: Access to GitHub is blocked in the exam environment. Access to GitHub is NOT required to complete the task successfully.
Answer: See the solution below in explanation.
Explanation:
To configure your Azure Function az400-38443478-funct to automatically update whenever new code is committed to the main branch of the specified GitHub repository, you can use GitHub Actions for continuous deployment. Here’s how to set it up:
Create a GitHub Actions Workflow:
uk.co.certification.simulator.questionpool.PList@4179b6fc Define the Workflow:
Generate Deployment Credentials:
Store the Publish Profile as a GitHub Secret:
Configure the Workflow to Use the Secret: Here’s a sample GitHub Actions workflow snippet:
name: Deploy Azure Function
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest steps:
- uses: actions/checkout@v2
- name: Set up Python version uses: actions/setup-python@v2 with:
python-version: '3.x'
- name: Install dependencies run: |
pip install -r requirements.txt
- name: Deploy to Azure Functions uses: Azure/functions-action@v1 with:
app-name: az400-38443478-funct
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} package: .
Replace the app-name with the name of your Azure Function App and ensure the Python version and dependencies match your application’s requirements.
By following these steps, your Azure Function will automatically update whenever new code is pushed to the main branch of the GitHub repository. This setup minimizes manual effort and ensures that your function app is always running the latest code.
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 recommend an integration strategy for the build process of a Java application.
The solution must meet the following requirements:
A. Yes
B. No
Explanation: To build and deploy Windows, Azure, and other Visual Studio solutions you'll need at least one Windows agent. Windows agents can also build Java and Android apps. The Azure Pipelines agent pool offers several virtual machine images to choose from, each including a broad range of tools and software. One such image is Windows Server 2019 with Visual Studio 2019.
Page 25 out of 98 Pages |
Previous |