AZ-204 Practice Test Questions

271 Questions


Topic 4, Misc. Questions

You manage several existing Logic Apps.
You need to change definitions, add new logic, and optimize these apps on a regular basis.
What should you use? To answer, drag the appropriate tools to the correct functionalities.
Each tool may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.






Box 1: Enterprise Integration Pack
After you create an integration account that has partners and agreements, you are ready to
create a business to business (B2B) workflow for your logic app with the Enterprise Integration Pack.
Box 2: Code View Editor
To work with logic app definitions in JSON, open the Code View editor when working in the
Azure portal or in Visual Studio, or copy the definition into any editor that you want.
Box 3: Logical Apps Designer
You can build your logic apps visually with the Logic Apps Designer, which is available in
the Azure portal through your browser and in Visual Studio.
References:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-b2b
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-author-definitions
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-overview

You are developing an ASP.NET Core Web API web service that uses Azure Application
Insights to monitor performance and track events.
You need to enable logging and ensure that log messages can be correlated to events
tracked by Application Insights.
How should you complete the code? To answer, drag the appropriate code segments to
the correct locations. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.






Box 1: ApplicationInsightsLoggerOptions
If you want to include the EventId and EventName properties, then add the following to the
ConfigureServices method:
services
AddOptions<ApplicationInsightsLoggerOptions>()
Configure(o => o.IncludeEventId = true);
Box 2: IncludeEventID

Box 3: ApplicationServices
In Asp.Net core apps it turns out that trace logs do not show up in Application Insights out
of the box. We need to add the following code snippet to our Configure method in
Startup.cs:
loggerFactory.AddApplicationInsights(app.ApplicationServices, logLevel);
References:
https://blog.computedcloud.com/enabling-application-insights-trace-logging-in-asp-netcore/

You develop a gateway solution for a public facing news API.
The news API back end is implemented as a RESTful sen/ice and hosted in an Azure App
Service instance.
You need to configure back-end authentication for the API Management service instance.
Which target and gateway credential type should you use? To answer, drag the appropriate
values to the correct parameters. Each value may be used once, more than once, or not at
all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.






Box 1: Azure Resource
Box 2: Client cert
API Management allows to secure access to the back-end service of an API using client
certificates.
References:
https://docs.microsoft.com/en-us/rest/api/apimanagement/apimanagementrest/azure-apimanagement-
rest-api-backend-entity

You develop an app that allows users to upload photos and videos to Azure storage. The
app uses a storage REST API call to upload the media to a blob storage account named
Account1. You have blob storage containers named Container1 and Container2.
Uploading of videos occurs on an irregular basis.
You need to copy specific blobs from Container1 to Container2 when a new video is
uploaded.
What should you do?


A.

Copy blobs to Container2 by using the Put Blob operation of the Blob Service REST
API


B.

Create an Event Grid topic that uses the Start-AzureStorageBlobCopy cmdlet


C.

Use AzCopy with the Snapshot switch to copy blobs to Container2


D.

Download the blob to a virtual machine and then upload the blob to Container2





B.
  

Create an Event Grid topic that uses the Start-AzureStorageBlobCopy cmdlet



Explanation:
The Start-AzureStorageBlobCopy cmdlet starts to copy a blob.
Example 1: Copy a named blob
C:\PS>Start-AzureStorageBlobCopy -SrcBlob "ContosoPlanning2015" -DestContainer
"ContosoArchives" -SrcContainer "ContosoUploads"
This command starts the copy operation of the blob named ContosoPlanning2015 from the
container named ContosoUploads to the container named ContosoArchives.
Reference:https://docs.microsoft.com/en-us/powershell/module/azure.storage/startazurestorageblobcopy?
view=azurermps-6.13.0

A company is developing a solution that allows smart refrigerators to send temperature
information to a central location. You have an existing Service Bus.
The solution must receive and store messages until they can be processed. You create an
Azure Service Bus instance by providing a name, pricing tier, subscription, resource group,
and location.
You need to complete the configuration.
Which Azure CLI or PowerShell command should you run?



A.

Option A


B.

Option B


C.

Option C


D.

Option D





B.
  

Option B



A service bus instance has already been created (Step 2 below). Next is step 3, Create a
Service Bus queue.
Note:
Steps:
Step 1: # Create a resource group
resourceGroupName="myResourceGroup"
az group create -name $resourceGroupName -location eastus
Step 2: # Create a Service Bus messaging namespace with a unique name
namespaceName=myNameSpace$RANDOM
az servicebus namespace create -resource-group $resourceGroupName -name
$namespaceName -location eastus
Step 3: # Create a Service Bus queue
az servicebus queue create -resource-group $resourceGroupName -namespace-name
$namespaceName -name BasicQueue
Step 4: # Get the connection string for the namespace
connectionString=$(az servicebus namespace authorization-rule keys list -resource-group
$resourceGroupName -namespace-name $namespaceName -name
RootManageSharedAccessKey -query primaryConnectionString -output tsv)
References:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-cli

You are developing an Azure Cosmos DB solution by using the Azure Cosmos DB SQL
API. The data includes millions of documents. Each document may contain hundreds of
properties.
The properties of the documents do not contain distinct values for partitioning. Azure
Cosmos DB must scale individual containers in the database to meet the performance
needs of the application by spreading the workload evenly across all partitions over time.
You need to select a partition key.
Which two partition keys can you use? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.


A.

a concatenation of multiple property values with a random suffix appended


B.

a single property value that does not appear frequently in the documents


C.

a hash suffix appended to a property value


D.

a value containing the collection name


E.

