Host Map Tiles on Azure with Authentication

Bernhard Lüthi 1 Reputation point
2020-12-15T09:39:58.737+00:00

Hi,

I would like to have authenticated access to a static X/Y/Zoom tile layer I store on an Azure storage.
The tileURL should look something like following: 'https://baseURL/{z}/{x}/{y}.png'

Is there a good way to host static map tiles in azure?

My first idea was to store all the images '{z}/{x}/{y}.png' as blobs and then generate a SAS of a Blob storage folder as baseURL in my backend API, but of course that does not work, as a SAS cannot be a folder in a blob storage.
Maybe there is some way to generate a SAS-like baseURL to some kind of Azure storage? I kind of don't want to route all the traffic through the Backend but want to have authenticated/authorised (Azure AD B2C) access to the map layers I'm providing.

thanks for your help.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,910 questions
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
659 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 16,461 Reputation points Microsoft Employee
    2020-12-15T19:48:13.72+00:00

    Azure Maps doesn't provide a service for this currently, however this may a part of the Azure Maps Creator platform in the future.

    One option you could look at is putting the tiles in blob storage and then using it's authentication. If your map tile set is in the hundreds of thousands of tiles or less, this will likely work well. Be sure to enable CORs on your blob storage so that the tiles can be accessed in client web apps. I've used this approach for this sample tile set: https://azuremapscodesamples.azurewebsites.net/?sample=Tile%20Layer%20Options

    If you have millions of tiles, then a tile server would likely be needed to maintain performance.