We have set up small dev platform on azure which includes servers(sql server, web server) and azure ML. These are protected by azure VPN gateway. Below are the list of azure components we created and configured . Currently we don't need the dev platform to be available but we will need it after 6 months . so is there any way we could take this complete setup as snap shot and store as image or images so that when we need we can just restore it with out doing much configuration
dev platform components to archive and restore
Virtual networks , sub nets, dns, firewalls
VPN gateway , configuration
VM with os and server setup
sql server with data
subscription with custom roles, assignments, cost alerts , dashboards etc
if this is not possible then what are the alternatives
regards,
Suman
Have a look at the different Infrastructure as Code options that are available. Easiest way to 'export' the current situation is to generate an ARM template of the needed resources by going to the resource group and clicking Export template under Automation.
To implement infrastructure as code for your Azure solutions, use Azure Resource Manager templates (ARM templates). The template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax, which lets you state what you intend to deploy without having to write the sequence of programming commands to create it. In the template, you specify the resources to deploy and the properties for those resources.
To increase the functionality options you have, have a look at Azure Bicep.
We've introduced a new language named Bicep that's used to develop ARM template JSON. Bicep files and JSON templates offer the same capabilities. You can convert templates between the two languages. Bicep provides a syntax that's easier to use for creating templates.
and also
Bicep is a domain-specific language (DSL) that uses declarative syntax to deploy Azure resources. It provides concise syntax, reliable type safety, and support for code reuse. We believe Bicep offers the best authoring experience for your infrastructure-as-code solutions in Azure.
Be advised: this is meant for the resources and their configuration of your environment. For the data side of things, save and/or export the data somewhere you can restore it from easily like Azure Storage.
Related
I'm looking for a way to automatically generate new instances of my manually created Azure resources. The resources already exist and destroying everything + rebuilding with an IaC framework is not an option at this stage. The existing infrastructure is rather simple (a few VMs, networks, network interfaces, disks, etc), nothing too fancy, and should serve as a blueprint for future deployments. I'd be happy with either generating a list of CLI commands that lead to the desired infrastructure or generating code for the Azure Resource Manager for the same purpose. I heard there are native tools to achieve this but could not find anything.
Is there a way to achieve this or do I have to go the error-prone way of manually writing the code, hoping I don't have any mismatch between the configuration of my coded infrastructure and my current infrastructure?
you can use Azure Portal to export the templates and check see if you ready to use Bicep - decompile to refactor variables/parameters practices, and use it as blueprint repository for future deployments (e.g starter- templates etc etc)
I am planning to provision the logic app using terraform script. But the workflow of logic app, I am deploying through the arm templates.
Is this recommended approach?
Can anyone suggest me how to deploy the logic app with business flow?
Logic apps are kind of counter-intuitive when it comes to Terraform. It is an Azure service that is designed to abstract away custom coding with an easy-to-use user interface. Designing something in a user interface often does not work well when using multiple environments (e.g. test, staging, production). This conflicts heavily with one of the main purposes of Terraform: matching infrastructure across multiple environments.
Of course, you can turn to the magic of ARM templates, but mankind did not invent JSON to be readable. And Azure never had a plan to support YAML for ARM templates. So how to proceed from here? I set out our requirements, solution and a terraform example below.
Requirements
Infrastructure is deployed by Terraform.
Infrastructure is deployed in 4 matching environments (i.e. dev, tst, acc, prd).
Configuring parameters for logic apps should be an easy task.
Building logic apps is done in the GUI.
Solution
Create an "empty" logic app resource with azurerm_logic_app_workflow. This resource will be deployed across all environments. It is empty, so you will find the Logic App in the Azure Portal without any content. This means that in your dev environment, you can use the GUI to design the Logic App.
Create a resource which azurerm_resource_group_template_deployment which will only be deployed based on a condition. This condition is true when you supply an arm template path, which will not be the case in the dev environment.
Make sure that azurerm_resource_group_template_deployment depends on azurerm_logic_app_workflow and set deployment_mode = "Incremental". Furthermore you can supply parameters to the logic app by setting parameters_content = jsonencode(var.parameters_map).
Example
A working terraform example can be found on Github.
Note: another high-level Azure service is Data Factory, which faces the same problems when it comes to automatic deployments using Terraform.
For provisioning AWS services(EC2/R53/VPC/S3/..), technology like Terraform have unreliable approach in terms of performing rollback, error handling etc.
AWS CloudFormation templates address these problems.
CloudFormation templates are used for both provisioning of aws services(like EC2/VPC/r53/S3/...) and configuration of every service.
Additionally this template approach should easily fit into scripted pipeline using Jenkins.
What is the approach for provisioning and configuration of services in Azure cloud?
Its called Azure Resource Manager (Peter gave a helpful link in the comments). You will interact with ARM through Azure powershell, Azure Cli, ARM Templates, different SDK's or just plain rest calls to create resources.
ARM Templates are the closest thing you can get to CloudFormation templates, but they dont really have all the features of CloudFormation templates.
For example, there is no preview of the changes that will happen before you run the template. some services can not be configured with ARM Templates (or some of the properties cannot be configured).
We are working on following within Azure portal
Azure Functions
Data Factory
Logic Apps
Storage account (not files)
Now as we are done with development, we need to deploy these azure resources in client's UAT environment
I looked around (might be missing something) and found that deployment of Azure resources is not straightforward.
In Azure, it is like another subscription, correct?
So found this blog, which works with different PowerShell scripts to copies from one subscription to another
This is the right approach? & it cover everything required for resources to execute flawless (I still need to go thru scripts) for e.g. permissions, Data Factory datasets, etc?
Any other way to deploy (kind of export & import)?
Basically what you need is to create a reusable arm template, your question lacks some details yet ARM templates are the way of automated deployment in Azure, on a high-level
start by authoring your arm template to deploy the vanilla required resources look here
https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites/functions
https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories
https://learn.microsoft.com/en-us/azure/templates/microsoft.logic/integrationaccounts
https://learn.microsoft.com/en-us/azure/templates/microsoft.datalakeanalytics/accounts/storageaccounts
you can combine all of them in one big template using ARM template dependency and other functions
look here
https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions
after you finish ARM templates can be used in many ways including PowerShell, direct API calls or even you can create a deployment in Azure and save it to be reused with a click
look here, also if there will be a high volume of users consider adding it to market place.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/
after finishing your implementation of vanilla resources you can then move into adding any customization you might have.
this is the right and best way to do "afaik"
also look here to see all of your existing resources in an arm template view
https://resources.azure.com/
my understanding of Azure is that almost everything with some few exceptions has an ARM template representation
hope this would help.
I'm looking for any gaps in the support for operations on Azure resources via the Azure SDK (java) vs. ARM templates.
So far, we've only found that blobs/queues/tables cannot be managed by ARM, while the containing StorageAccount can be. No documentation that calls out the differences either.
I prefer to use ARM templates as they provide atomicity of create and update across resources, provided they support all or most of the functionality.
Resources we're interested in are mostly IAAS-ish resources - Virtual network, security groups, subnets et al, LBs, storage artifacts, VM instances, DNS, etc.
Need this for basic create/delete operations and frequent update operations (e.g. patch VM images, modify DNS entries, move the ENI from one VM to another, etc).
Firstly, Template only supports ARM mode. Azure SDK supports ARM mode and asm mode.
Second, with template you could define a resource but you could not operation the resource, like start, stop a VM or a web app.
If you just want to deploy resources to Azure, I suggest you could select template, it is more easy for you to do it. SDK is more suitable for developer, Azure provides powerful API. You could manage your Azure resources and integrate them to your service.
Update:
If you only want to create or modify resources in Azure. Template is a more suitable option. Template supports more resources. Java SDK supports API is here. Template supports resource is here. Click Reference.
Note: You could not use template to delete a resource.