Download a Package within an Octopus Step - octopus-deploy

I have an Octopus Deployment Project in which I am doing some changes in settings files like appsettings.json. So in different steps lots of changes been done. So at the end I am deploying it into Azure. But my question is, is there is any way to download a package just before pushing into Azure.
I know there are option to download package from Library. But those are not processed. So I need the altered package to be download.

How are you deploying to Azure? Is it an Azure Web App? In a lot of steps, you can use custom deployment scripts and variable substitution to update the package prior to its installation.
For example, in the Deploy an Azure Web App step, you can click on Configure Features and enable Custom Deployment Scripts and JSON Configuration Variables.

Related

Is it possible to manually run a build on a local Azure build agent without a DevOps server?

We normally use on-premises Azure DevOps Server to maange our build pipelines, using YML files. We have build agents running on one or more build servers.
A specific piece of R&D would be made far easier if we could install VS and a build-agent on a standalone box which is not linked to the Azure DevOps server, and manually 'run an YML build' against the build agent locally.
We don't have access to DevOps server from this machine and the alternative is rescripting an alternative to our YML in Powerscript or similar.
Is there any realistic way to do this?
Is it possible to manually run a build on a local Azure build agent without a DevOps server?
I am afraid there is no such way to manually run a build on a local Azure build agent without a DevOps server.
That's because azure devops services/server is equivalent to an interpreter and trigger. Agent itself is not a program that can be executed independently like MSBuild.exe, it does not have the ability to parse YAML grammar, it can only execute the parsed command passed by the server.
I totally understand your needs and approve of it, so I recommend you add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions:

How do I deploy continuous azure webjob using Octopus deploy

I am trying to get an Azure App Service to recognize my Web Job - meaning to show it in the portal under "Web Jobs" in the App Service. And to also run it on the schedule defined with a TimerTrigger attribute.
It is a .NET Core 2.2 Console Application with multiple web job classes in it. The App Service it runs within is a separate project and web site. I am able to publish it from Visual Studio and it shows as it should under Web Jobs in the Web App. But if I delete it and try the publish from Octopus to the same place WITHOUT doing the VS 2017 publish first, it won't show up.
My issue is that in a new environment, the Web Job does not get created when I use Octopus to deploy the Web Job files as described here:
http://blog.amitapple.com/post/74215124623/deploy-azure-webjobs
by setting the physical path in my Octopus package deployment:
App_Data\jobs\continuous\myjob
This is the same path as when I publish from Visual Studio 2017.
Related to this question, but there seems to be a step missing since the files are in the right place, but the web job does not appear in the portal.
How to deploy azure webjob using Octopus
Is there some additional ssetup or registration step for the Web Job to run or should the App Service just recognize the web job is there when the files appear in the correct place? Restarting the app service does not help.
Since you have a web app along with a web job, I would follow the steps outlined at https://octopus.com/docs/deployment-examples/azure-deployments/deploying-a-package-to-an-azure-web-app/deploying-web-jobs. You can build your project using .nuspec to get your .npkg and push/upload the package to Octopus.
Hope that helps.

How to Deploy BizTalk Application into production Server?

