Skip to content

Commit 35ede04

Browse files
authored
Merge pull request #107976 from stevemunk/sdk-dev-guides
Grammar improvements in the SDK dev guides
2 parents d023cc3 + 06ea652 commit 35ede04

File tree

4 files changed

+114
-130
lines changed

4 files changed

+114
-130
lines changed

articles/azure-maps/how-to-dev-guide-csharp-sdk.md

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: How to create Azure Maps applications using the C# REST SDK
33
titleSuffix: Azure Maps
44
description: How to develop applications that incorporate Azure Maps using the C# SDK Developers Guide.
5-
author: eriklindeman
6-
ms.author: eriklind
5+
author: sinnypan
6+
ms.author: sipa
77
ms.date: 11/11/2021
88
ms.topic: how-to
99
ms.service: azure-maps
@@ -12,16 +12,16 @@ services: azure-maps
1212

1313
# C# REST SDK Developers Guide
1414

15-
The Azure Maps C# SDK supports functionality available in the [Azure Maps Rest API][Rest API], like searching for an address, routing between different coordinates, and getting the geo-location of a specific IP address. This article introduces the C# REST SDK with examples to help you get started building location-aware applications in C# that incorporate the power of Azure Maps.
15+
The Azure Maps C# SDK supports functionality available in the Azure Maps [Rest API], like searching for an address, routing between different coordinates, and getting the geo-location of a specific IP address. This article introduces the C# REST SDK with examples to help you get started building location-aware applications in C# that incorporates the power of Azure Maps.
1616

1717
> [!NOTE]
18-
> Azure Maps C# SDK supports any .NET version that is compatible with [.NET standard 2.0][.NET standard]. For an interactive table, see [.NET Standard versions][.NET Standard versions].
18+
> Azure Maps C# SDK supports any .NET version that is compatible with [.NET standard] version 2.0 or higher. For an interactive table, see [.NET Standard versions].
1919
2020
## Prerequisites
2121

22-
- [Azure Maps account][Azure Maps account].
23-
- [Subscription key][Subscription key] or other form of [authentication][authentication].
24-
- [.NET standard][.NET standard] version 2.0 or higher.
22+
- [Azure Maps account].
23+
- [Subscription key] or other form of [Authentication with Azure Maps].
24+
- [.NET standard] version 2.0 or higher.
2525

2626
> [!TIP]
2727
> You can create an Azure Maps account programmatically, Here's an example using the Azure CLI:
@@ -61,17 +61,17 @@ dotnet add package Azure.Maps.Geolocation --prerelease
6161

6262
## Create and authenticate a MapsSearchClient
6363

64-
The client object used to access the Azure Maps Search APIs require either an `AzureKeyCredential` object to authenticate when using an Azure Maps subscription key or a `TokenCredential` object with the Azure Maps client ID when authenticating using Azure Active Directory (Azure AD). For more information on authentication, see [Authentication with Azure Maps][authentication].
64+
The client object used to access the Azure Maps Search APIs require either an `AzureKeyCredential` object to authenticate when using an Azure Maps subscription key or a `TokenCredential` object with the Azure Maps client ID when authenticating using Azure Active Directory (Azure AD). For more information on authentication, see [Authentication with Azure Maps].
6565

6666
### Using an Azure AD credential
6767

68-
You can authenticate with Azure AD using the [Azure Identity library][Identity library .NET]. To use the [DefaultAzureCredential][defaultazurecredential.NET] provider, you'll need to install the Azure Identity client library for .NET:
68+
You can authenticate with Azure AD using the [Azure Identity library][Identity library .NET]. To use the [DefaultAzureCredential][defaultazurecredential.NET] provider, you need to install the Azure Identity client library for .NET:
6969

7070
```powershell
7171
dotnet add package Azure.Identity
7272
```
7373

74-
You'll need to register the new Azure AD application and grant access to Azure Maps by assigning the required role to your service principal. For more information, see [Host a daemon on non-Azure resources][Host daemon]. During this process you'll get an Application (client) ID, a Directory (tenant) ID, and a client secret. Copy these values and store them in a secure place. You'll need them in the following steps.
74+
You need to register the new Azure AD application and grant access to Azure Maps by assigning the required role to your service principal. For more information, see [Host a daemon on non-Azure resources]. The Application (client) ID, a Directory (tenant) ID, and a client secret are returned. Copy these values and store them in a secure place. You need them in the following steps.
7575

