microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
382 stars 246 forks source link

VSCode can't reach BCContainer (azure VM using traefik) #3716

Open BMSPedro opened 1 day ago

BMSPedro commented 1 day ago

We use an Azure VM to host our development environment, we rely on traefik (Setup-TraefikContainerForBcContainers command, traefik image from Tobias Fenster) with the Let's Encrypt option for the SSL certificate. Certificates issued by this platform are revoked after 90 days. We tried a self-signed certificate but we have the same problem, unsecured connection in the browser and connection failed from VScode.

We also tried forceHTTP but we must be doing it incorrectly.

There is a way to force an HTTP connection from VScode (what would be the port and url to use in the launch.json file).

There is a way to properly use a self-signed certificate.

Thanks Pedro

Script container creation: $credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'P@ssword1' -AsPlainText -Force) New-BcContainer -accept_eula -containerName BC250W1 -artifactUrl https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/25.0.23364.24652/w1 -assignPremiumPlan -auth NavUserPassword -Credential $credential -shortcuts None -updateHosts -PublicDnsName server.westeurope.cloudapp.azure.com -useTraefik

Image

freddydk commented 1 day ago

If you use a self-signed certificate, you can try installing that certificate on your computer under trusted certificate authorities - then it might work.

If you are using letsencrypt without traefik - there is a script called renew-letsencryptcertificate, which you can run on the Azure VM - that should work. I actually thought that traefik would renew the certificate automatically.

BMSPedro commented 1 day ago

Thanks Freddy, Yes, I installed my self-signed certificate on my computer, ...the problem persists. I will try the command for certificate renewal.

Can you explain to me the use of the forceHTTP option.. Would it be possible to indicate port 80 in the launch.json file?

De : Freddy Kristiansen @.> Envoyé : jeudi 10 octobre 2024 10:35 À : microsoft/navcontainerhelper @.> Cc : PERERA AGUILA Pedro @.>; Author @.> Objet : Re: [microsoft/navcontainerhelper] VSCode can't reach BCContainer (azure VM using traefik) (Issue #3716)

If you use a self-signed certificate, you can try installing that certificate on your computer under trusted certificate authorities - then it might work.

If you are using letsencrypt without traefik - there is a script called renew-letsencryptcertificate, which you can run on the Azure VM - that should work. I actually thought that traefik would renew the certificate automatically.

- Reply to this email directly, view it on GitHubhttps://github.com/microsoft/navcontainerhelper/issues/3716#issuecomment-2404453989, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFZ7PERMBZRHXRMWVBHSZRDZ2Y32BAVCNFSM6AAAAABPWG7FJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBUGQ2TGOJYHE. You are receiving this because you authored the thread.Message ID: @.**@.>>

freddydk commented 1 day ago

Please use the WEB UI in GitHub instead of answering emails - it is very hard to read messages sent in email to GitHub.

The command will not work on traefik VMs - might even destroy the VM.

The traefik stuff was not created by me and I really don't know the details of how it works, sorry.