exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 6 question 19 discussion

Actual exam question from Microsoft's AZ-204
Question #: 19
Topic #: 6
[All AZ-204 Questions]

DRAG DROP -
You are a developer for a Software as a Service (SaaS) company. You develop solutions that provide the ability to send notifications by using Azure Notification
Hubs.
You need to create sample code that customers can use as a reference for how to send raw notifications to Windows Push Notification Services (WNS) devices.
The sample code must not use external packages.
How should you complete the code segment? 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.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: windows -
Example code:
var request = new HttpRequestMessage(method, $"{resourceUri}?api-version=2017-04"); request.Headers.Add("Authorization", createToken(resourceUri, KEY_NAME,
KEY_VALUE));
request.Headers.Add("X-WNS-Type", "wns/raw");
request.Headers.Add("ServiceBusNotification-Format", "windows"); return request;

Box 2: application/octet-stream -
Example code capable of sending a raw notification:
string resourceUri = $"https://{NH_NAMESPACE}.servicebus.windows.net/{HUB_NAME}/messages/"; using (var request = CreateHttpRequest(HttpMethod.Post, resourceUri))
{
request.Content = new StringContent(content, Encoding.UTF8,
"application/octet-stream");
request.Content.Headers.ContentType.CharSet = string.Empty;
var httpClient = new HttpClient();
var response = await httpClient.SendAsync(request);
Console.WriteLine(response.StatusCode);
}
Reference:
https://stackoverflow.com/questions/31346714/how-to-send-raw-notification-to-azure-notification-hub/31347901

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
markra
Highly Voted 3 years, 5 months ago
Answer is correct. https://docs.microsoft.com/en-us/rest/api/notificationhubs/send-wns-native-notification
upvoted 48 times
...
lugospod
Highly Voted 2 years, 9 months ago
Got this one 01/2022. Went with most voted (to avoid writing answers again)
upvoted 11 times
...
arunkuml
Most Recent 10 months, 3 weeks ago
Got it in the exam 14/12/23. Scored 912/1000. All questions are from ExamTopics. Case study - VanArsdel, Ltd (11 questions)
upvoted 2 times
...
AndySmith
12 months ago
On exam 3-Nov-2023. Went with proposed answer - 932/1000.
upvoted 2 times
...
BaoNguyen2411
1 year, 3 months ago
got this question on 29/06/2023
upvoted 3 times
...
juanckar
1 year, 3 months ago
This was on the exam (July 2023). Went with proposed. Scored 917
upvoted 3 times
...
Indhumathi_Saravanan
1 year, 7 months ago
Got this question - 19-Mar-2023
upvoted 1 times
...
at_sayali
1 year, 11 months ago
Answer is correct. Got this question in 10/2022
upvoted 2 times
...
gmishra88
2 years ago
Notification hub and logic apps are removed from scope
upvoted 4 times
...
Mev4953
2 years, 9 months ago
about second box: Set to application/json;charset=utf-8 or application/xml. If the notification type (X-WNS-Type) is wns/raw, set to application/octet-stream
upvoted 9 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago