azurejenkinsiaas

Jenkins deploy website to Azure Platform as a Service


I have successfully implemented Jenkins to deploy to a server hosted locally, but now I need to create a job to deploy to a Azure hosted website running on PaaS. Both the Jenkins host and Website hosts are Windows machines.

I have found a link for setting up a virtual machine template for Azure Slave plugin, but there is no VM because it is IaaS and I dont have additional slaves in this case.

I am asking about the plug ins and process flow please.

Which Azure Plugin should I use in Jenkins (if any)? E.g. Azure PublisherSettings Credentials plugin

Do I use the Get-AzurePublishSettingsFile and Import-AzurePublishSettingsFile ? Would these contain all the relevant details required for Jenkins to know where to copy to?

Would I create a zip file of the build, upload the zip to BLOB storage, and then extract it to the website?

Is it possible to upload a zip file and then proceeding to extract the files once the whole file has been uploaded? If the connection is interrupted at any stage while uploading 1000 individual files then the website will be unstable and therefore I need to investigate a single file upload with extraction thereafter.


Solution

  • So if I were you I'd do the following:
    1. Install jenkins powershell plugin, install Azure PowerShell commandlets.
    2. Create a job in Jenkins that creates a the zip file and uploads it to Azure Storage
    3. Create an ARM template to deploy Azure WebApp from the zip file in Azure Storage.
    4. Create a job to deploy said template.

    So the ARM template would take the zip file and upload it to the Azure WebApp and the WebApp would handle all the hassle with the zip file internally.