Skip to content

Commit 19daf77

Browse files
committed
Update how-to-dev-guide-java-sdk.md
1 parent c3fdfda commit 19daf77

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ $Env:AZURE_CLIENT_ID="<client-id>"
144144
A$Env:AZURE_CLIENT_SECRET="<client-secret>"
145145
$Env:AZURE_TENANT_ID="<tenant-id>"
146146
$Env:MAPS_CLIENT_ID="<maps-client-id>"
147-
``` 
147+
```
148148

149149
After setting up the environment variables, you can use them in your program to instantiate the `AzureMapsSearch` client:
150150

@@ -163,8 +163,9 @@ public class Demo {
163163
MapsSearchClient client = builder.buildClient();
164164
}
165165
}
166-
``` 
167-
> [!Important]
166+
```
167+
168+
> [!IMPORTANT]
168169
> 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.
169170
170171
### Using a subscription key credential
@@ -244,8 +245,8 @@ public class Demo {
244245
            address.getMunicipality(), address.getCountryCode(), address.getPostalCode(),
245246
            coordinate.getLatitude(), coordinate.getLongitude());
246247
}
247-
} 
248-
} 
248+
}
249+
}
249250
```
250251

251252
This code snippet demonstrates how to create a `MapsSearchClient` object using Azure credentials. Start by instantiating `AzureKeyCredential` using your Azure Maps subscription key, then passes the credentials to instantiate `MapsSearchClient`. `MapsSearchClient` methods such as `FuzzySearch` can use the point of interest (POI) name "Starbucks" and coordinates GeoPosition(-122.31, 47.61).

0 commit comments

Comments
 (0)