Alphavima Technologies

February 19th, 2025

Bing Maps Integration with Dynamics 365 CRM: Setup Guide and Address Auto-Fill

BING MAPS API INTEGRATION WITH DYNAMICS 365 CRM

The evolution of maps has changed the way individuals explore the world. The transition from inaccurate physical maps to highly accurate digital maps has been mind boggling. It has also changed the way businesses are reaching out to their customers. To ensure growth, most businesses are employing CRMs, such as Microsoft Dynamics 365. Such tools have enabled businesses with improved sales, service, marketing and higher revenue generation. Taking a leap further, commercial organizations are now integrating the power of Bing Maps with the versatile Dynamics CRM to scale new heights of success.

Custom POI hosting, search, batch geocoding, and truck routing are some of the exclusive features that Bing Maps offers. Integrating your CRM with Bing Maps is really pocket friendly. If you use the Bing Map’s tools for development and testing only, it allows you to make 125000 billable calls in a year. Similarly, if the users integrates Bing Maps in Windows application, they get 50000 calls a day for education or Non-Profit usage. Similarly, if the users integrate Bing Maps in Windows application, they get 50000 calls a day for education or Non-Profit usage.

Businesses can use session IDs with Bing Maps HTML5 Web Control to make 25 free calls in one session. Beyond this, the enterprise license charges are based on the number of API calls teams make rather than varying by which APIs we call.

Turn Bing Maps Feature ON Or OFF For Our Organization CRM Product

> Browse to the Power Platform admin center and sign in using administrator credentials.

> Go to Environments and select environment such as dev/prod/test and further navigate to Settings and Product.

> Click on Features option.

> Under the Embedded content, turn on Bing Maps

> And finally, select Save and our Bing Maps feature turn to ON state.

After turning on Bing Maps feature into Power Platform, open make.powerapps.com and you will notice the Bing Maps icon on top navigation bar inside Insert option.

Bing Maps control icon in Dynamics 365 CRM interface

Get Bing Maps API Basic Key For Free

Simply search- Bing Maps API Basic key for free onto any browser or just paste below-mentioned URL into your browser:

https://www.microsoft.com/en-us/maps/create-a-bing-maps-key/

We will see this option which is Start for Free

Bing Maps API account signup and key generation

And you will be navigated to this page. Click on Get a free Basic Key option.

Bing Maps Basic Key selection for business use

Click on My Account dropdown and you will see My Keys option. Click on it and you will be directed to Bing Maps API key. Copy and paste the key and store it in your records for future references.

After getting the Bing Maps API key as a prerequisite, you need to move forward with further steps, such as Autocomplete Address field and Distance Calculation between two addresses.

Integrating Auto Suggestion Address Field into Dynamics 365 CRM

Step 1: Create an HTML web resource which will contain HTML, CSS, and JavaScript code.

Open any code editor where you can write above language code. We usually prefer VS Code.

Step 2: Copy and paste this code into your editor. We will go through the code section by section.

HTML code for implementing Bing Maps autosuggest feature
JavaScript to load Bing Maps Autosuggest module
Code assigning selected address components to CRM fields

Step 3: In this section, we will go through the HTML code.

<head>
<title>autosuggestuiwithoutmapHTML</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<style type=”text/css”>
body {
margin: 0;
padding: 0;
overflow: hidden;
font-family: ‘Segoe UI’, Helvetica, Arial, Sans-Serif
}
</style>
<meta><meta><meta><meta><meta><meta>
</head>

Here, you are creating normal HTML page section. You are also required to add title and inline CSS formatting for your body section. This can be done by adjusting margins, padding and font style.

Step 4: In this section we will go through the search field code.

In first div tag, with printoutpanel as id will act as panel in our form.

In second div tag, with searchBoxContainer as id, you will create search field with searchBox as id, where user will be able to input address.

As soon as the user starts typing an address, the Bing Maps API will display address suggestions.

Styling the Bing Maps address search box

Step 5: Let’s go deep into below section of important codes:

JavaScript function to set global context for Bing Maps integration

The actual JavaScript code starts now. It’s here where we will use Bing Maps APIs.

In Dynamics CRM v9, Xrm.Page and many other features have been denounced. That’s why we need to use the execution context. However, we can’t pass execution context onto the HTML web resource as a parameter. To achieve this, we will create JavaScript function as below:

Code to pass CRM execution context to Bing Maps web resource

In this line of code, we are passing the web resource name, which we created before with the above line of code.

var wrControl = formContext.getControl(“WebResource_ourWebResourceName”);

The address search web resource which we created earlier you will pass as execution context on load of the form.

window._formContext = formContext;

You will create global variable named _formContext. This variable can be used anywhere in our address search web resource also inside any method with which we can access or set values to any CRM fields.

Step 6: Let’s split code function by function to get deep insights of code.

JavaScript function for loading Bing Maps AutoSuggest module in Dynamics 365 CRM

LoadMapScenario function is the callback function which is assigned to callback property in script tag where we are calling BingMaps API with its key.

There is built-in API function called AutoSuggest provided by Microsoft.Maps API.

Inside this function, you are assigning callback property with onload function. This onload function will be our first function which will be executed after loadMapScenario function in our web resource.

There is another property named errorCallback which suggests you to define error function in code i.e. onError.

Any exception occurred during web resource execution will be handled by onError function and error message will be displayed to user on the screen.

Microsoft Maps Autosuggest Manager setup for Dynamics 365 CRM

In the onload function, we are defining maxResults parameter as 5 which can be changed to any number as per requirement.

This property will display 5 address suggestions to the user in search box container.

You will create variable named manager of AutosuggestManager class type by passing options as parameter.

There is inbuilt function i.e. attachAutoSuggest which takes three parameters as input.

First parameter is searchBox which is the ID of input field basically search field where user can type address. Second parameter is searchBoxContainer which is the ID of div tag i.e. container where address suggestions will be displayed.

Last parameter selected Suggestion is the function name where you will write your code to perform necessary operations as per your requirement. Such as displaying specific address fields onto screen setting CRM fields with the address chosen by user.

Step: 7

Handling address data from Bing Maps suggestions in Dynamics 365 CRM

In the selected Suggestion function, we are getting parameter as suggestionResult from AutoSuggestManager API, which contains a collection of all the fields that you want to display.

The Address API of Bing Maps contains Address Line, Locality, Admin, District, Postal Code, Country, Region, which contains street address, city, state, postal code & country values respectively.

Also using _formContext global variable, you would need to set CRM field values with the suggestion parameter values, which user clicks while suggestions are populated. Provide logical names of CRM fields over “crm-streetfield”.

The main step is to provide your Bing Maps API Key in the section highlighted above.

Step 8: The final step is to insert your web resource into the section where you want to place your form by making an entry into make.powerapps navbar. Find the Insert option and then click on WebResource.

You need to provide necessary name for your web resource. You would also be required to copy the provided name and paste it into onload JavaScript function explained above for passing the execution context. Click OK and finally Save and Publish.

Dynamics 365 CRM form with integrated Bing Maps address search

Conclusion

Integrating Bing Maps API with Dynamics 365 CRM enhances user experience by enabling real-time address suggestions, streamlining data entry, and improving accuracy across your CRM records. Whether you’re building location-aware apps or simply want to simplify address input for your users, this setup lays a solid foundation.

If you’re looking to take it a step further by calculating the distance between two addresses within Dynamics 365 CRM, check out our step-by-step guide on implementing distance calculation using Bing Maps API. It’s a powerful enhancement for route planning, logistics, or field service operations.

Ready to enhance your CRM with Bing Maps integration?

Visualize customer data, plan routes, and boost sales efficiency by integrating Bing Maps with Microsoft Dynamics 365 CRM.

FAQs

What Is Bing Maps Integration with Dynamics 365 CRM and How Does It Work?

Bing Maps integration with Dynamics 365 CRM embeds interactive geographic maps directly within the CRM interface, allowing users to visualize account locations, plot customer addresses on live maps, and perform geo-spatial searches without leaving the platform. The integration is powered by the Bing Maps API, which connects to Dynamics 365 through a configured API key stored in system settings. Once active, CRM records with address fields automatically display map pins on contact, account, and lead forms. Users can click a map pin to get directions, calculate distances between locations, or view nearby accounts in a given territory. For field service teams, the integration can display technician locations and customer sites on the same map canvas, enabling faster and more intelligent scheduling decisions without switching between separate tools.

