Skip to content
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

Qlik Cli #218

Open
abdulvajid4525 opened this issue Apr 4, 2024 · 8 comments
Open

Qlik Cli #218

abdulvajid4525 opened this issue Apr 4, 2024 · 8 comments

Comments

@abdulvajid4525
Copy link

Hi,

From the prod Qlik sense server, using Qlik CLI can we export the app from the Qlik sense dev server?

Thank you

@ahaydon
Copy link
Owner

ahaydon commented Apr 4, 2024

Yes, you can use the Connect-Qlik command to connect to the dev server, all subsequent commands are then run against that server. You can then run Export-QlikApp to export the app from the dev server, and if you need to run commands on prod again just use Connect-Qlik to reconnect to prod.

@abdulvajid4525
Copy link
Author

Whether I need to follow these steps before doing it. Without doing this am getting an error cannot connect to remote server.

step1 :-If we use Certificates to connect to Qlik Sense then Qlik Sense client and root authorities certificates must
also be installed on the machine running Qlik-Cli. If the machine will connect to multiple Qlik Sense sites,
certificates for each site must be installed on the machine.
step2 :- If we use Windows authentication, the root authorities certificates must also be installed on the machine
running Qlik-Cli and again if we connect to multiple Qlik Sense sites, root authorities certificates for each
site must be installed on the machine.

@ahaydon
Copy link
Owner

ahaydon commented Apr 4, 2024

If you have installed trusted certificates on your Sense servers and configured the certificate thumbprint in the proxy settings then you should be able to connect without SSL/TLS errors. Otherwise, you can use Connect-Qlik -TrustAllCerts -UseDefaultCredentials sense-dev to disable certificate verification and use Windows auth when connecting to the remote server sense-dev.

To use certificates instead of Windows auth you would need to get a QlikClient cert from the dev server and copy it to prod for use with Qlik-Cli.

@abdulvajid4525
Copy link
Author

I need to know whether these are steps which I should follow for connecting from dev to prod using certificate.
image

@ahaydon
Copy link
Owner

ahaydon commented Apr 4, 2024

Yes those steps are necessary to use certificates for connecting from one site to another, since you will have multiple QlikClient certificates installed it is not possible for Qlik-Cli to know which to use so you need to specify it. E.g. Get-Item Cert:\CurrentUser\My\1234 | Connect-Qlik sense-dev -Username INTERNAL\sa_api. This will get the certificate with thumbprint 1234 and pipe it into Connect-Qlik to use for authentication, and connect with specified servername and username.

You can also use a PFX file rather than importing the certificate, e.g. Get-PfxCertificate qs-dev.pfx | Connect-Qlik sense-dev -Username INTERNAL\sa_api

@abdulvajid4525
Copy link
Author

I tried this already.
You can also use a PFX file rather than importing the certificate, e.g. Get-PfxCertificate qs-dev.pfx | Connect-Qlik sense-dev -Username INTERNAL\sa_api
getting below error

Invoke-RestMethod : Unable to connect to the remote server
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1:66 char:23

  • ... $result = Invoke-RestMethod @paramInvokeRestMethod @params
  •                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExceptio
      n
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

@abdulvajid4525
Copy link
Author

@ahaydon Any inputs on this?

@ahaydon
Copy link
Owner

ahaydon commented Apr 8, 2024

@abdulvajid4525 check that you can access the port with Test-NetConnection senseserver -Port 4242, ensure to replace senseserver with the server hostname. It should show TcpTestSucceeded : True

Check the PFX file includes a private key with the command Get-PfxCertificate .\qs-dev.pfx | fl *

Try adding the -Verbose flag to Connect-Qlik, this will display more details when connecting and might give some insight into why it's failing.

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

No branches or pull requests

2 participants