0

I have a site that works by a number of webservices talking to each other, hosted on the same site. This works perfectly well in IIS. The console part of the application passes a Bing Maps key and displays Bing Maps perfectly using Geolocate. In the web.config for the app I have this line:

<add key="BM_Key" value="NOTREALVF7QTW-LZfG0p7-RhSPeGvlfx3fdtgR-Gk_SB-wfF8kCj2J7nI57wjIna"/>

in a different application hosted on the same IIS

<endpoint address="http://dev.virtualearth.net/webservices/v1/geocodeservice/GeocodeService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeocodeService" contract="GeocodeService.IGeocodeService" name="BasicHttpBinding_IGeocodeService" />
<endpoint address="http://dev.virtualearth.net/webservices/v1/geocodeservice/GeocodeService.svc/binaryHttp" binding="customBinding" bindingConfiguration="CustomBinding_IGeocodeService" contract="GeocodeService.IGeocodeService" name="CustomBinding_IGeocodeService" />

When I convert this to Azure App Service, I have the webservices talking to each other and to the backend Azure hosted SQL. However, the Bing Maps fails with the error "Invalid Credentials. Sign up for a developer account at.."

Bing Maps works fine in the IIS environment and the key we have is valid, so what do I need to do to get it working in the Azure App space? It feels like the BM_Key is not being passed to the Bing Maps service or it is being blocked somehow.

Please advise if you know anything worth trying. I have already tried creating an Azure Bing Key, but this does not work if I substitute the keys. I have also added the BM_Key in the Azure App Service Application Settings, but this does not work.

Many thanks all Pete

Pete Finch
  • 43
  • 2
  • 8

2 Answers2

1

That looks like the old Virtual Earth SOAP services which have been deprecated for a couple years now and taken offline last summer. If you want to use Bing Maps, use the REST services: https://msdn.microsoft.com/en-us/library/ff701713.aspx

If working with .NET, there is also a toolkit available here: https://github.com/Microsoft/BingMapsRESTToolkit

Alternatively, you might also want to take a look at the Azure Maps REST services: https://azure.com/maps

https://learn.microsoft.com/en-us/rest/api/maps/search/getsearchaddress

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
  • Hi, if this is a deprecated service taken offline, why does this still work for me? We have a paid Bing Key, so is this why it is still working? Could I transfer this key to the Azure Maps Services? Many thanks for your time. Pete – Pete Finch Jun 28 '18 at 03:53
  • The URL you are hitting: http://dev.virtualearth.net/webservices/v1/geocodeservice/GeocodeService.svc is a deprecated service. When I try hitting this URL I get a resource not found error. You can use your Bing Maps key with the Bing Maps REST services. Bing Maps keys can't be used with Azure Maps, that requires a separate license. – rbrundritt Jun 28 '18 at 23:51
  • Hi, so thanks for this; you have been extremely helpful and kicked off a discussion where we proved we were using old code in this demo. This issue with the deprecated service has actually been fixed pretty much around the time MS told us this. However, so now we have the new Bing Maps and new code and all GeoCodeServices are working on IIS, but as soon as I use Azure with exactly the same code, I get no GeoCodeServices. I have a list of address verified objects that should appear on the Bing Maps, and in IIS they show. In Azure they don't. What am I missing in Azure to get this working? – Pete Finch Jun 29 '18 at 04:10
  • If it works locally there is no reason for it not to work on Azure. Double check your credentials as you may be using a different set for production. If storing this in a web.config file, check to see if you have different config files for debugging and release as that could cause issues if they are out of sync. Also make sure you are using a Bing Maps key and not an Azure Maps key (Assuming you are using the Bing Maps services). – rbrundritt Jul 01 '18 at 14:51
0

Many thanks to Ricky Brundritt for your help in directing my thinking process. "If it works in IIS then there is no reason for it to not work in Azure." I focused on our app and found some inconsistencies in versioning between the database and webservices, which when I updated Azure database to the same version as used in IIS, it worked perfectly. This is now marked as resolved.

Pete Finch
  • 43
  • 2
  • 8