I have the following doubts in BizTalk deployment:
How to deploy the BizTalk application to the production server?
When I am modify the existing BizTalk application like artifacts, custom pipeline/functions, custom classes, etc., how again do I deploy the BizTalk application to the server?
I know BTDF is the one of the best tools for deploying BizTalk applications and we can deploy BizTalk application to server using it?
1. Deployment
For deployment you can use the built-in MSI generation wizard.
It means you deploy the application on a dev environment using Visual Studio, then on the admin console, export the application a MSI using the wizard.
Finally you can use that MSI to deploy the app to the Production server.
That's a two step process (Run MSI, import MSI in Bizalk Admin console).
Note that only your Biztalk assemblies are installed by the MSI.
If you use .NET assemblies in your solution, they need to be GAC'ed manually.
You will also need to restart the host instances running your Biztalk application.
See details here:
https://msdn.microsoft.com/en-ca/library/aa559168.aspx
That's a few manual steps.
Alternatively you can automate some of these steps by using the BTSTask, a command line tool included with Biztalk.
You can script all the manual steps.
Obviously it takes time to write such script, so it's only worth it if you are going to deploy many times in non-dev environments.
BTSTask reference:
https://msdn.microsoft.com/en-ca/library/aa559686.aspx
2. Redeployment
Usually you completely remove the old version and then install the new one:
Delete the application from the Biztalk Administration Console and ungac the assemblies it uses.
The whole process would look like:
1. Make sure there are no running instances in you application. You can always disable your receive location and let the running instances complete
2. Delete Biztalk application
3. UnGAC associated assemblies
4. Deploy new Biztalk application version and GAC associated assemblies
5. Restart Host Instances used by your Biztalk application
EDIT: To address OP's concern about deleting a running application:
It is indeed possible to deploy resources independently and never delete your application.
But it does not mean you will not interrupt the service.
An orchestration for example, can never be redeployed when it has running instances.
So assuming that you divided your functionality properly into applications, I find it cleaner and easier to delete the whole application than going after each resource.
Otherwise, yes you can go and replace your resources separately.
But to me it seems like an overhead caused by not having defined applications correctly.
3. BTDF
The Biztalk Deployment Framework is a good tool to have some kind of automation in your deployment without having to write the scripts yourself.
Good compromise between customization to your needs and setup time.
I have used it on a freelance project. It was very helpful because I was able to deliver a package with a only a couple of deployment instructions, and the non-techie client was able to deploy painlessly.

Setup CI Environment Using TFS and Amazon EC2

Can someone recommend a good approach for setting up a CI environment that would deploy to a multiple websites (QA/PROD) hosted on Amazon's EC2 while using TFS?
Here are the requirements I'm looking to fulfill:
Have TFS deployed somewhere to track tasks, manage source control, run tests on code check-in and do automatic deployments to a QA environment.
If everything passes the CI build in TFS, code should be automatically deployed to a QA environment hosted in Amazon EC2.
After testing, take the same deployment package we used for the QA environment and push it to an identical environment in EC2 which is our production environment.
We are a start-up so we don't need all the of bells and whistles just yet. We have limited resources currently so I am trying to be as minimal as possible while meeting the above requirements.
My first pass at this was to use the free program at Amazon for first-time users to have access to the EC2 cloud for free for 12 months. Then to setup a virtual machine at a low cost (~$20) with a web host to host our TFS environment which would then push to the Amazon cloud.
We also considered using "Visual Studio Online" to do this but it looks like it only deploys to Azure which is a little more than twice the cost to host a website with SQL on than Amazon so we don't want to go that route.
Is this a good approach? I'd appreciate any feedback. Thanks!
Using the latest TFS vNext build system this should be possible. You would need to install the AWS command line tools via npm, load your credentials, and then use aws command line to deploy to ec2.
Here is a screen shot of adding an npm task. Install the aws command line sdk. Run commands to package and upload your project.
You should install Release Management for Visual Studio 2013. It is easy to install and comes with your MSDN.
http://nakedalm.com/install-release-management-2013/
With it you can create a release pipeline with rollback to deploy your application. You will likely need to add any command line tools that you need to deploy to amazon and it will make sure they get to where they need to be.
http://nakedalm.com/building-release-pipeline-release-management-visual-studio-2013/

deploy mvc 3 site to azure using custom build script

Every example I've seen on how to deploy an MVC application to Windows Azure is using the Visual Studio Publish tool, my problem is that my application is deployed with a custom msbuild file (.proj).
I cannot change the way it is deployed, so is there a way to deploy to azure without publishing? Something like copying the directory result of my custom build to some azure directory.
Thanks for letting us know that it is for Windows Azure Web Role. You can use Automated Build and Deployment with Windows Azure SDK 1.6 blog to deploy directly from ccproj file. Even if it is written with SDK 1.6, you sure can use exact details with SDK 1.7 as well.
You can also take a look at Using MSBuild to deploy to multiple Windows Azure environments blog as well.

Resources