It’s Friday, and you know what that means—it’s time for another Friday Fact! Today’s topic may feel different from the usual ones. However, it is just as true and just as valuable.
Did you know that you can create an Azure DevOps pipeline to deploy a Windows app to Azure File Share or Azure Blob Storage for download? You absolutely can.
In this example, the pipeline packages the application files (.exe, .pdb, .dll, .config, and others) into a single ZIP file. As a result, end users can download and install the app easily from one place.
For this to happen, we need to create a DevOps pipeline that performs the following actions:
- Triggered when changes to the WinApp Directory files are made.
- Restore NuGets.
- Builds the Windows App Solution.
- Copies the Build Output Files to the Staging Directory.
- Zip the contents (Optional Step).
- Upload the Zip to FileShare.
📝 One-Minute Brief
Azure DevOps pipelines can automate the deployment of Windows applications with consistency and reliability. This Friday Fact explains how pipelines simplify deployment, reduce manual steps, and help teams deliver Windows apps faster using modern DevOps practices.
Example of the YAML Pipeline
trigger:
paths:
include:
- NordexWinApp/*
pool:
vmImage: 'windows-latest' # Use a Windows agent to build .NET Framework applications
variables:
buildConfiguration: 'Release'
artifactName: 'nordexapp.zip'
fileSharePath: '\\cicdpocwinappfileshare.file.core.windows.net\winappfileshare' # Replace with your actual file share path
storageAccountName: 'cicdpocwinappstorage' # Replace with your storage account name
containerName: 'downloads' # Replace with your blob container name
steps:
- script: |
echo "Build Configuration: $(buildConfiguration)"
echo "Binaries Directory: $(Build.BinariesDirectory)"
echo "Work Dir: $(system.defaultworkingdirectory)"
echo "Art Staging Directory: $(Build.ArtifactStagingDirectory)"
displayName: 'Print Variables'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 5.x'
- task: NuGetCommand@2
displayName: 'Restore NuGet packages'
inputs:
restoreSolution: '**/*.sln'
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '**/*.sln'
msbuildArgs: '/p:Configuration=Release'
platform: 'Any CPU'
configuration: 'Release'
- task: CopyFiles@2
displayName: 'Copy Files to Staging Directory'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)\NordexWinApp\NordexWinApp\bin\$(buildConfiguration)'
Contents: '**\*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: ArchiveFiles@2
displayName: 'Zip build artifacts'
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/zip/$(artifactName)'
- task: WindowsMachineFileCopy@2
displayName: 'Copy Files to File Share'
inputs:
MachineNames: 'cicdpocwinappfileshare.file.core.windows.net'
SourcePath: '$(Build.ArtifactStagingDirectory)/zip/$(artifactName)'
TargetPath: '$(fileSharePath)'
CleanTargetBeforeCopy: true
# Provide credentials if required by your file share for authentication
AdminUserName: 'localhost\cicdpocwinappfileshare'
AdminPassword: '$(FileshareAdminPassword)'
- task: AzureCLI@2
displayName: 'Upload to Azure Blob Storage'
inputs:
azureSubscription: 'WinAppAzureConnection' # Service connection name
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch \
--account-name $(storageAccountName) \
--destination $(containerName) \
--source '$(Build.ArtifactStagingDirectory)/zip' \
--pattern '*' # Upload all files
You can download the YAML Pipeline from GitHub here:
THIS RESOURCE IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.
Conclusion
We can package a Windows App using an Azure DevOps Pipeline for your users to download.
To lazy to read? We’ve got you covered! Check out our video version of this content!
If you liked the content or found it helpful and want to help me write more, you can buy (or help buy) my son a Star Wars Lego set!