There are two primary ways you can utilize Chef to provision resources to a Microsoft Azure subscription: with the knife-azure plugin and the chef-provisioning Azure driver. In this blog post I’ll briefly explain the differences and you can watch the attached video with John Keiser to see how to create resources in Azure using the Chef-provisioning driver.
Knife-Azure is one way you can provision Azure resources. Knife might be used to provision Azure resources if you are already comfortable with knife or you already have an existing investment in knife configuration and commands for Azure.
Chef-Provisioning to Azure is the preferred way to create resources on Azure because it offers a number of benefits over knife for creating resources:
- The biggest reason is idempotency, meaning if you run a Chef-Provisioning cookbook then it will make the resources you define so no matter the state of what is already there. For instance, if you define a machine which needs a storage account and the storage account is already there it won’t try to re-create it. If the storage account isn’t there, it will create it for you.
- A second benefit is the ability to more easily provision to multiple providers including AWS, GCE, Azure, and bare metal servers using the same or almost same code.
- A third reason is flexibility– since this is in the form of a recipe, you can do all kinds of things like create a loop and scale to the total number of resource instances you’d like.