7676
Set the values of the Application (client) ID, Directory (tenant) ID, and client secret of your Azure AD application, and the map resource’s client ID as environment variables:
7777

@@ -105,7 +105,7 @@ var client = new MapsSearchClient(credential, clientId);
105105
```
106106

107107
> [!IMPORTANT]
108-
> The other environment variables created above, while not used in the code sample here, are required by `DefaultAzureCredential()`. If you do not set these environment variables correctly, using the same naming conventions, you will get run-time errors. For example, if your `AZURE_CLIENT_ID` is missing or invalid you will get an `InvalidAuthenticationTokenTenant` error.
108+
> The other environment variables created in the previous code snippet, while not used in the code sample, are required by `DefaultAzureCredential()`. If you do not set these environment variables correctly, using the same naming conventions, you will get run-time errors. For example, if your `AZURE_CLIENT_ID` is missing or invalid you will get an `InvalidAuthenticationTokenTenant` error.
109109
110110
### Using a subscription key credential
111111

@@ -167,7 +167,7 @@ foreach (var result in searchResult.Results)
167167
}
168168
```
169169

170-
The above code snippet demonstrates how to create a `MapsSearchClient` object using your Azure credentials, then uses its [FuzzySearch][FuzzySearch] method, passing in the point of interest (POI) name "_Starbucks_" and coordinates _GeoPosition(-122.31, 47.61)_. This all gets wrapped up by the SDK and sent to the Azure Maps REST endpoints. When the search results are returned, they're written out to the screen using `Console.WriteLine`.
170+
The above code snippet demonstrates how to create a `MapsSearchClient` object using your Azure credentials, then uses its [FuzzySearch] method, passing in the point of interest (POI) name "_Starbucks_" and coordinates _GeoPosition(-122.31, 47.61)_. The SDK packages and sends the results to the Azure Maps REST endpoints. When the search results are returned, they're written out to the screen using `Console.WriteLine`.
171171

172172
The following libraries are used:
173173

@@ -236,11 +236,11 @@ if (searchResult.Results.Count > 0)
236236
}
237237
```
238238

239-
Results returned by the `SearchAddress` method are ordered by confidence score and because `searchResult.Results.First()` is used, only the coordinates of the first result will be returned.
239+
The `SearchAddress` method returns results ordered by confidence score and since `searchResult.Results.First()` is used, only the coordinates of the first result are returned.
240240

241241
## Batch reverse search
242242

243-
Azure Maps Search also provides some batch query methods. These methods will return Long Running Operations (LRO) objects. The requests might not return all the results immediately, so users can choose to wait until completion or query the result periodically. The example below demonstrates how to call the batched reverse search methods:
243+
Azure Maps Search also provides some batch query methods. These methods return Long Running Operations (LRO) objects. The requests might not return all the results immediately, so users can choose to wait until completion or query the result periodically. The following example demonstrates how to call the batched reverse search methods:
244244

245245
```csharp
246246
var queries = new List<ReverseSearchAddressQuery>()
@@ -257,7 +257,7 @@ var queries = new List<ReverseSearchAddressQuery>()
257257
};
258258
```
259259

260-
In the above example, two queries are passed to the batched reverse search request. To get the LRO results, you have few options. The first option is to pass `WaitUntil.Completed` to the method. The request will wait until all requests are finished and return the results:
260+
In the above example, two queries are passed to the batched reverse search request. To get the LRO results, you have few options. The first option is to pass `WaitUntil.Completed` to the method. The request waits until all requests are finished and return the results:
261261

262262
```csharp
263263
// Wait until the LRO return batch results
@@ -267,7 +267,7 @@ Response<ReverseSearchAddressBatchOperation> waitUntilCompletedResults = client.
267267
printReverseBatchAddresses(waitUntilCompletedResults.Value);
268268
```
269269

270-
Another option is to pass `WaitUntil.Started`. The request will return immediately, and you'll need to manually poll the results:
270+
Another option is to pass `WaitUntil.Started`. The request returns immediately, and you need to manually poll the results:
271271

272272
```csharp
273273
// Manual polling the batch results
@@ -291,7 +291,7 @@ Response<ReverseSearchAddressBatchOperation> manualPollingResult = manualPolling
291291
printReverseBatchAddresses(manualPollingResult.Value);
292292
```
293293

294-
The third method requires the operation ID to get the results, which will be cached on the server side for 14 days:
294+
The third method requires the operation ID to get the results, which is cached on the server side for 14 days:
295295

296296
```csharp
297297
ReverseSearchAddressBatchOperation longRunningOperation = client.ReverseSearchAddressBatch(WaitUntil.Started, queries);
@@ -361,31 +361,28 @@ void printReverseBatchAddresses(ReverseSearchAddressBatchResult batchResult)
361361

