Description
The requested service URL cannot be used for network analysis. The signed-in user account may lack the Directions & Routing privilege or service credits, the portal may not have network analysis services configured, or the ArcGIS Online subscription may be in restricted status.
Solution
Sign in with an account that has sufficient service credits and the Directions & Routing privilege, or add credits and privileges to your account. If you are using your own portal, publish network analysis services to that portal.
Learn more about privileges in ArcGIS Online
Learn more about credits in ArcGIS Online