Microsoft Developing Microsoft Azure and Web Services (70-487) Free Practice Test
Question 1
You need to update the GetBook() method to retrieve book data by using ADO.NET.
You have the following code:

Which code segments should you include in Target 1, Target 2, Target 3, Target 4 and Target 5 to complete
the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. 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.)

You have the following code:

Which code segments should you include in Target 1, Target 2, Target 3, Target 4 and Target 5 to complete
the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. 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.)

Correct Answer:

Explanation

Question 2
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 a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App
Services. You provision a development environment in the application service.
Developers must be able to deploy the API to the development environment. You must not share the Azure
account credentials with developers.
You need to ensure that developers can deploy the API to the development environment.
Solution: Download the Publish profile for the application service and share it with the developers. Use
Microsoft Visual Studio Publishing.
Does the solution meet the goal?
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 a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App
Services. You provision a development environment in the application service.
Developers must be able to deploy the API to the development environment. You must not share the Azure
account credentials with developers.
You need to ensure that developers can deploy the API to the development environment.
Solution: Download the Publish profile for the application service and share it with the developers. Use
Microsoft Visual Studio Publishing.
Does the solution meet the goal?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
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 a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App
Services. You provision a development environment in the application service.
Developers must be able to deploy the API to the development environment. You must not share the Azure
account credentials with developers.
You need to ensure that developers can deploy the API to the development environment.
Solution: Share the Publish profile for the application service with the developers. Use Web Matrix 2 for
publishing.
Does the solution meet the goal?
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 a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App
Services. You provision a development environment in the application service.
Developers must be able to deploy the API to the development environment. You must not share the Azure
account credentials with developers.
You need to ensure that developers can deploy the API to the development environment.
Solution: Share the Publish profile for the application service with the developers. Use Web Matrix 2 for
publishing.
Does the solution meet the goal?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
You are developing a WCF service.
You need to configure the web.config file to ensure that metadata is exposed only via the MEX protocol.
You have the following markup:

Which XML elements should you include in Target 1, Target 2, Target 3 and Target 4 to complete the
markup? (To answer, drag the appropriate XML elements to the correct targets in the answer area. Each XML
element 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.)

You need to configure the web.config file to ensure that metadata is exposed only via the MEX protocol.
You have the following markup:

Which XML elements should you include in Target 1, Target 2, Target 3 and Target 4 to complete the
markup? (To answer, drag the appropriate XML elements to the correct targets in the answer area. Each XML
element 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.)

Correct Answer:

Explanation

Question 5
You are developing a web application by using Microsoft .NET Framework 4.5.
You are creating a web client for the application. The web client will make REST calls to several web
services.
You need to ensure that the web client meets the following requirements:
* Uses the Task class to perform asynchronous operations
* Reuses recently resolved DNS lookups
Which object should you include in the solution?
You are creating a web client for the application. The web client will make REST calls to several web
services.
You need to ensure that the web client meets the following requirements:
* Uses the Task class to perform asynchronous operations
* Reuses recently resolved DNS lookups
Which object should you include in the solution?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
Errors occasionally occur when saving data using the FlightInfoContext ADO.NET Entity Framework context.
Updates to the data are being lost when an error occurs.
You need to ensure that data is still saved when an error occurs by retrying the operation. No more than five
retries should be performed.
Which code segment should you use as the body of the SaveChanges() method in the FlightInfoContext.es
file?


Updates to the data are being lost when an error occurs.
You need to ensure that data is still saved when an error occurs by retrying the operation. No more than five
retries should be performed.
Which code segment should you use as the body of the SaveChanges() method in the FlightInfoContext.es
file?


Correct Answer: C
Question 7
You need to configure DNS for the Event service.
How many DNS entries should you create?
How many DNS entries should you create?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
You deploy a RESTful ASP.NET Web API to manage order processing.
You are developing an Azure App Services Web App to consume the API and allow customers to order
products. You use the HttpClient object to process order entries. The API throws SocketException errors when
the Web App experiences a high volume of concurrent users.
You need to resolve the errors.
What should you do?
You are developing an Azure App Services Web App to consume the API and allow customers to order
products. You use the HttpClient object to process order entries. The API throws SocketException errors when
the Web App experiences a high volume of concurrent users.
You need to resolve the errors.
What should you do?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
An XML file must be produced by the SaveFeaturedBooks() method of the Book class. The schema of the
resulting XML file must be identical to the FeaturedBooks.xml file.
You need to write the code to produce the file.
You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer,
drag the appropriate code segments to the correct targets in the answer area. 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)

resulting XML file must be identical to the FeaturedBooks.xml file.
You need to write the code to produce the file.
You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer,
drag the appropriate code segments to the correct targets in the answer area. 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)

Correct Answer:

Explanation

Question 10
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 ensure that testing, development, and end user access requirements are met.
Solution: Add Web App backend endpoints to Azure Traffic Manager and use weighted routing.
Does the solution meet the goal?
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 ensure that testing, development, and end user access requirements are met.
Solution: Add Web App backend endpoints to Azure Traffic Manager and use weighted routing.
Does the solution meet the goal?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 11
You are developing a .NET application that uses the HttpClient type to access an ASP.NET Web API
application.
You need to add a header to specify that data is returned as JSON. You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the
appropriate code segments to the correct targets in the answer area. 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)

application.
You need to add a header to specify that data is returned as JSON. You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the
appropriate code segments to the correct targets in the answer area. 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)

Correct Answer:

Explanation

Question 12
You have the following code.

File.xml contains the following XML markup.

You need to write code to display Item1 in the console output.
Which five code blocks should you use? Develop the solution by selecting and arranging the required code
blocks in the correct order.
NOTE: You will need all of the code blocks.


File.xml contains the following XML markup.

You need to write code to display Item1 in the console output.
Which five code blocks should you use? Develop the solution by selecting and arranging the required code
blocks in the correct order.
NOTE: You will need all of the code blocks.

Correct Answer:

Explanation

Question 13
You are developing a web application that uses the Entity Framework.
You plan to use the table-per-type mapping strategy to store the following data.

You need to implement a mapping strategy that will store the data.
How should you complete the code? To answer, drag the appropriate methods to the correct locations. Each
method 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 plan to use the table-per-type mapping strategy to store the following data.

You need to implement a mapping strategy that will store the data.
How should you complete the code? To answer, drag the appropriate methods to the correct locations. Each
method 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.

Correct Answer:

Explanation

Box 1: OnModelCreating
Box 2: Entity
Box 3: ToTable
Mapping an Entity Type to a Specific Table in the Database
Example:
All properties of Department will be mapped to columns in a table called t_ Department.
modelBuilder.Entity<Department>()
ToTable("t_Department");
Box 4: Entity
Box 5: ToTable
Mapping the Table-Per-Type (TPT) Inheritance
In the TPT mapping scenario, all types are mapped to individual tables. Properties that belong solely to a base
type or derived type are stored in a table that maps to that type. Tables that map to derived types also store a
foreign key that joins the derived table with the base table.
modelBuilder.Entity<Course>().ToTable("Course");
modelBuilder.Entity<OnsiteCourse>().ToTable("OnsiteCourse");
References: https://msdn.microsoft.com/en-us/library/jj591617(v=vs.113).aspx
Question 14
You need to update the CreateMonthlyTotalsReports() method to use database transactions.
Which code segment should you use?
Which code segment should you use?
Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 15
You develop a .NET Class Library project. You install the latest NuGet CLI tool, create an account on
nugget.org, and receive an API key.
You need to create the NuGet package and publish the package to nuget.org. You open a command prompt
and navigate to the folder which contains the project file.
Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of
actions to the answer area and arrange them in the correct order.

nugget.org, and receive an API key.
You need to create the NuGet package and publish the package to nuget.org. You open a command prompt
and navigate to the folder which contains the project file.
Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of
actions to the answer area and arrange them in the correct order.

Correct Answer:

Explanation

Step 1: Run the NuGet spec command
In the simple case of creating a package from an assembly, you can generate a .nuspec file from the metadata
in the assembly using the following command:
nuget spec <assembly-name>.dll
Step 2: Update the package identifier and version number
Choose a unique package identifier and setting the version number.
Step 3: Run the NuGet pack command
Running nuget pack to generate the .nupkg file
Step 4: Run theNuGet push command
Once you've created a package, which is a .nupkg file, you can publish it to the gallery of your choice. You
can publish with dotnet nuget push command
References:
https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package
https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package