See the full docs here.
Want to edit the docs? Check out the docs folder.
Repeatable Azure deployments with ARM templates - made easy!
Home Page: https://compositionalit.github.io/farmer
License: MIT License
See the full docs here.
Want to edit the docs? Check out the docs folder.
Whilst it's a fine library and looks excellent, for the limited usage we're giving it, it seems overkill to use it. It would be great if we could remove it and replace with "standard" dotnet code, even if this meant wrapping the HTTP interop into a separate file / module.
This one should be quite easy, but I am not so skilled with ARM templates yet.
It would be really hand to have possibility to create standalone instance of AppInsights using comp. expression and have other parts depend on it and use its key. For example in our scenario we have a webApp and functionApp and want them both to be logged by same AppInsights where we need to setup InstrumentationKey.
I think this is a great project, and a month or so ago I'd have been all over it, but as Microsoft already provide libraries to manage ARM resources from code, I'm wondering how Farmer compares.
If you don't know what I'm talking about, and I wouldn't blame you as Microsoft haven't heavily promoted it, I'm talking about the Azure Management Libraries:
https://github.com/Azure/azure-libraries-for-net
Thanks in advance.
Is there a reason the sample app is 3.0? It seems to compile and run fine as netcoreapp2.2.
This one is connected with #14. I assume to have possibility to set settings from other resources from template, there must be also depends_on
.
Right now it's huge and blurry
Don't you find ``East Asia``
-style identifiers ugly? Why not just EastAsia
?
I wanted to check if there were plans for ACR support? Either way, unless someone is already working on it, I would like to take a stab at contributing.
The following template generates a Linux ARM template that is invalid:
let template =
let myWebApp = webApp {
name "mysuperwebappisaac"
sku WebApp.Sku.F1
operating_system Linux
runtime_stack DotNetCore22
}
arm {
location NorthEurope
add_resource myWebApp
}
The service host is deployed, but the web app is not, with an error that the LinuxFxVersion is invalid (in the generated template it's DOTNETCORE|2.2
).
What do you think this is @Dzoukr ?
It would be great to also have support for CDN support.
https://docs.microsoft.com/en-us/azure/templates/microsoft.cdn/2019-04-15/profiles
https://docs.microsoft.com/en-us/azure/templates/microsoft.cdn/2019-04-15/profiles/endpoints
Hi Isaac,
first of all, amazing work!
Please, would it be possible to add setting
possibility for Azure functions as well?
Logic Apps are defined in a custom Workflow Definition Language (WDL) which is rather similar to ARM templates.
When you deploy a Logic App via ARM template, a workflow definition is embedded as a resource, see for example this reference on deploying Logic Apps using CI/CD.
This issue is a request to add support for the Logic App WDL in Farmer such that we can safely generate Logic Apps using code.
One of the things I do today with ARM templates is create resource groups. Does Farmer support resource group specification? I didn’t see it in the README or the examples.
Please specify the license.
We should plug into the ARM Validation REST call / Azure CLI so that we can automatically pre-validate templates before deploying.
Farmer's API seems to be quite stable and personally I don't expect any wild changes now. Maybe we can consider convention (add_resource
vs addResource
), but if you want to keep it that way, maybe it's good time for v1.0.0 release on NuGet?
It's evident that we need a more streamlined and opinionated way to deploy Farmer templates from anywhere e.g. FAKE, CAKE, .NET console apps, GitLab etc..
I probably know how to do it - will send PR soon.
Remove Newtonsoft and migrate to Text.Json. This benefits netcore3 consumers who get it for free. The serialization we're doing is extremely limited so I'm hopeful this would be possible.
Is anyone working on making Writer.quickDeploy cross-platform?
I have written something that at least works on my mac, so that would at least be one more platform 🙂 but I think it should work on linux as well. I can make a pull-request from that to get a discussion going. Maybe you have some more requirements for this function that my solution doesn't support.
Found issue with serialization output for WebApp
"Case": "ResourceName",
"Fields": [
"my-test-web-farmer"
]
Will send PR in few minutes.
Nice to have: support for API Management:
https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/allversions
Looks like a lot of work though, so no hard feelings if this does not seem worth the effort.
Hi,
we'd like to see support for Redis cache. A possible ARM template could look like this:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"cache_name": {
"defaultValue": "cache_name",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Cache/Redis",
"apiVersion": "2019-07-01",
"name": "[parameters('cache_name')]",
"location": "West Europe",
"properties": {
"sku": {
"name": "Basic",
"family": "C",
"capacity": 0
},
"enableNonSslPort": false,
"redisConfiguration": {
"maxclients": "256",
"maxmemory-reserved": "2",
"maxfragmentationmemory-reserved": "12",
"maxmemory-delta": "2"
}
}
}
]
}
/cc @atheck
I could see this being really useful for creating reusable templates to add to an Azure .org for repeat deployments with different names. I get that is not the primary use case, but this would certainly help that use case.
We'd like to decouple creating of app services from app service plans
It should be so that we can run post deploy scripts when everything ist done
this will make it easier to gitignore
A question, when trying to deploy a sql-server by running the quickDeploy-command I get an error that the password parameter is missing:
Please provide securestring value for 'password-for-v-test-sql'
When deploying the generated arm-template manually I can provide the parameter, of course, so in a production scenario it works fine.
But what is a good way to do this when using quickDeploy?
I actually interpreted the following section in the readme to mean that a (development) password would be automatically generated, but maybe I misunderstood:
Farmer does support securestring parameters for e.g. SQL and Virtual Machine passwords - these are automatically generated based on the contents of the template rather than explicitly by yourself. However, we don't currently plan on providing rich support for either parameters or variables for several reasons:
So is there a workaround for this that I am not seeing, or can I not use quickDeploy for resources that require SecureParameters?
To deploy a function app with runtime v3 using the azure function core tools version 3 you need to set FUNCTIONS_EXTENSION_VERSION = ~3. See https://docs.microsoft.com/sv-se/azure/azure-functions/set-runtime-version
Right now this value is hardcoded to ~2 in the generated arm-template.
This should be configurable, I think, and it shouldn’t be too hard to make that change. Probably you could use a DU for the supported values 1, 2, and 3 and then add a CustomOperation use_extension_version
in the function builder. I can take a crack at it in a PR if that’s fine? Unless there are any other specific design decisions to consider?
I have no clue how to do this but I imagine that it's possible to automatically push Hugo sites to github io?
Hi,
we'd like to see support for EventHubs. A possible ARM template looks like this
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"events_name": {
"defaultValue": "events_name",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.EventHub/namespaces",
"apiVersion": "2018-01-01-preview",
"name": "[parameters('events_name')]",
"location": "West Europe",
"sku": {
"name": "Standard",
"tier": "Standard",
"capacity": 1
},
"properties": {
"zoneRedundant": false,
"isAutoInflateEnabled": false,
"maximumThroughputUnits": 0,
"kafkaEnabled": true
}
},
{
"type": "Microsoft.EventHub/namespaces/AuthorizationRules",
"apiVersion": "2017-04-01",
"name": "[concat(parameters('events_name'), '/', parameters('events_name'))]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', parameters('events_name'))]"
],
"properties": {
"rights": [
"Listen",
"Send"
]
}
},
{
"type": "Microsoft.EventHub/namespaces/AuthorizationRules",
"apiVersion": "2017-04-01",
"name": "[concat(parameters('events_name'), '/RootManageSharedAccessKey')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', parameters('events_name'))]"
],
"properties": {
"rights": [
"Listen",
"Manage",
"Send"
]
}
},
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2017-04-01",
"name": "[concat(parameters('events_name'), '/hub')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', parameters('events_name'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 2,
"status": "Active"
}
},
{
"type": "Microsoft.EventHub/namespaces/networkRuleSets",
"apiVersion": "2018-01-01-preview",
"name": "[concat(parameters('events_name'), '/default')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', parameters('events_name'))]"
],
"properties": {
"defaultAction": "Deny",
"virtualNetworkRules": [],
"ipRules": []
}
},
{
"type": "Microsoft.EventHub/namespaces/eventhubs/consumergroups",
"apiVersion": "2017-04-01",
"name": "[concat(parameters('events_name'), '/hub/$Default')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', parameters('events_name'), 'hub')]",
"[resourceId('Microsoft.EventHub/namespaces', parameters('events_name'))]"
],
"properties": {}
}
]
}
/cc @atheck
Linked to #52. Now that we support secure parameters, we need to be able to easily e.g. splice them together using things like ARM's concat
.
I am trying to create support for selecting runtime stack for WebApp
, but now in code the function for creating ArmTemplate
record considers functionApp as another "version" of WebApp. The problem is, that even if they are close together, they do not offer exactly the same options for setup.
Also each template writes Runtime Stack
in slightly different way.
FunctionApp:
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
}
WebApp:
"appSettings": ... omited
"metadata": [
{
"name": "CURRENT_STACK",
"value": "dotnetcore"
}],
This would force me to do another if
logic in writer logic (where anonymous record would differ based on whether Kind
contains functionApp
or not), which doesn't sound too clean to me. Also thinking about adding another options like always_on
, which is not available in FunctionApp template, the if
would appear more than once.
Proposal: Add FunctionApp as another SupportedResource
case (even if it is neeearly same as WebApp) and also add different Runtime stack values for each type as it is now in Azure Portal.
Good idea, wrong idea, total nonsense? What do you think @isaacabraham?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.