exam questions

Exam AI-102 All Questions

View all questions & answers for the AI-102 exam

Exam AI-102 topic 1 question 5 discussion

Actual exam question from Microsoft's AI-102
Question #: 5
Topic #: 1
[All AI-102 Questions]

HOTSPOT -
You need to create a new resource that will be used to perform sentiment analysis and optical character recognition (OCR). The solution must meet the following requirements:
✑ Use a single key and endpoint to access multiple services.
✑ Consolidate billing for future services that you might use.
✑ Support the use of Computer Vision in the future.
How should you complete the HTTP request to create the new resource? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: PUT -
Sample Request: PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/
Microsoft.DeviceUpdate/accounts/contoso?api-version=2020-03-01-preview
Incorrect Answers:
PATCH is for updates.

Box 2: CognitiveServices -
Microsoft Azure Cognitive Services provide us to use its pre-trained models for various Business Problems related to Machine Learning.
List of Different Services are:
✑ Decision
✑ Language (includes sentiment analysis)
✑ Speech
✑ Vision (includes OCR)
✑ Web Search
Reference:
https://docs.microsoft.com/en-us/rest/api/deviceupdate/resourcemanager/accounts/create https://www.analyticsvidhya.com/blog/2020/12/microsoft-azure-cognitive-services-api-for-ai-development/

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
WillyMac
Highly Voted 3 years, 5 months ago
I think answer is correct. PUT: puts a file or resource at a specific URI, and exactly at that URI. If there's already a file or resource at that URI, PUT replaces that file or resource. If there is no file or resource there, PUT creates one. POST: POST sends data to a specific URI and expects the resource at that URI to handle the request.
upvoted 25 times
Ody
3 months ago
Resource identification: PUT operations can only operate on the resource identified by the URL provided. POST operations can be performed on any server-side resource, regardless of the URL. Use cases: PUT is suitable for scenarios where you have full control over resource replacement. POST is suitable for scenarios where you need to submit data for processing, or create new resources without specifying a URI.
upvoted 1 times
...
jeffangel28
3 years, 5 months ago
It's seems correct, the link shows a similar example https://docs.microsoft.com/en-us/rest/api/deviceupdate/resourcemanager/accounts/create
upvoted 1 times
YipingRuan
3 years, 4 months ago
Yes, PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}?api-version=2021-04-30
upvoted 3 times
...
...
...
Adedoyin_Simeon
Highly Voted 3 years, 5 months ago
Although in Web Programming, and API dev, PUT is an http(s) request method for an update operation. I can however create a resource when there is no resource to update. I don't know why precisely but the method used by Azure to actually make a REST API request to create a resource is actually "PUT". So, the answers are correct. See Ref: https://docs.microsoft.com/en-us/rest/api/resources/resources/create-or-update
upvoted 13 times
...
rookiee1111
Most Recent 5 months, 2 weeks ago
The answer is PUT congnitiveservices Why PUT? Because while POST can also create new resources like PUT but its not idempotent like PUT hence its always better to us PUT when creating services.
upvoted 2 times
...
takaimomoGcup
6 months, 1 week ago
PUT and CognitiveSearvices
upvoted 2 times
...
reiwanotora
6 months, 2 weeks ago
Cognitive Services are "AI parts" that mimic human cognition (Cognitive) and are immediately available as WebAPI. Embedded applications can build cognitive solutions for vision, speech, language, decision making, and search without the need for technical knowledge in AI or data science.
upvoted 1 times
...
duyle2906
7 months, 2 weeks ago
When i differed with ChatGPT about PUT being correct, this is what I got When creating a new resource in Azure, the PUT method is used to update or create the resource with the provided configuration. In the case of Azure Cognitive Services, you typically use the PUT method to provision a new instance of the service with the specified settings. Therefore, the correct HTTP request to create the new resource should use the PUT method, not POST.
upvoted 1 times
...
pwang009
8 months, 2 weeks ago
Answer from ChatGPT, PUT and cognitiveservices curl -X PUT -H "Authorization: Bearer {access_token}" -H "Content-Type: application/json" \ -d '{"kind":"TextAnalytics","sku":{"name":"F0"}}' \ "https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.CognitiveServices/accounts/{api_name}?api-version=2021-04-30"
upvoted 1 times
...
Murtuza
8 months, 3 weeks ago
The given answers are CORRECT
upvoted 1 times
...
sara_aras
1 year, 2 months ago
PUT is correct. https://learn.microsoft.com/en-us/rest/api/resources/resources/create-or-update
upvoted 2 times
...
f2mrmlwr
1 year, 3 months ago
Yes, PUT https://learn.microsoft.com/en-us/rest/api/cognitiveservices/accountmanagement/accounts/create?tabs=HTTP
upvoted 2 times
exnaniantwort
5 months, 2 weeks ago
This is the correct documentation link for creating cognitive services account. I don't know why all the other comments just quote those to create other resources.
upvoted 1 times
...
...
RegTemp
1 year, 4 months ago
1. PUT 2. CognitiveServices
upvoted 1 times
...
zellck
1 year, 5 months ago
1. PUT 2. CognitiveServices https://learn.microsoft.com/en-us/rest/api/resources/resources/create-or-update https://learn.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Canomaly-detector%2Clanguage-service%2Ccomputer-vision%2Cwindows#types-of-cognitive-services-resources You can access Azure Cognitive Services through two different resources: A multi-service resource, or a single-service one. - Multi-service resource: Access multiple Azure Cognitive Services with a single key and endpoint. Consolidates billing from the services you use.
upvoted 7 times
rdemontis
1 year ago
Thanks for the references
upvoted 1 times
...
...
Eltooth
2 years, 5 months ago
PUT CognativeServices
upvoted 3 times
...
sumanshu
2 years, 11 months ago
PATCH is eliminated (It is only used for update). I think we can use both POST and PUT (to create resources). But good to use PUT (just in case if API has been re-trigerred, So it will not fail. And 2nd answer is "Cognitive services" which provides a lot of models. (So we can use computer vision as well). if we select only computer vision, then we can't use Sentiment analysis and OCR (for which we are trying to create a resource).
upvoted 2 times
...
LPreethi
3 years, 4 months ago
May be the reason to use PUT is because , PUT requests must be idempotent. If a client submits the same PUT request multiple times, the results should always be the same (the same resource will be modified with the same values). POST and PATCH requests are not guaranteed to be idempotent.
upvoted 4 times
...
LKLK10
3 years, 6 months ago
Shouldn’t the first one be POST? It says it’s a new resource created, not an existing one updated.
upvoted 4 times
sumanshu
2 years, 11 months ago
PUT can also be used to CREATE resource
upvoted 1 times
...
Jojo_star
2 years, 7 months ago
I agree, post is the answer if we want create new resource, below is link for another services, but still under cognitive services. https://westus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-0/operations/CopyModelToSubscription
upvoted 1 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 ...