362362
## Additional information
363363

364-
The [Azure.Maps Namespace][Azure.Maps Namespace] in the .NET documentation.
364+
The [Azure.Maps Namespace] in the .NET documentation.
365365

366-
[Azure Maps account]: quick-demo-map-app.md#create-an-azure-maps-account
367-
[Subscription key]: quick-demo-map-app.md#get-the-subscription-key-for-your-account
368-
369-
[authentication]: azure-maps-authentication.md
370-
[Host daemon]: ./how-to-secure-daemon-app.md#host-a-daemon-on-non-azure-resources
366+
[.NET Standard versions]: https://dotnet.microsoft.com/platform/dotnet-standard#versions
371367
[.NET standard]: /dotnet/standard/net-standard?tabs=net-standard-2-0
368+
[Authentication with Azure Maps]: azure-maps-authentication.md
369+
[Azure Maps account]: quick-demo-map-app.md#create-an-azure-maps-account
370+
[Azure.Maps Namespace]: /dotnet/api/azure.maps
371+
[defaultazurecredential.NET]: /dotnet/api/overview/azure/identity-readme?view=azure-dotnet#defaultazurecredential
372+
[FuzzySearch]: /dotnet/api/azure.maps.search.mapssearchclient.fuzzysearch
373+
[geolocation readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Geolocation/README.md
374+
[geolocation sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Geolocation/samples
375+
[geolocation package]: https://www.nuget.org/packages/Azure.Maps.geolocation
376+
[Host a daemon on non-Azure resources]: ./how-to-secure-daemon-app.md#host-a-daemon-on-non-azure-resources
377+
[Identity library .NET]: /dotnet/api/overview/azure/identity-readme?view=azure-dotnet
378+
[rendering package]: https://www.nuget.org/packages/Azure.Maps.Rendering
379+
[rendering readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Rendering/README.md
380+
[rendering sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/samples
372381
[Rest API]: /rest/api/maps/
373-
[.NET Standard versions]: https://dotnet.microsoft.com/platform/dotnet-standard#versions
374-
[search package]: https://www.nuget.org/packages/Azure.Maps.Search
375-
[search readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Search/README.md
376-
[search sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Search/samples
377382
[routing package]: https://www.nuget.org/packages/Azure.Maps.Routing
378383
[routing readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Routing/README.md
379384
[routing sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Routing/samples
380-
[rendering package]: https://www.nuget.org/packages/Azure.Maps.Rendering
381-
[rendering readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Rendering/README.md
382-
[rendering sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/samples
383-
[geolocation package]: https://www.nuget.org/packages/Azure.Maps.geolocation
384-
[geolocation readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Geolocation/README.md
385-
[geolocation sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Geolocation/samples
386-
[FuzzySearch]: /dotnet/api/azure.maps.search.mapssearchclient.fuzzysearch
387-
[Azure.Maps Namespace]: /dotnet/api/azure.maps
388-
[search-api]: /dotnet/api/azure.maps.search
389-
[Identity library .NET]: /dotnet/api/overview/azure/identity-readme?view=azure-dotnet
390-
[defaultazurecredential.NET]: /dotnet/api/overview/azure/identity-readme?view=azure-dotnet#defaultazurecredential
391-
[NuGet]: https://www.nuget.org/
385+
[search package]: https://www.nuget.org/packages/Azure.Maps.Search
386+
[search readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.Search/README.md
387+
[search sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Search/samples
388+
[Subscription key]: quick-demo-map-app.md#get-the-subscription-key-for-your-account

0 commit comments

Comments
 (0)