a single property value that appears frequently in the documents





A.
  

a concatenation of multiple property values with a random suffix appended



C.
  

a hash suffix appended to a property value



You can form a partition key by concatenating multiple property values into a single artificial
partitionKey property. These keys are referred to as synthetic keys.
Another possible strategy to distribute the workload more evenly is to append a random
number at the end of the partition key value. When you distribute items in this way, you can
perform parallel write operations across partitions.
Note: It's the best practice to have a partition key with many distinct values, such as
hundreds or thousands. The goal is to distribute your data and workload evenly across the
items associated with these partition key values. If such a property doesn’t exist in your
data, you can construct a synthetic partition key.
References:
https://docs.microsoft.com/en-us/azure/cosmos-db/synthetic-partition-keys

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 develop Azure solutions.
You must grant a virtual machine (VM) access to specific resource groups in Azure
Resource Manager.
You need to obtain an Azure Resource Manager access token.
Solution: Run the Invoke-RestMethod cmdlet to make a request to the local managed
identity for Azure resources endpoint.
Does the solution meet the goal?


A.

Yes


B.

No





A.
  

Yes



Get an access token using the VM's system-assigned managed identity and use it to call
Azure Resource Manager
You will need to use PowerShell in this portion.
In the portal, navigate to Virtual Machines and go to your Windows virtual machine
and in the Overview, click Connect.
Enter in your Username and Password for which you added when you created the
Windows VM.
Now that you have created a Remote Desktop Connection with the virtual
machine, open PowerShell in the remote session.
Using the Invoke-WebRequest cmdlet, make a request to the local managed
identity for Azure resources endpoint to get an access token for Azure Resource
Manager.
Example:
$response = Invoke-WebRequest -Uri
'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-
01&resource=https://management.azure.com/' -Method GET -Headers @{Metadata="true"}
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure- resources/tutorial-windows-vm-access-arm

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 develop Azure solutions.
You must grant a virtual machine (VM) access to specific resource groups in Azure
Resource Manager.
You need to obtain an Azure Resource Manager access token.
Solution: Use an X.509 certificate to authenticate the VM with Azure Resource Manager.
Does the solution meet the goal?


A.

Yes


B.

No





B.
  

No



Instead run the Invoke-RestMethod cmdlet to make a request to the local managed identity
for Azure resources endpoint.
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-

You are developing a medical records document management website. The website is
used to store scanned copies of patient intake forms. If the stored intake forms are
downloaded from storage by a third party, the content of the forms must not be
compromised.
You need to store the intake forms according to the requirements.
Solution: Store the intake forms as Azure Key Vault secrets.
Does the solution meet the goal?


A.

Yes


B.

No





B.
  

No



You are developing an ASP.NET Core Web API web service. The web service uses Azure
Application Insights for all telemetry and dependency tracking. The web service reads and
writes data to a database other than Microsoft SQL Server.
You need to ensure that dependency tracking works for calls to the third-party database.
Which two Dependency Telemetry properties should you store in the database? Each
correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.


A.

Telemetry.Context.Operation.Id


B.

Tetemetry.Context.Cloud.Rolelnstance


C.

Telemetry.Id


D.

Telemetry.ContextSession.Id


E.

Telemetry.Name





A.
  

Telemetry.Context.Operation.Id



C.
  

Telemetry.Id



Explanation:
References:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-operations-tracking
Example:
public async Task Enqueue(string payload)
{
// StartOperation is a helper method that initializes the telemetry item
// and allows correlation of this operation with its parent and children.
var operation = telemetryClient.StartOperation<DependencyTelemetry>("enqueue " +
queueName);
operation.Telemetry.Type = "Azure Service Bus";
operation.Telemetry.Data = "Enqueue " + queueName;
var message = new BrokeredMessage(payload);
// Service Bus queue allows the property bag to pass along with the message.
// We will use them to pass our correlation identifiers (and other context)
// to the consumer.
message.Properties.Add("ParentId", operation.Telemetry.Id);
message.Properties.Add("RootId", operation.Telemetry.Context.Operation.Id);
Reference:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-operations-tracking

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.
Margie's Travel is an international travel and bookings management service. The companyis expanding into restaurant bookings. You are tasked with implementing Azure Search tor
the restaurants listed in their solution.
You create the index in Azure Search.
You need to import the restaurant data into the Azure Search service by using the Azure
Search NET SDK.
Solution:
1. Create a SearchServiceClient object to connect to the search index.
2. Create a DataContainer that contains the documents which must be added.
3. Create a DataSource instance and set its Container property to the DataContainer.
4. Set the DataSource property of the SearchServiceCIient
Does the solution meet the goal?


A.

Yes


B.

No





B.
  

No



Explanation:
Use the following method:
1.Create a SearchIndexClient object to connect to the search index
2.Create an IndexBatch that contains the documents which must be added.
3.Call the Documents.Index method of the SearchIndexClient and pass the IndexBatch.
References:
https://docs.microsoft.com/en-us/azure/search/search-howto-dotnet-sdk

You are developing an ASP.NET Core website that can be used to manage photographs
which are stored in Azure Blob Storage containers.
Users of the website authenticate by using their Azure Active Directory (Azure AD)
credentials.
You implement role-based access control (RBAC) role permission on the containers that
store photographs. You assign users to RBAC role.
You need to configure the website’s Azure AD Application so that user’s permissions can
be used with the Azure Blob containers.
How should you configure the application? To answer, drag the appropriate setting to the
correct location. Each setting may be used once, more than once, or not at all. You may
need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.







Page 4 out of 23 Pages
Previous