Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Error occured while contanting the server Bing Maps Fleet Tracker Deployment Portal #95

Open
asix7 opened this issue Feb 11, 2020 · 12 comments

Comments

@asix7
Copy link

asix7 commented Feb 11, 2020

We followed the instructions to create the solution in our Azure environment. We tried 5 times and we got "An error occured while contanting the server" every time. We even tried creating a Bing Maps API service in our subscription and using it instead of the free trial.

imagen

@RohitMadhu
Copy link

I am having the same issue. I do see the map with it zoomed into my current location.

@JianpingCAI
Copy link

JianpingCAI commented Mar 23, 2020

I got the same Error except that the map is shown.
image

The link under Login is "http://localhost:13954/api/users/login?redirectUri=http://localhost:4200/", though I have set the 'Redirect URIs' as 'https://mydeploymentname.azurewebsites.net/signin-oidc'.

@landolenc
Copy link

Did somebody figure this out? I am getting same error.

@greg9898
Copy link

Same here. I put the values in json files nothing changes

@jaigars
Copy link

jaigars commented Oct 2, 2020

I guess that no one bothered to update one click deployment script after karma environment variable got deprecated. As a result, it most likely deploys with default environment - in this case local, pointing to localhost even from Azure...
Deployed manually, changing URLs in environment.ts for Frontend to:
export const environment = {
production: true,
backendUrl: 'api',
frontendUrl: '/'
};

First, manually created Azure SQL database and added connection strings to BOTH Backend and Frontend appsettings.json. Actually at later stage figured that might have been redundant because Azure asked to configure SQL dependancy again, during publish. Then did all the builds, starting from Frontend, copied Frontend to Backend wwwroot/dist folder.

Next, deployed Function App and configured app settings in Azure. That one still has a problem unresolved though - System.Exception:
at SqlServerTypes.Utilities.LoadNativeAssembly (Trackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\repos\Microsoft\Bing-Maps-Fleet-Tracker\Backend\src\Trackable.EntityFramework\Loader.csTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 41)
at SqlServerTypes.Utilities.LoadNativeAssemblies (Trackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\repos\Microsoft\Bing-Maps-Fleet-Tracker\Backend\src\Trackable.EntityFramework\Loader.csTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 27)
at Trackable.EntityFramework.TrackableDbContext.LoadSqlServerTypes (Trackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\repos\Microsoft\Bing-Maps-Fleet-Tracker\Backend\src\Trackable.EntityFramework\TrackableDbContext.csTrackable.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 150)
at Trackable.Func.Shared.TrackableContext..ctor (Trackable.Func, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

Pubished Backend. Changed redirect URI in Azure AD app registrations to the site name provided.
And ... magic - got working portal, can register and approve users. Map is working.

Still have to fix Function App and test mobile clients.

@asix7
Copy link
Author

asix7 commented Oct 2, 2020

@jaigars Wow that is something that I would have never guessed. I dont work for the company I was deploying this to anymore. However I am still interested in implementing it. As soon as a get the tenant for my own company I will try it for sure, I will try to solve the Function App problem and report back any findings.

@greg9898
Copy link

greg9898 commented Oct 4, 2020

I suspect that problem was something like that but still can't deploy a working portal. Now I am receiving login error 403....
Could you upload your builds somewhere?

@greg9898
Copy link

greg9898 commented Oct 4, 2020

So. What I found so far. You don't need to do a manual deployment. Can deploy from the portal and then deploy only the rebuilt angular app.

@jaigars
Copy link

jaigars commented Oct 5, 2020

So. What I found so far. You don't need to do a manual deployment. Can deploy from the portal and then deploy only the rebuilt angular app.

Is it possible to deploy without Frontend with one click deployment? I don't see such an option in the deployment form and would assume that one click deploys setting Serving: ServeFrontend to true... Are you actually deploying two frontends then - one that gets screwed with one click and another one separately?

In any case that seems to confirm the problem with one click. If you deploy Frontend separately, it means that you pre-populate it with backend urls in environment.ts and this is exactly what apparently fails with one click...

But more to the point. Is your Function App working when you deployed with one click? Haven't had enough time to tinker with it, but when publishing manually, it looks like zip publish to Azure script is not copying SQLServerTypes from build directory to PubTmp and on to the zip file. And consequently it fails loading native libs at runtime.

@greg9898
Copy link

greg9898 commented Oct 5, 2020

I deploy everything from OneClick portal - then just override files in Backend wwwroot/dist directory

@jaigars
Copy link

jaigars commented Oct 7, 2020

I suspect that problem was something like that but still can't deploy a working portal. Now I am receiving login error 403....
Could you upload your builds somewhere?

Make sure you check multitenant option (Any Azure AD directory - Multitenant) when registering app in Azure AD and also select Identity Tokens under Implicit Grant.

As for the FunctionApp, eventually I gave up and included msvcr120.dll and SqlServerSpatial140.dll in the root of Function App in VS. Then it packaged them into bin directory on Azure when zip publishing. Consequently, had to adjust paths in Func.TrackableContext.cs and EntityFramework.Loader.cs to load native libs from ../bin, not from SqlServerTypes directory. Also remember that it doesn't pick up local appsettings.json - you have to specify application settings on azure (just click Manage Azure App settings from publish dialog in VS or do it in the portal)

@Natert0ts
Copy link

@jaigars so it seems like you got everything functional?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants