What you can do is add a transform request to the map and look for requests to the satellite tiles. When requests for those are seen, swap out the subscription key. Here is a code block example:
var map, datasource;
var s0Key = '<Your S0 Azure Maps Key>';
var s1Key = '<Your S1 Azure Maps Key>';
function GetMap() {
//Initialize a map instance.
map = new atlas.Map('myMap', {
//Add authentication details for connecting to Azure Maps.
authOptions: {
//Alternatively, use an Azure Maps key. Get an Azure Maps key at https://azure.com/maps. NOTE: The primary key should be used as the key.
authType: 'subscriptionKey',
subscriptionKey: s0Key
},
transformRequest: function (url, resourceType) {
//Look for satellite imagery tile requests. Check for V1 and V2 render service requests as the map styles will likely upgrade to point to V2 in the future.
if (resourceType === 'Tile' && (url.indexOf('&tilesetId=microsoft.imagery') > -1 || url.indexOf('/map/imagery/png?') > -1)) {
url = url.replace(s0Key, s1Key);
}
return { url: url };
}
});
//Wait until the map resources are ready.
map.events.add('ready', function () {
//Add a style control to the map.
map.controls.add(new atlas.control.StyleControl({
mapStyles: 'all'
}), {
position: 'top-left'
});
});
}
That said, we are looking at ways to better support this scenario in the future.