I'm trying to deploy RestAPI with https port for .net core 3.1 project.
I can run it manually by Powershell.
But when I try to run Powershell in Azure DevOps Release Pipeline.
Below is setup steps:
Stop Current RestAPI process + Delete all current file.
Extract new release to target deploy folder
Start Rest API process with port defined:
Start-Process -FilePath $env:WebsiteLocation\$env:ProcessName --urls="$env:PortNumber" -WorkingDirectory $env:WebsiteLocation
If PortNumber is http://... it work. new process start in deploy agent
If PortNumber is https://... it didn't work. no any process is started
Could you please help share with the reason why i got this issue.
Thanks a lot.
Related
Need to install LibreOffice to my Azure App Service.
1. Azure DevOps
I used powershell Start-Process to silent install but getting Permission denied.
Start-Process: /home/vsts/work/_temp/5cc8c99d-ed13-4b1b-823b-3cd9b56fdd1b.ps1:5
Line |
5 | Start-Process /home/vsts/work/1/s\LibreOffice_7.4.0_Win_x64.msi -Argu …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| An error occurred trying to start process
| '/home/vsts/work/1/s/LibreOffice_7.4.0_Win_x64.msi' with
| working directory '/home/vsts/work/1/s'. Permission denied
2. Kudu terminal
Getting Access Denied error when trying to run Start-Process manually.
Are there any alternatives to achieve this?
Not possible to install something on the host. The alternative is to use a docker container which has it already installed.
https://azure.github.io/AppService/windows-containers/
App Service supports Windows Containers! Deploying your application in a Windows Container enables you to bring along dependencies such as custom fonts, cultures and GAC deployed assemblies. When deploying a containerized application, the Windows Container is an isolation and security boundary. As a result, calls to libraries that would normally be blocked by the Azure App Service will instead succeed when running inside of a Windows Container.
This is my first question on stackoverflow. Hope your eyes won't be bleeding too much from my English.
Long story short: I can't stop my custom windows service via gitlab-runner.
What I'm trying to achieve during gitlab CI\CD is:
send a signal to my service to stop doing his job
periodically check this service status to determine whether it is stopped or not
So, I've install shell gitlab-runner locally for ease and gitlab server sees my local runner.
My windows service has name in the following format: "My.Service.Name".
gitlab-ci.yml contains job <my_job_name> with following command inside script section sc.exe queryex My.Service.Name (trying to get service status).
Command execution gives me error [SC] EnumQueryServicesStatus:OpenService FAILED 1060: The specified service does not exist as an installed service.
Basically, sc.exe stop My.Service.Name also failed with error [SC] OpenService FAILED 1060: The specified service does not exist as an installed service.
My service was created this way: sc create My.Service.Name binPath= "path\to\exe\My.Service.Name.exe -service" DisplayName= My.Service.Name start= delayed-auto depend= MSMQ.
Local query result of sc.exe queryex My.Service.Name call.
I was already checked this:
my service exists and has same service and display names in services.msc (My.Service.Name)
service name didn't contain any spaces (in case of missing quotes)
simple command sc.exe queryex (via gitlab-runner) gives me not all services, that I can see in services.msc locally
alternative command also not giving me all services from services.msc Get-Service -ComputerName . (via gitlab-runner)
same commands executed locally gives me desired result via both sc.exe sc.exe queryex My.Service.Name and
Get-Service in PowerShell Get-Service | where {$_.name -like "*My.Service.Name*"} or Get-Service -ComputerName .
both services gitlab-runner and My.Service.Name are running with my local administrator account
local run gitlab-runner.exe exec shell my_job_name gives me desired result also, so I can query service information and even stop service
based on similar questions, I also checked that windows RPC services are enabled and currently running
So, why some services, including my service, are not listed in results of sc.exe and Get-Service (via gitlab-runner)? I suspect some permission issues here.
Any help will be appreciated.
I finally get what is wrong - I messed up with gitlab-ci.yml job tags and in fact, another gitlab-runner processed incoming build. Now it's working as expected.
Actual i have installed a self hosted agent on my local machine
now my issue is when i am running a release pipeline for a client machine i have a powershell task in which i have a command that runs an exe file located in client machine which displays a message box .
but when I am checking at client machine i am able to see the exe is running in task Manger during the execution of my release pipeline but show how i am not able to see the interface of the application .
You can try adding -Wait to your powershell command. For below example.
Start-Process -FilePath "path to programm.exe" -Wait
You also need to make sure the deployment agent(the agent installed on client machine) is running in interactive mode.
To configure the agent in deployment group to run in interative mode. You need to change the Registration script you copied in azure devops. Remove --runasservice when you run the registration script on the client machine
Then you will be asked to set the agent to run as service or not as below screenshot(Please enter or type N to select interative mode) during the setup.
Check Interactive vs. service for more information.
I am unable to install the VSTS Agent Azure VM extension on an Azure VM. I tried both the Install extension blade in the Azure portal and the Powershell option. When I try from the portal it just gets stuck at transitioning. If I run the Powershell script it gets stuck trying to connect to server.
I was able to install it on another server without any issues. The 2 servers are part of a web farm so they are exact images.
I am following the steps detailed at this url https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/deployment-groups/howto-provision-deployment-group-agents?view=vsts .
I am trying to deploy from VSTS to an Azure VM.
This is the screen when I try to run the powershell script.
Run the config file directly (from C:/vstsagent folder) in cmdline and try again with dev.azure.com/{organisation name} url.
I am using Jenkins Pipeline to set the build and deployment process. For the build, i am using a Windows server node but for deployment, I have to use separate deployment servers (Windows machines) for Dev, QA and Production environments which cannot be added as slave nodes. I have to connect to these deployment servers to execute the deployment code. I have already tried using PowerShell and PSExec to connect to the remote machines and both are working fine, but our requirement is not to use any of these (PowerShell or PSExec) and do everything in Groovy scripting. I have searched everywhere but have not found a suitable solution to connect to the remote windows servers using Groovy in Jenkins Pipeline and run the deployment commands. Please suggest.