CHAPTER 1

Figure 2: Creating Azure Maps Account
Getting started with Azure Maps is easy. In your web browser, navigate to https://portal.azure.com/ and log in using an existing account or create a new one.
Next, select Create a resource > Azure Maps > Create.
This will display forms that, at minimum, require you to select the subscription, resource group, region, and pricing tier (see the following section for more information on pricing tiers).
Finally click Create.

Figure 3: Configuring Pricing Tier
You configure your Azure Maps pricing on the Pricing Tier tab.
Azure Maps bills by the number of API transactions, such as performing a geocoding transaction or retrieving a map tile. At the time of writing, Azure Maps provides two pricing options, Gen1 and Gen2:
Note: You can find detailed information on the queries per second (QPS) limitations for each pricing plan here and detailed pricing information here.

Figure 4: Track Azure Maps Usage
You can track the API usage on the metrics tab of the Azure Maps account. Simply select Azure-Maps as the scope and Usage as the metric.
When making calls to the Azure Maps API, authentication is required. Azure Maps supports three methods to authenticate these requests: Shared Key, Azure Active Directory (AAD), and Shared Access Signature (SAS) Token.
Shared Key and AAD authentication will be covered in this book. At the time of this writing, SAS Token authentication is only a preview feature and is not approved for production applications.
To use a shared key for a request to Azure Maps services, you simply add the key as a parameter to the URL. For example:
https://atlas.microsoft.com/map/static/png?subscription-key={SubscriptionKey}
However, the Shared Key authentication is not recommended by Microsoft for use in web applications. Microsoft only recommends using them for daemon apps where the key is not exposed and potentially compromised.
AAD authentication requires your code to obtain an authorization token and to pass that token in the request header. For example:
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken)
This is the recommended method for authentication because the tokens are short-lived and can be issued with fine control.
Note: See this article for more information on security options and recommendations.
Check the following resources for additional information and assistance: