<b>Кабринский Эдуард - Octopus azure  - Р­РґСѓР°СЂРґВ РљР°Р±СЂРёРЅСЃРєРёР№


<h1>Octopus azure</h1>
<p><youtube></p>
Octopus azure <a href="http://remmont.com">The news</a> Octopus azure
<h1>Deploying to Azure using Azure Resource Manager templates and Octopus Deploy</h1>
<p style="clear: both"> <img src="https://res.cloudinary.com/endjin/image/upload/f_auto/q_80/assets/images/blog/2016/05/Deploying-to-Azure-ARM-P1-1024px.png" /></p>
<h2>Azure Resource Manager</h2>
<p>Azure Resource Manager (ARM) is a set of APIs that enable interacting with Azure for creating and managing resources. ARM Templates create a simpler way of automating deployment to Azure, by allowing all the parts of your infrastructure to be declared in the template. Azure itself then handles how that infrastructure gets created including the order of execution and running things in parallel where possible.</p>
<p>Defining infrastructure in this way is known as Infrastructure as Code, which offers many benefits such as being able to keep your templates in a source code repository for versioning and change tracking.</p>
<h2>Octopus Deploy</h2>
<p>Managing deployments across multiple environments, from development through to production, can be a complicated and challenging process. Octopus Deploy exists to make this process simpler, faster and more feature rich than tacking deployment on to an existing build server or hand rolling your own deployment process.</p>
<p>Octopus Deploy is a deployment automation server, installed on your own infrastructure. It's premise is that it does one thing and it does it well. Where a build server is great at compiling code and running tests, Octopus is great at taking the artefacts that build, configuring them and then distributing them to all the machines and environments that they need to run in. One of the key features that make an Octopus deploy superior to a build server for deployments is concurrency of tasks. Deploying the same package to many different locations concurrently is an area Octopus Deploy excels at.</p>
<p>In an Azure context, this could be useful for provisioning virtual machines that have already been deployed by an ARM Template. Even if you are purely deploying an ARM template full of Azure resources with no additional artefact deployment, there are plenty of other features that make Octopus worthwhile. To name but a few: configuration per environment, all deployments easily discoverable in one place, promotion between environments, and requirement of manual intervention and approval if necessary.</p>
<h2>How can you use them together?</h2>
<p>The Azure Resource Group Template step type was released with Octopus Deploy 3.3. This makes it really straight forward to set up a deployment process using the built-in step.</p>
<p>The Azure Resource Group Template step requires a Service Principal for authentication. To learn how to create a service principal using PowerShell, see a previous post on the endjin blog or a similar article in the Octopus documentation.</p>
<p>When adding a new Step to the deployment Process of a Project in Octopus, you'll see the Deploy an Azure Resource Group step type:</p>
<p style="clear: both"><img src="https://res.cloudinary.com/endjin/image/upload/f_auto/q_80/assets/images/blog/2016/05/select_azure_resource_group_step.png" /></p>
<p>After choosing the step, you'll see a page where various properties need to be completed:</p>
<p style="clear: both"><img src="https://res.cloudinary.com/endjin/image/upload/f_auto/q_80/assets/images/blog/2016/05/resource_group_template_package.png" /></p>
<p>The account type has to be a service principal, which you should have already created.</p>
<p>It is possible to get the JSON template from "source code" which actually means you can paste the JSON directly into the deployment step in a multi-line text box. If this option is chosen the JSON is parsed and the parameters required by the template will appear directly in the step details form. The other alternative is to use a file inside a NuGet package, in which case you need to specify where to get the package, and what the template and template parameters paths are.</p>
<h2>Taking things further</h2>
<p>It is unlikely that you will have a single step in the deployment pipeline, for deploying an Azure Resource Group. In reality, multiple different types of step will be used for different purposes.</p>
<h3>Creating the Azure Resource Group using a PowerShell step</h3>
<p>The Azure Resource Group must exist before the deployment step can happen. When creating the deployment step you enter the name of the Resource Group to use. This could be achieved by using the "Run an Azure PowerShell Script" step. After adding the Step to the Deployment Process, the following PowerShell script could be added to the Script text field in the step:</p>
<p>'$GroupName' and '$Location' are references to variables defined for the Project.</p>
<h3>Creating a reusable Step Template</h3>
<p>Creating a Resource Group using a PowerShell script is something that is going to be repeated. Octopus offers Step Templates that can be shared across your own projects, or shared with the community. There is also a library of community templates that can be reused.</p>
<p>Navigate to the 'Library' page from the top navigation bar. Then to the 'Step templates' page from the left navigation section. Then click the 'Add step template' button.</p>
<p style="clear: both"><img src="https://res.cloudinary.com/endjin/image/upload/f_auto/q_80/assets/images/blog/2016/05/add_step_template.png" /></p>
<p>In the dialogue that appears, select the 'Run an Azure PowerShell Script' step type. Give the template a name and description. On the 'step' tab enter the PowerShell script from the previous section.</p>
<p>The script parameters could come from the variables of the project itself like previously. Parameters can also be set on the template. If this is done, they can be entered when adding the step to the deployment process. The section highlighted in red in the image below is a parameter defined on the template being entered when using the template:</p>
<p style="clear: both"><img src="https://res.cloudinary.com/endjin/image/upload/f_auto/q_80/assets/images/blog/2016/05/create_resource_group_step_template.png" /></p>
<p>Once all the template settings and parameters are to your liking, save the template to your library.</p>
<p>Now when you are adding a step to the deployment process for a project, the list of available steps will include the step template just added, for creating an Azure Resource Group.</p>
<h2>Additional recommendations</h2>
<h3>Develop the ARM template using Visual Studio and use the NuGet package template source option</h3>
<p>While it is possible create an ARM template directly in the Step definition by using the "source code" option, developing the template using Visual Studio has lots of benefits.</p>
<p>There is an Azure Res