AZ-204 Practice Test Questions

271 Questions


Topic 4, Misc. Questions

You develop a serverless application using several Azure Functions. These functions
connect to data from within the code.
You want to configure tracing for an Azure Function App project.
You need to change configuration settings in the hostjson file.
Which tool should you use?


A.

Azure portal


B.

Azure PowerShell


C.

Azure Functions Core Tools (Azure CLI)


D.

Visual Studio





A.
  

Azure portal



Explanation:
The function editor built into the Azure portal lets you update the function.json file and the
code file for a function. The host.json file, which contains some runtime-specific
configurations, is in the root folder of the function app.References:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference#fileupdate

You are developing a .NET Core MVC application for customers to research hotels. The
application will use Azure Search. The application will search the index by using various
criteria to locate documents related to hotels. The index will include search fields for rate, a
list of amenities, and distance to the nearest airport.
The application must support the following scenarios for specifying search criteria and
organizing results:
• Search the index by using regular expressions.
• Organize results by counts for name-value pairs.
• List hotels within a specified distance to an airport and that fall within a specific price
range.
You need to configure the SearchParameters class.
Which properties should you configure? To answer, select the appropriate options in the
answer area.
NOTE Each correct selection is worth one point.

 






Box 1: QueryType
The SearchParameters.QueryType Property gets or sets a value that specifies the syntax
of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query
syntax.
You can write queries against Azure Search based on the rich Lucene Query Parser syntax
for specialized query forms: wildcard, fuzzy search, proximity search, regular expressions
are a few examples.
Box 2: Facets

The facets property gets or sets the list of facet expressions to apply to the search query.
Each facet expression contains a field name, optionally followed by a comma-separated list
of name:value pairs.
Box 3: Filter
The Filter property gets or sets the OData $filter expression to apply to the search query.
References:
https://docs.microsoft.com/enus/
dotnet/api/microsoft.azure.search.models.searchparameters
https://docs.microsoft.com/en-us/azure/search/query-lucene-syntax
https://docs.microsoft.com/enus/
dotnet/api/microsoft.azure.search.models.searchparameters.querytype

You are developing an application that uses Azure Storage Queues.
You have the following code:






You are developing Azure WebJobs.
You need to recommend a WebJob type for each scenario.
Which WebJob type should you recommend? To answer, drag the appropriate WebJob
types to the correct scenarios. Each WebJob type 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.






 

You are developing a web app that is protected by Azure Web Application Firewall (WAF).
All traffic to the web app is routed through an Azure Application Gateway instance that is
used by multiple web apps. The web app address is contoso.azurewebsites.net.
All traffic must be secured with SSL. The Azure Application Gateway instance is used by
multiple web apps.
You need to configure the Azure Application Gateway for the app.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.


A.

In the Azure Application Gateway’s HTTP setting, enable the Use for App service
setting.


B.

Convert the web app to run in an Azure App service environment (ASE).


C.

Add an authentication certificate for contoso.azurewebsites.net to the Azure Application
gateway.


D.

In the Azure Application Gateway’s HTTP setting, set the value of the Override backend
path option to contoso22.azurewebsites.net.





A.
  

In the Azure Application Gateway’s HTTP setting, enable the Use for App service
setting.



D.
  

In the Azure Application Gateway’s HTTP setting, set the value of the Override backend
path option to contoso22.azurewebsites.net.



Explanation:
D: The ability to specify a host override is defined in the HTTP settings and can be applied
to any back-end pool during rule creation.
The ability to derive the host name from the IP or FQDN of the back-end pool members.
HTTP settings also provide an option to dynamically pick the host name from a back-end
pool member's FQDN if configured with the option to derive host name from an individual
back-end pool member.
A (not C): SSL termination and end to end SSL with multi-tenant services.
In case of end to end SSL, trusted Azure services such as Azure App service web apps do
not require whitelisting the backends in the application gateway. Therefore, there is no

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 are developing an Azure Service application that processes queue data when it
receives a message from a mobile application. Messages may not be sent to the service
consistently.
You have the following requirements:
Queue size must not grow larger than 80 gigabytes (GB).
Use first-in-first-out (FIFO) ordering of messages.
Minimize Azure costs.
You need to implement the messaging solution.
Solution: Use the .Net API to add a message to an Azure Storage Queue from the mobile
application. Create an Azure Function App that uses an Azure Storage Queue trigger.
Does the solution meet the goal?


A.

Yes


B.

No





B.
  

No



Explanation:
Create an Azure Function App that uses an Azure Service Bus Queue trigger.
Reference:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-queuetriggered-
function

You are implementing a software as a service (SaaS) ASP.NET Core web service that will
run as an Azure Web App. The web service will use an on-premises SQL Server database
for storage. The web service also includes a WebJob that processes data updates. Four
customers will use the web service.
•Each instance of the WebJob processes data for a single customer and must run as a
singleton instance.
•Each deployment must be tested by using deployment slots prior to serving production
data.
•Azure costs must be minimized.
•Azure resources must be located in an isolated network.
You need to configure the App Service plan for the Web App.
How should you configure the App Service plan? To answer, select the appropriate settings
in the answer area.

NOTE: Each correct selection is worth one point.






Number of VM instances: 4
You are not charged extra for deployment slots.
Pricing tier: Isolated
The App Service Environment (ASE) is a powerful feature offering of the Azure App
Service that gives network isolation and improved scale capabilities. It is essentially a
deployment of the Azure App Service into a subnet of a customer’s Azure Virtual Network
(VNet).
References:
https://azure.microsoft.com/sv-se/blog/announcing-app-service-isolated-more-power-scaleand-
ease-of-use/

You are developing a software solution for an autonomous transportation system. The
solution uses large data sets and Azure Batch processing to simulate navigation sets for entire fleets of vehicles.
You need to create compute nodes for the solution on Azure Batch.
What should you do?


A.

In the Azure portal, create a Batch account.


B.

In a .NET method, call the method: BatchClient.PoolOperations.CreatePool


C.

In Python, implement the class: JobAddParameter


D.

In Python, implement the class: TaskAddParameter





B.
  

In a .NET method, call the method: BatchClient.PoolOperations.CreatePool



A Batch job is a logical grouping of one or more tasks. A job includes settings common to
the tasks, such as priority and the pool to run tasks on. The app uses the
BatchClient.JobOperations.CreateJob method to create a job on your pool.

A company develops a series of mobile games. All games use a single leaderboard
service.
You have the following requirements:
•Code should be scalable and allow for growth.
•Each record must consist of a playedId, gameId, score, and time played.
•When users reach a new high score, the system will save the new score using the
SaveScore function below.
•Each game is assigned and Id based on the series title.
You have the following code. (Line numbers are included for reference only.)
You store customer information in an Azure Cosmos database. The following data already
exists in the database:






Box 1: Yes
Code for CosmosDB, example:
// Parse the connection string and return a reference to the storage account.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the table client.
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// Retrieve a reference to the table.
CloudTable table = tableClient.GetTableReference("people");
// Create the TableOperation object that inserts the customer entity.
TableOperation insertOperation = TableOperation.Insert(customer1);
Box 2: No
A new record will always be added as TableOperation.Insert is used, instead of
TableOperation.InsertOrReplace.
Box 3: No
No partition key is used.
Box 4: Yes
References:
https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-dotnet

You are configuring a development environment for your team. You deploy the latest Visual
Studio image from the Azure Marketplace to your Azure subscription.
The development environment requires several software development kits (SDKs) and
third-party components to support application development across the organization. You
install and customize the deployed virtual machine (VM) for your development team. The customized VM must be saved to allow provisioning of a new team member development
environment.
You need to save the customized VM for future provisioning.
Which tools or services should you use? To answer, select the appropriate options in the
answer area.
NOTE: Each correct selection is worth one point.






Box 1: Azure Powershell
Creating an image directly from the VM ensures that the image includes all of the disks
associated with the VM, including the OS disk and any data disks.
Before you begin, make sure that you have the latest version of the Azure PowerShell
module.
You use Sysprep to generalize the virtual machine, then use Azure PowerShell to create
the image.
Box 2: Azure Blob Storage
References:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-imageresource#
create-an-image-of-a-vm-using-powershell

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 the Reader role-based access control (RBAC) role to authenticate the VM
with Azure Resource Manager.
Does the solution meet the goal?

 


A.

Yes


B.

No





B.
  

No



Contoso, Ltd. provides an API to customers by using Azure API Management (APIM). The
API authorizes users with a JWT token.

You must implement response caching for the APIM gateway. The caching mechanism
must detect the user ID of the client that accesses data for a given location and cache the
response for that user ID.
You need to add the following policies to the policies file:
• a set-variable policy to store the detected user identity
• a cache-lookup-value policy
• a cache-store-value policy
• a find-and-replace policy to update the response body with the user profile information
To which policy section should you add the policies? To answer, drag the appropriate
sections to the correct policies. Each section 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






C:\Users\wk\Desktop\mudassar\Untitled.jpg
Box 1: Inbound.
A set-variable policy to store the detected user identity.
Example:
<policies>
<inbound>
<!- How you determine user identity is application dependent ->
<set-variable
name="enduserid"
value="@(context.Request.Headers.GetValueOrDefault("Authorization","").Split('
')[1].AsJwt()?.Subject)" />
Box 2: Inbound
A cache-lookup-value policy
Example:
<inbound>
<base />
<cache-lookup vary-by-developer="true | false" vary-by-developer-groups="true | false"
downstream-caching-type="none | private | public" must-revalidate="true | false">
<vary-by-query-parameter>parameter name</vary-by-query-parameter> <!- optional, can
repeated several times ->
</cache-lookup>
</inbound>

Box 3: Outbound
A cache-store-value policy.
Example:
<outbound>
<base />
<cache-store duration="3600" />
</outbound>
Box 4: Outbound
A find-and-replace policy to update the response body with the user profile information.
Example:
<outbound>
<!- Update response body with user profile->
<find-and-replace
from='"$userprofile$"'
to="@((string)context.Variables["userprofile"])" />
<base />
</outbound>


Page 7 out of 23 Pages
Previous