Free AZ-204 Exam Braindumps (page: 32)

Page 31 of 116

You develop Azure solutions.
You must connect to a No-SQL globally-distributed database by using the .NET API.
You need to create an object to configure and execute requests in the database.
Which code segment should you use?

  1. new Container(EndpointUri, PrimaryKey);
  2. new Database(EndpointUri, PrimaryKey);
  3. new CosmosClient(EndpointUri, PrimaryKey);

Answer(s): C

Explanation:

Example:
// Create a new instance of the Cosmos Client
this.cosmosClient = new CosmosClient(EndpointUri, PrimaryKey)
//ADD THIS PART TO YOUR CODE
await this.CreateDatabaseAsync();


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started



You have an existing Azure storage account that stores large volumes of data across multiple containers.
You need to copy all data from the existing storage account to a new storage account. The copy process must meet the following requirements:
-Automate data movement.
-Minimize user input required to perform the operation.
-Ensure that the data movement process is recoverable.
What should you use?

  1. AzCopy
  2. Azure Storage Explorer
  3. Azure portal
  4. .NET Storage Client Library

Answer(s): A

Explanation:

You can copy blobs, directories, and containers between storage accounts by using the AzCopy v10 command-line utility.
The copy operation is synchronous so when the command returns, that indicates that all files have been copied.


Reference:

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-copy



DRAG DROP (Drag and Drop is not supported)
You are developing a web service that will run on Azure virtual machines that use Azure Storage. You configure all virtual machines to use managed identities.
You have the following requirements:
-Secret-based authentication mechanisms are not permitted for accessing an Azure Storage account.
-Must use only Azure Instance Metadata Service endpoints.
You need to write code to retrieve an access token to access Azure Storage. To answer, drag the appropriate code segments to the correct locations. Each code segment may be used 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.
Select and Place:

  1. See Explanation section for answer.

Answer(s): A

Explanation:

Azure Instance Metadata Service endpoints "/oauth2/token"
Box 1: http://169.254.169.254/metadata/identity/oauth2/token
Sample request using the Azure Instance Metadata Service (IMDS) endpoint (recommended):
GET 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/' HTTP/1.1 Metadata: true
Box 2: JsonConvert.DeserializeObject<Dictionary<string,string>>(payload);
Deserialized token response; returning access code.


Reference:

https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token https://docs.microsoft.com/en-us/azure/service-fabric/how-to-managed-identity-service-fabric-app-code



DRAG DROP (Drag and Drop is not supported)
You are developing a new page for a website that uses Azure Cosmos DB for data storage. The feature uses documents that have the following format:
You must display data for the new page in a specific order. You create the following query for the page:
You need to configure a Cosmos DB policy to support the query.
How should you configure the policy? To answer, drag the appropriate JSON segments to the correct locations. Each JSON 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.
Select and Place:


  1. See Explanation section for answer.

Answer(s): A

Explanation:


Box 1: compositeIndexes
You can order by multiple properties. A query that orders by multiple properties requires a composite index.
Box 2: descending
Example: Composite index defined for (name ASC, age ASC):
It is optional to specify the order. If not specified, the order is ascending.
{
"automatic":true,
"indexingMode":"Consistent",
"includedPaths":[
{
"path":"/*"
}
],
"excludedPaths":[],
"compositeIndexes":[
[
{
"path":"/name",
},
{
"path":"/age",
}
]
]
}






Post your Comments and Discuss Microsoft AZ-204 exam with other Community members:

Exam Discussions & Posts