Coder Social home page Coder Social logo

Create resource group about farmer HOT 3 CLOSED

compositionalit avatar compositionalit commented on September 17, 2024 1
Create resource group

from farmer.

Comments (3)

isaacabraham avatar isaacabraham commented on September 17, 2024 2

@brettrowberry Farmer only "directly" takes reponsibility for generating the ARM template itself.

However, Farmer does have a simple helper function that delegates to the Azure CLI for deployment of the template, and that API does support specifying the resource group you wish to deploy to - and it will create it if it does not exist:

// Create a template for a web app in North Europe
let template =
    let myWebApp = webApp {
        name "mysuperwebapp"
        sku WebApp.Sku.F1
    }

    arm {
        location NorthEurope
        add_resource myWebApp
    }

// deploy the template to "my-resource-group"
template
|> Writer.quickDeploy "my-resource-group"

Behind the scenes quickDeploy emits the ARM template to a file farmer-deploy.json, before creating and executing the following batch file:

az login && az group create -l northeurope -n my-resource-group && az group deployment create -g my-resource-group --template-file farmer-deploy.json

from farmer.

brettrowberry avatar brettrowberry commented on September 17, 2024 1

that API does support specifying the resource group you wish to deploy to - and it will create it if it does not exist

Perfect!

from farmer.

clement128 avatar clement128 commented on September 17, 2024

Hi @isaacabraham, first thanks to your great works.

Just want to ask, what if I don't want to create new resource group but use existing resource group instead, is there any way?

thanks

from farmer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.