Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frasermolyneux-archive/poc-bpr4zbka3iv50t2
This repository contains a proof of concept for using environments and Virtual Machine targets for IIS deployments with YAML pipelines in Azure DevOps.
https://github.com/frasermolyneux-archive/poc-bpr4zbka3iv50t2
azure-pipelines devops environments iis virtual-machines yaml
Last synced: 3 days ago
JSON representation
This repository contains a proof of concept for using environments and Virtual Machine targets for IIS deployments with YAML pipelines in Azure DevOps.
- Host: GitHub
- URL: https://github.com/frasermolyneux-archive/poc-bpr4zbka3iv50t2
- Owner: frasermolyneux-archive
- License: gpl-3.0
- Created: 2023-02-27T09:50:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T15:22:18.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T04:25:01.556Z (8 months ago)
- Topics: azure-pipelines, devops, environments, iis, virtual-machines, yaml
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# POC - IIS Deployment to Virtual Machines
This is a simple proof of concept to document the deployment of some IIS configuration to a virtual machine; this is likely to be in the context of a on-premises customer environment. Documentation context is for a customer that is considering moving from classic to YAML pipelines in which classic pipelines are using 'Deployment Groups' to deploy to virtual machines.
---
## Azure DevOps Configuration
The virtual machine resources are added to 'environments' under 'Pipelines' in Azure DevOps; see example where an environment 'dedicated-server' has been created and and a virtual machine 'NS570403' has been added to it.
![Azure DevOps Environment](images/dedicated-server-environment.png)
![Virtual Machines](images/dedicated-server-virtual-machine.png)
In the background this will actually create a 'deployment group' in Azure DevOps that will be sat in the 'Available pools' section of the 'Deployment Groups' page. This however isn't used by the YAML.
![Hidden Deployment Group](images/deployment-group.png)
---
## Referencing in YAML
To deploy to the virtual machine through YAML the `deployment` job is used; this will reference the `environment` and have the `resourceType` set to `VirtualMachine`. When this executes it will be in the context of that environment and any virtual machines that have been added to it.
For full documentation of the deployment job see [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs?view=azure-devops).
A minimum example is shown below:
```yaml
trigger: none
pr: nonestages:
- stage: 'Deploy'
jobs:
- deployment: 'DeployToDedicatedServer'
environment:
name: dedicated-server
resourceType: VirtualMachinestrategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Running on $($env:COMPUTERNAME)"
```