-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with "Edit in Excel" for container behind traefik #2595
Comments
I can repro this and I think the problem here is the same problem, which causes the URL's in SOAP and OData definition to not be correct. Thinking whether a workaround could be to share a servicesettings.ps1 file to the my folder containing:
where bcaad is the containername. Having the service tier to be bcaadrest would cause the URL's to match (I think) and OData + API's would work. Also - even if I then get a correct fix for the issue - this workaround would still work. |
I have fixed a few things in the ARM templates and containerhelper if you are running Traefik and AAD (in the pre-release of both) You get the dev version of the ARM templates here: https://aka.ms/getbcext2 (add a 2) Excel app still needs to be changed to SPI app (another fix) - but once that is done - that also works more smoothly. |
I can't figure out how you did that, @freddydk. I adopted this change 6757308 locally, then I changed my script like this, so that the ServiceSettings.ps1 is generated correctly
If I check the ServiceSettings.ps1, it looks good to me:
But I get this error when starting:
The reason imho is that the service name is defined here https://github.com/microsoft/nav-docker/blob/master/generic/Run/150-new/navinstall.ps1#L309 during install, so when I start the container, it checks for When I check the service in the container, it also shows
What am I missing? |
Try to remove the -imagename You can call New-BcImage manually (which also has a myscripts) and then pre-build your image before calling New-BcContainer. |
But that would mean building a new image for every container? I'll try, but if that is true, that wouldn't be a practical workaround |
The issue is that the metadata request is case-sensitive: The Excel add-in tried to get
I think with that we have validated that it indeed is the very old bug which is haunting as again here. As I wrote above, while this is indeed a workaround, it is not a very practical one as it would require us to create a new image for every container :( Do you know what the problem is with solving this bug? Would it help to create an official bug report? This is "only" demo/test/dev environments for now, but that might change in the future and even for those scenarios this already hurts quite a bit. Obviously, it is an amazing demo feature, but also for test/dev it can be quite handy for adding or changing data. Oh and just FYI: The Excel debugger (for add-ins) is the well-known web console. You can launch it in Excel with the little arrow in the top right corner of the add-in window and then "attach debugger": |
Yeah - the image would of course have the service tier name stamped in:-( |
I actually don't like the "solution" anyway. The fact that the instance always is called "BC" (unless someone really goes out of the way to change it) is nice, in my opinion. But your answer seems to indicate that there is no way that we can get a real solution for this? |
I don't like the "solution" either. |
Great, thanks. Let me know if it helps to also create an official service request through support. I am pretty sure that I could ask other partners to also create one, but I don't know if that helps or not |
I will reference this issue in our bug system. |
Looking in our system, i found several bugs concerning the same - will try to get them prioritized. |
@freddydk Do you know whether there is any progress on this issue? |
will checkup with Jens |
@freddydk Three months later 😊 Any update on this? I just now tried with 21.3, but the issue seems to be the same still (didn't run the debugger, but symptoms are unchanged) |
No progress that I am aware of |
Just re-requested a status |
But no response? |
Just saw that the fix for this should be in 22.2 - but I haven't checked myself. |
I just tried DE Business Central 22.2 (Platform 22.0.57579.0 + Application 22.2.56969.57617) and the issue still exists there |
any chance the fix was shipped with v23? |
unfortunately, it appears it's still valid with v23... |
@tfenster @freddydk while it is still annoying, I might have found an alternative which might be easier to handle excel callback. Instead naming container server instance This is an involve from Tobias scripting : @"
`$NavServiceName = 'MicrosoftDynamicsNavServer`$$("$container".ToUpperInvariant())'
`$WebServerInstance = "$($container.ToUpperInvariant())"
`$ServerInstance = "$($container.ToUpperInvariant())"
"@ | Set-Content $serviceSettingsOverrideScriptPath
$myScripts += @($serviceSettingsOverrideScriptPath) together with that change, we will add an extra traefik rule which will redirect all calls with an endpoint looking like $excelRule = "PathPrefix:/{path:(?i:$($container.ToUpperInvariant()))/(?i:odatav4)}"
$additionalParameters += @(
"-l `"traefik.excel.frontend.rule=$excelRule`"",
"-l `"traefik.excel.port=7048`""
) the magic here is the I tested this change with OnPrem container (thank Tobias for the work here) - I'm still testing it on sandbox container type though. |
I've given up hope that it will ever be fixed 😅 |
Hi @tfenster, I refer to this message:
My tests of the OData service results in a correct "@odata.context": I have manually installed 2 different OnPrem BC instances (without Docker and without navcontainerhelper). Using the following bc instance configuration: 1st BC instance:
2nd BC instance
OData works with this setup as expected. I would say that the odata results is not related to the result of the office app server configuration. Unfortunately I have the same issue with office app server configuration as you described in your first posting. Calling the https://bcWebserver.mydomain.xx/BC_Client_Instance/OfficeApps/Public/ServerConfiguration results in correct "AlternateODataHost", but in a wrong "DataEndpointUrl".
|
@MatthiasSchaefer It looks to me like you talk about a different setup where you have different BC instance and WebClient instance names, but not behind a reverse proxy, right? If yes, then you have a similar problem with the same bad result. I don't know if and how the DataEndpointUrl can be influenced, but maybe @freddydk knows himself or knows someone who knows? |
Exactly, that's correct. |
Describe the issue
When I create a VM through aka.ms/getbc and create a container, I can successfully log in through AAD auth, but the "Edit in Excel" integration fails in two places. One I can fix, or at least I think so, the other I can't fix
Scripts used to create container and cause the issue
Step 1: Create VM and container through aka.ms/getbc
I mostly kept the defaults, but changed those settings:
The install log looks good to me: install log.txt
Step 2: Remove the first container
remove-bccontainer bcserver
Again, the result looks good
Step 3: Create AAD app regs and container
For this part, I copied the relevant parts from github.com/Microsoft/nav-arm-templates and came up with this script:
The startup log also seems fine. The only weird thing is that the health check initially fails, but the automatic restart seems to fix it. At least the container afterwards is healthy. This is the full log output: aad container startup log.txt
Step 4: Login and test "Edit in Excel"
With that in place, login works fine with aad after consent, but if I e.g. go to the open sales orders and then click "edit in Excel", I first need to consent, which also works fine, but then get this
This one I can fix if I go into the manifest for the Excel app reg and change the
replyUrlsWithType
fromto
and try again, then I get one step further, but still I get an error, this time :
If I connect the Excel addin debugger, I see that in the end a request to
https://repro-aad-vm.westeurope.cloudapp.azure.com/BC/ODatav4/$metadata
fails, which makes sense as the correct URL would behttps://repro-aad-vm.westeurope.cloudapp.azure.com/bcaadrest/ODatav4/$metadata
. Now it really becomes guessing for me, but if I look further, I can see a request tohttps://repro-aad-vm.westeurope.cloudapp.azure.com/bcaad/OfficeApps/Public/ServerConfiguration?_=1658257711509
, which returnsThe
DataEndpointUrl
in line 20 is wrong, I think, although thepublicodatabaseurl
is correctly set in the NAV server configTherefore it looks to me like the
publicodatabaseurl
is not considered properly in the/OfficeApps/Public/ServerConfiguration
endpoint. The container log (I set-dumpEventLog
on the container) shows a couple of messages, but I can't get any ideas what to change from them: container log.txtNow the guessing becomes really wild, but I could imagine that this is related to the (very old) problem raised here microsoft/nav-docker#460 and I think also shown in 2019 at NAV TechDays that the BC server in general seems to mostly ignore that setting. Could that be right or am I missing something in my setup?
This whole environment is not connected at all to our corporate AAD, network or any customer data, just running in my playground tenant / subscription / AAD, so I would be happy to give anyone access to the VM or create an AAD user for testing.
Additional context
The text was updated successfully, but these errors were encountered: