Reputation: 183
I have a project on https://dev.azure.com
. And I want to setup deploy to my virtual machine from master
branch automatically.
So, I read the this manual and did the following things:
VMenv
nameProduction
to this resource - deployment: deploy
displayName: Deploy to production
environment:
name: VMenv
resourceType: VirtualMachine
tags: Production
strategy:
runOnce:
deploy:
steps:
- script: echo This is deployment on production
displayName: Deploy project
And when I run this pipeline - it was stuck - here you can find details
Where I made mistake? How I can deploy on my virtual machine via azure devops?
Upvotes: 2
Views: 1191
Reputation: 35099
It seems that the deployment name
field has known issues. If deployment:deploy
, the job will be stuck.
I could reproduce this issue too.
For a workaround:
You could change the deployment field name
(Except deploy).
The deployment name could contain A-Z, a-z, 0-9, and underscore
.
For example:
jobs:
- deployment: test
displayName: Deploy to production
environment:
name: VMenv
resourceType: VirtualMachine
tags: Production
strategy:
runOnce:
deploy:
steps:
- script: echo This is deployment on production
displayName: Deploy project
Then the pipeline job will run as expected.
Additional information:
In addition to using Environment:VirtualMachine
for deployment, you can directly use self-hosted agent.
In this case, you could create the self-hosted agent on your Virtual Machine. Then you could directly use the self-hosted agent to deploy the resource to Virtual machine.
Hope this helps.
Upvotes: 3