Why Do Sales and Service Teams Benefit from Map-Based CRM Functionality?

Sales and service teams benefit from map-based CRM functionality because it transforms abstract address data into actionable geographic intelligence. A salesperson planning a regional visit can visualize all accounts in a given city, identify clusters of prospects near each other, and build an efficient visit sequence — all from within the CRM without exporting to a separate mapping tool. Service teams gain even more: they can see which technician is physically closest to an urgent call, optimize multi-stop routes for the day, and ensure territory coverage is balanced across the team. Beyond operational efficiency, map visualization helps managers identify white space in under-serviced geographic areas and spot patterns in customer distribution that are invisible when looking at address lists in a data table. These insights directly support better territory planning and resource allocation decisions.

How Does Geographic Mapping Improve Field Service Routing and Scheduling?

Geographic mapping improves field service routing and scheduling by replacing manual, experience-based dispatch decisions with data-driven visual planning. When a service coordinator can see all open work orders plotted on a map alongside the current locations of available technicians, they can instantly identify the optimal assignment — minimizing travel time, fuel costs, and the gap between a customer request and a technician arrival. Integration with Dynamics 365 Field Service takes this further by combining map-based dispatch with skills matching and parts availability, so coordinators can see not just who is nearby but who is nearby and qualified for the specific job. Over time, the aggregated routing data also reveals patterns — such as routes that consistently take longer than estimated — that help teams refine their scheduling models and set more accurate customer appointment windows.

What Is the Difference Between Bing Maps API and Azure Maps for CRM Integration?

Both Bing Maps API and Azure Maps provide mapping services that can be integrated with Dynamics 365, but they serve slightly different purposes and audiences. Bing Maps API is the original Microsoft mapping service and is still the default option embedded within Dynamics 365 CRM for address visualization and geocoding. It is straightforward to configure using a standard API key and works well for organizations that need basic map display and address auto-fill functionality. Azure Maps is Microsoft's newer, more enterprise-grade geospatial platform built on Azure infrastructure, offering advanced capabilities including real-time traffic data, spatial analytics, indoor mapping, and IoT integration. For organizations building sophisticated location-based applications or requiring advanced routing algorithms, Azure Maps is the more powerful option, though it requires more development effort to integrate than the built-in Bing Maps support in Dynamics 365. Review the Azure Maps documentation for a full capability comparison.

How Do I Obtain an API Key and Configure It in the CRM Platform?

To obtain a Bing Maps API key, navigate to the Bing Maps Dev Center at bingmapsportal.com and sign in with a Microsoft account. Create a new application under the My Keys section, selecting the appropriate key type — Basic for lower-volume use cases, or Enterprise for high-volume production deployments. Once you have the key, open Dynamics 365 and go to Settings, then Administration, followed by System Settings. Under the General tab you will find a Bing Maps API key field where you paste the key and save. After saving, address fields on contact, account, and lead forms will automatically display map panels when records contain valid address data. It is important to use an Enterprise key in production to avoid hitting the transaction limits of a Basic key during peak usage periods, which would cause map panels to stop rendering temporarily.

What Are the Usage Limits and Licensing Considerations for the Mapping API?

Bing Maps API usage is subject to transaction limits that vary by key type. Basic keys are free but capped at a relatively low number of transactions per billing period, making them suitable only for development and testing. Enterprise keys, which require a commercial license agreement with Microsoft, support the transaction volumes needed for production CRM deployments where hundreds or thousands of users may be loading map panels daily. Organizations should review their expected usage — based on user count, typical CRM sessions per day, and the number of map-enabled forms — and size their license accordingly. Microsoft regularly updates Bing Maps pricing, so it is worth consulting your Microsoft licensing partner to confirm current rates. For organizations already on Azure, Azure Maps may offer a more cost-predictable alternative that consolidates geospatial services within your existing Azure subscription and spend commitment. Our CRM services team can advise on the right licensing approach for your deployment.

    Get in Touch