Select to view content in your preferred language

Dashboard configuration in offline Portal

253
6
Jump to solution
a week ago
PaulJohns
Occasional Contributor

Hello everyone,

I am experiencing issues with the offline dashboard configuration. The pop-up window, base map gallery, legend, and web layer widgets aren't working. In the browser console, I get an error: the dashboard is trying to connect to https://js.arcgis.com/4.27. In my case, it's unavailable.I have followed these steps:

1. Isolated the external source via the Portal Administrative Directory {System > Content > External Content: false}.
2. Downloaded the ArcGIS JavaScript SDK 4.27 from https://developers.arcgis.com/javascript/latest/downloads/.
3. Placed it into my IIS server in the root directory {Inetpub/wwwroot}.
4. Configured the service directory via the Server Administrator Directory {System > Handlers > REST > Service Directory}, pointing to the downloaded ArcGIS JavaScript SDK 4.27 as the main source.
5. Configured Portal properties via the Portal Administrator Directory {System > Properties}:
{
configurePortalAGOEnv: false,
portalAGOConfigEnabled: false,
portalLivingAtlasConfigEnabled: false,
searchArcGISOnlineEnabled: false,
jsapiUrl: https://portal.domain/portal/jsapi/jsapi4/
}

After these steps, the legend and basemap gallery widgets are functional, but nothing else works. The dashboard still tries to connect to https://js.arcgis.com/4.27, and I get additional errors with local widget initialization.

I would be greatly appreciative of any assistance.



0 Kudos
1 Solution

Accepted Solutions
PaulJohns
Occasional Contributor

Hello, as promised, I'm describing the solution. It turned out that the issue lies in the fact that in the *.JS files (or more precisely, in the bundle JS), the paths to which the portal should connect are hardcoded as constants - https://js.arcgis.com/...{API version}.

Step-by-step actions:

  1. Download the distribution for localizing the JS API 4.27 (this is the default version for ArcGIS Enterprise 11.2) from the official website https://developers.arcgis.com/javascript/latest/downloads, and place it on the IIS server in the root folder inetpub/wwwroot (e.g., C:\inetpub\wwwroot\arcgis_js_api\arcgis_js_v427\4.27).
  2. Configure the MIME type for the Default Web Site as *.JS = text/javascript and restart IIS.
  3. On the machine where the portal is deployed, open and edit the file chunk.54539.34eeaf05e94f010a5494.js, located at C:\Program Files\ArcGIS\Portal\apps\dashboards\assets (assuming a standard portal deployment). This file contains hardcoded references to external sources (https://js.arcgis.com) used by the Dashboard. Perform the following path replacements (e.g., using Notepad):

Important!: At the beginning of this instruction, it was noted that we placed the downloaded local API at the following path: C:\inetpub\wwwroot\arcgis_js_api\arcgis_js_v427\4.27. Therefore, the replacement should point to this directory, but the nested 4.27 folder is not included in the replacement—it is automatically handled by the API.

  1. On the machine where the GisPortal is deployed, navigate to the directory containing the Dashboard’s service folder: C:\Program Files\ArcGIS\Portal\apps\dashboards. You need to modify (add at the beginning) the index.html file with the following script to activate the DOJO library for further work with the local API:
html
 
<script>
window.dojoConfig = {
async: true,
locale: "uk",
packages: [
{
name: "@arcgis/core",
},
{
name: "esri",
}
],
t9n: {
}
};
</script>

View solution in original post

0 Kudos
6 Replies
CodyPatterson
MVP Regular Contributor

Hey @PaulJohns 

This is a longshot, but have you tried this on a private browser? And if so, does it work or does it still have these issues? It may be trying to connect to a cached site or process and it's causing it to fail. If you're using Chrome, you may need to clear all cached files for Lifetime.

Cody

0 Kudos
PaulJohns
Occasional Contributor

Hi Cody, My portal operates on a local network/domain. As the portal administrator, I use the Mozilla browser and, trust me, I clear the cache multiple times a day. The main issue is that I can’t find a way to block connections to the web and force the use of the local API instead.

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @PaulJohns 

I'm curious if the Dashboard services may have online fallbacks if there's an issue with the first attempt, that may be causing the outreach to the js.arcgis.com endpoint, possibly. You may try blocking the site using the hosts file on the IIS server or web server to see if that causes it to stop reaching out, along with that, possibly restarting the entire environment from a server level, so turn the servers off and back on to see if that would be able to get it going?

From a configuration side, most of my deep dives into the config files typically required Esri support to take a look, because there's a million and one places that could end up having the information you need, and for some reason that last one is what actually matters, may consider giving them a ring!

Cody

0 Kudos
PaulJohns
Occasional Contributor

Hey @CodyPatterson ,
I contacted ESRI support yesterday and got some initial advice. I'll give it a try. If I finally solve the problem, I'll share a short guide here.

Paul

PaulJohns
Occasional Contributor

Hello, as promised, I'm describing the solution. It turned out that the issue lies in the fact that in the *.JS files (or more precisely, in the bundle JS), the paths to which the portal should connect are hardcoded as constants - https://js.arcgis.com/...{API version}.

Step-by-step actions:

  1. Download the distribution for localizing the JS API 4.27 (this is the default version for ArcGIS Enterprise 11.2) from the official website https://developers.arcgis.com/javascript/latest/downloads, and place it on the IIS server in the root folder inetpub/wwwroot (e.g., C:\inetpub\wwwroot\arcgis_js_api\arcgis_js_v427\4.27).
  2. Configure the MIME type for the Default Web Site as *.JS = text/javascript and restart IIS.
  3. On the machine where the portal is deployed, open and edit the file chunk.54539.34eeaf05e94f010a5494.js, located at C:\Program Files\ArcGIS\Portal\apps\dashboards\assets (assuming a standard portal deployment). This file contains hardcoded references to external sources (https://js.arcgis.com) used by the Dashboard. Perform the following path replacements (e.g., using Notepad):

Important!: At the beginning of this instruction, it was noted that we placed the downloaded local API at the following path: C:\inetpub\wwwroot\arcgis_js_api\arcgis_js_v427\4.27. Therefore, the replacement should point to this directory, but the nested 4.27 folder is not included in the replacement—it is automatically handled by the API.

  1. On the machine where the GisPortal is deployed, navigate to the directory containing the Dashboard’s service folder: C:\Program Files\ArcGIS\Portal\apps\dashboards. You need to modify (add at the beginning) the index.html file with the following script to activate the DOJO library for further work with the local API:
html
 
<script>
window.dojoConfig = {
async: true,
locale: "uk",
packages: [
{
name: "@arcgis/core",
},
{
name: "esri",
}
],
t9n: {
}
};
</script>
0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @PaulJohns 

Impressive fix! Thank you for coming back with the solution, I'm sure this will help many with the same problem!

Cody

0 Kudos