Skip to content

Commit b421088

Browse files
authored
Merge pull request #262830 from MicrosoftDocs/main
1/9/2024 PM Publish
2 parents 704253f + 68db497 commit b421088

File tree

91 files changed

+808
-721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+808
-721
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6599,6 +6599,11 @@
65996599
"redirect_url": "/azure/batch/batch-rendering-service",
66006600
"redirect_document_id": false
66016601
},
6602+
{
6603+
"source_path_from_root": "/articles/batch/budget.md",
6604+
"redirect_url": "/azure/batch/plan-to-manage-costs",
6605+
"redirect_document_id": false
6606+
},
66026607
{
66036608
"source_path_from_root": "/articles/best-practices-network-security.md",
66046609
"redirect_url": "/azure/architecture/vdc/networking-virtual-datacenter",

articles/ai-services/authentication.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@ Now that you have a custom subdomain associated with your resource, you're going
216216
New-AzADServicePrincipal -ApplicationId <APPLICATION_ID>
217217
```
218218

219-
>[!NOTE]
219+
> [!NOTE]
220220
> If you register an application in the Azure portal, this step is completed for you.
221221
222222
3. The last step is to [assign the "Cognitive Services User" role](/powershell/module/az.Resources/New-azRoleAssignment) to the service principal (scoped to the resource). By assigning a role, you're granting service principal access to this resource. You can grant the same service principal access to multiple resources in your subscription.
223-
>[!NOTE]
223+
224+
> [!NOTE]
224225
> The ObjectId of the service principal is used, not the ObjectId for the application.
225226
> The ACCOUNT_ID will be the Azure resource Id of the Azure AI services account you created. You can find Azure resource Id from "properties" of the resource in Azure portal.
226227
@@ -239,32 +240,31 @@ In this sample, a password is used to authenticate the service principal. The to
239240
```
240241

241242
2. Get a token:
242-
> [!NOTE]
243-
> If you're using Azure Cloud Shell, the `SecureClientSecret` class isn't available.
244-
245-
#### [PowerShell](#tab/powershell)
246243
```powershell-interactive
247-
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList "https://login.windows.net/<TENANT_ID>"
248-
$secureSecretObject = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.SecureClientSecret" -ArgumentList $SecureStringPassword
249-
$clientCredential = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential" -ArgumentList $app.ApplicationId, $secureSecretObject
250-
$token=$authContext.AcquireTokenAsync("https://cognitiveservices.azure.com/", $clientCredential).Result
251-
$token
252-
```
244+
$tenantId = $context.Tenant.Id
245+
$clientId = $app.ApplicationId
246+
$clientSecret = "<YOUR_PASSWORD>"
247+
$resourceUrl = "https://cognitiveservices.azure.com/"
253248
254-
#### [Azure Cloud Shell](#tab/azure-cloud-shell)
255-
```Azure Cloud Shell
256-
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList "https://login.windows.net/<TENANT_ID>"
257-
$clientCredential = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential" -ArgumentList $app.ApplicationId, <YOUR_PASSWORD>
258-
$token=$authContext.AcquireTokenAsync("https://cognitiveservices.azure.com/", $clientCredential).Result
259-
$token
260-
```
261-
262-
---
249+
$tokenEndpoint = "https://login.microsoftonline.com/$tenantId/oauth2/token"
250+
$body = @{
251+
grant_type = "client_credentials"
252+
client_id = $clientId
253+
client_secret = $clientSecret
254+
resource = $resourceUrl
255+
}
256+
257+
$responseToken = Invoke-RestMethod -Uri $tokenEndpoint -Method Post -Body $body
258+
$accessToken = $responseToken.access_token
259+
```
263260

261+
> [!NOTE]
262+
> Anytime you use passwords in a script, the most secure option is to use the PowerShell Secrets Management module and integrate with a solution such as Azure KeyVault.
263+
264264
3. Call the Computer Vision API:
265265
```powershell-interactive
266266
$url = $account.Endpoint+"vision/v1.0/models"
267-
$result = Invoke-RestMethod -Uri $url -Method Get -Headers @{"Authorization"=$token.CreateAuthorizationHeader()} -Verbose
267+
$result = Invoke-RestMethod -Uri $url -Method Get -Headers @{"Authorization"="Bearer $accessToken"} -Verbose
268268
$result | ConvertTo-Json
269269
```
270270

articles/ai-services/computer-vision/identity-api-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ Azure AI Face is a cloud-based service that provides algorithms for face detecti
2424
- [LargeFaceList APIs](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc): Used to manage a LargeFaceList for [Find Similar](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
2525
- [PersonGroup Person APIs](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c): Used to manage PersonGroup Person Faces for [Identification](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
2626
- [PersonGroup APIs](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244): Used to manage a PersonGroup dataset for [Identification](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
27+
- [PersonDirectory Person APIs](https://westus.dev.cognitive.microsoft.com/docs/services/face-v1-0-preview/operations/5f06637aad1c4fba7238de25)
28+
- [PersonDirectory DynamicPersonGroup APIs](https://westus.dev.cognitive.microsoft.com/docs/services/face-v1-0-preview/operations/5f066b475d2e298611e11115)
2729
- [Snapshot APIs](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/snapshot-take): Used to manage a Snapshot for data migration across subscriptions.

articles/ai-services/computer-vision/toc.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,8 @@ items:
378378
href: intro-to-spatial-analysis-public-preview.md
379379
- name: Responsible use of AI
380380
items:
381-
- name: Transparency notes
382-
items:
383-
- name: Spatial Analysis use cases
384-
href: /legal/cognitive-services/computer-vision/transparency-note-spatial-analysis?context=/azure/ai-services/computer-vision/context/context
385-
- name: Characteristics and limitations
386-
href: /legal/cognitive-services/computer-vision/accuracy-and-limitations?context=/azure/ai-services/computer-vision/context/context
381+
- name: Transparency note
382+
href: /legal/cognitive-services/computer-vision/transparency-note-spatial-analysis?context=/azure/ai-services/computer-vision/context/context
387383
- name: Integration and responsible use
388384
items:
389385
- name: Responsible use in AI deployment

articles/ai-services/document-intelligence/includes/preview-notice.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ ms.date: 11/21/2023
1717
> * Features, approaches, and processes may change, prior to General Availability (GA), based on user feedback.
1818
> * The public preview version of Document Intelligence client libraries default to REST API version [**2023-10-31-preview**](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2023-10-31-preview&preserve-view=true&tabs=HTTP).
1919
> * Public preview version [**2023-10-31-preview**](/rest/api/aiservices/document-models/analyze-document?view=rest-aiservices-2023-10-31-preview&preserve-view=true&tabs=HTTP) is currently only available in the following Azure regions:
20-
>
2120
> * **East US**
2221
> * **West US2**
2322
> * **West Europe**

0 commit comments

Comments
 (0)