Skip to content

Commit

Permalink
Merge pull request #2 from CompositionalIT/pr/TheRSP/466-merge-from-m…
Browse files Browse the repository at this point in the history
…aster

Pr/the rsp/466 merge from master
  • Loading branch information
r30e authored Mar 25, 2021
2 parents a601191 + bea16b6 commit c0675eb
Show file tree
Hide file tree
Showing 157 changed files with 3,430 additions and 493 deletions.
3 changes: 3 additions & 0 deletions Farmer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F54A
samples\scripts\bastion.fsx = samples\scripts\bastion.fsx
samples\scripts\container-registry.fsx = samples\scripts\container-registry.fsx
samples\scripts\cosmos.fsx = samples\scripts\cosmos.fsx
samples\scripts\loganalytics.fsx = samples\scripts\loganalytics.fsx
samples\scripts\diagnosticsetting.fsx = samples\scripts\diagnosticsetting.fsx
samples\scripts\eventhubs.fsx = samples\scripts\eventhubs.fsx
samples\scripts\functions.fsx = samples\scripts\functions.fsx
samples\scripts\keyvault.fsx = samples\scripts\keyvault.fsx
Expand All @@ -28,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F54A
samples\scripts\vm.fsx = samples\scripts\vm.fsx
samples\scripts\webapp-appinsights.fsx = samples\scripts\webapp-appinsights.fsx
samples\scripts\webapp-storage.fsx = samples\scripts\webapp-storage.fsx
samples\scripts\container-instance.fsx = samples\scripts\container-instance.fsx
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SampleApp", "samples\SampleApp\SampleApp.fsproj", "{2F230746-189D-4AFD-9B60-D49BB23C98DA}"
Expand Down
25 changes: 15 additions & 10 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@ Release Notes
=============
## vNext
* Initial support for subscription-level deployments
* Container Groups: Support for init containers.
* Framework: Add support for NET5, upgrade to F#5
* Functions: Support for 64 bits.
* Storage: Add support for tables
* Event Grid: Ensure destination Queues are created as a dependency

## 1.4.0-beta2
* Bing Search: Migrate support from Cognitive Services into a dedicated Bing Search builder.
* Framework: Updated DeterministicGuid for RFC 4122 compatibility

## 1.4.0
* Bing Search: Support for Bing Search (migrated from Cognitive Services).
* Container Registry: Added ARM expressions for admin account credentials
* Databricks Workspace: Support for creating Databricks Workspaces
* Web App: Improved KeyVault integration.
* Web App: Add PremiumV3 SKU.

## 1.4.0-beta1
* Storage: Support for setting default blob access tier at account level with "default_blob_access_tier"

* Diagnostic Settings: Support for creating Diagnostic Settings on other resources.
* Event Hub: Update built-in expression paths for default key.
* Functions: Added some extra keywords which were already present on Web App.
* Storage: Support for setting default blob access tier at account level with "default_blob_access_tier"
* SQL Azure: Validation and fail fast on account names instead of silently fixing them (breaking run-time change).

* Web App: Improved KeyVault integration.
* Web App: Add PremiumV3 SKU.
* Web App: Automatically add Logging extension for ASP.NET Core apps (additive change to ARM).
* Web App: Added Instrumentation Key Setting for Linux WebApp.
* Web App: Automatically add Client Id setting for user assigned identities.
* Web App: Support for 64 bits.

* SQL Azure: Validation and fail fast on account names instead of silently fixing them (breaking run-time change).

* Azure CLI: Ensure JSON output.
* Framework: Extension methods for Taggable and Dependable to simplify boilerplate keywords.
* Framework: Common keywords between Functions and Web Apps factored out.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/api-overview/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ You can also supply multiple dependencies at once as a list; this is useful if y
let storageAccounts : IBuilder list = [
for letter in [ 'a' .. 'e' ] do
storageAccount {
name (sprintf "mystorage%c" letter)
name $"mystorage{letter}"
}
]
Expand All @@ -73,7 +73,7 @@ You can also use the `:>` (safe upcast) operator when declaring the StorageAccou
let storageAccounts = [ // inferred as IBuilder list
for letter in [ 'a' .. 'e' ] do
storageAccount {
name (sprintf "mystorage%c" letter)
name $"mystorage%c" letter)
} :> IBuilder
]
```
Expand Down
6 changes: 3 additions & 3 deletions docs/content/api-overview/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ In F#, you have access to the full power of .NET, rather than a limited set of w
let first = "Hello"
let second = "World"
let serverName = first + " " + second + "!"
let dbName = sprintf "%s %s!" first second
let dbName = $"{first} {second}!"
let db = sql {
server_name serverName
Expand All @@ -89,8 +89,8 @@ You can also use F# *list comprehensions* to rapidly create several resources of
let myDatabases =
[ for i in 1 .. 5 ->
sql {
server_name (sprintf "server%d" i)
db_name (sprintf "database%d" i)
server_name $"server{i}"
db_name $"database{i}"
admin_username "mradmin"
}
]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/bastion-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Bastion Host"
date: 2020-08-26T17:55:00-04:00
chapter: false
weight: 3
weight: 2
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/bing-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Bing Search"
date: 2021-01-29T07:33:46+01:00
chapter: false
weight: 4
weight: 2
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/cognitive-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Cognitive Services"
date: 2020-04-10T08:53:46+01:00
chapter: false
weight: 4
weight: 3
---

#### Overview
Expand Down
64 changes: 59 additions & 5 deletions docs/content/api-overview/resources/container-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Container Group"
date: 2020-04-30T19:30:59+02:00
chapter: false
weight: 5
weight: 3
---

#### Overview
Expand All @@ -11,16 +11,22 @@ The Container Group builder is used to create Azure Container Group instances.
* Container Group (`Microsoft.ContainerInstance/containerGroups`)

#### Builder Keywords
| Applies To | Keyword | Purpose |
|-|-|-|
| containerInstance | name | Sets the name of the Container Group instance. |
| containerInstance | image | Sets the container image. |
| Applies To | Keyword | Purpose |
|-------------------|---------|------------------------------------------|
| containerInstance | name | Sets the name of the container instance. |
| containerInstance | image | Sets the container image. |
| containerInstance | command | Sets the commands to execute within the container instance in exec form. |
| containerInstance | add_ports | Sets the ports the container exposes. |
| containerInstance | cpu_cores | Sets the maximum CPU cores the container may use. |
| containerInstance | memory | Sets the maximum gigabytes of memory the container may use. |
| containerInstance | env_vars | Sets a list of environment variables for the container. |
| containerInstance | add_volume_mount | Adds a volume mount on a container from a volume in the container group. |
| initContainer | name | Sets the name of the init container. |
| initContainer | image | Sets the init container image. |
| initContainer | command | Sets the commands to execute within the init container in exec form. |
| initContainer | env_vars | Sets a list of environment variables for the init container. |
| initContainer | add_volume_mount | Adds a volume mount on an init container from a volume in the container group. |
| containerGroup | name | Sets the name of the container group. |
| containerGroup | add_instances | Adds container instances to the group. |
| containerGroup | operating_system | Sets the OS type (default Linux). |
| containerGroup | restart_policy | Sets the restart policy (default Always) |
Expand Down Expand Up @@ -153,4 +159,52 @@ let group = containerGroup {
add_instances [ wordcount ]
}
```
#### Using an initContainer on startup

An initContainer will run on container group startup before any of the containers are executed.

If there are any issues with the initContainer, it will remain in a 'Creating' state indefinitely. Check
for issues by viewing the logs for the init container(s):

`az container logs -g resource-group-name -n container-group-name --container-name init-container-name`

The example below creates a volume mount that is shared between the initContainer and the container
instances. It writes to a file so that the nginx container can serve that file once the group is running.

```fsharp
arm {
location Location.WestEurope
add_resources [
containerGroup {
name "container-group-with-init"
operating_system Linux
restart_policy ContainerGroup.AlwaysRestart
add_volumes [
volume_mount.empty_dir "html"
]
add_init_containers [
initContainer {
name "write-index-file"
image "debian"
add_volume_mount "html" "/usr/share/nginx/html"
command_line [
"/bin/sh"
"-c"
"mkdir -p /usr/share/nginx/html && echo 'hello there' >> /usr/share/nginx/html/index.html"
]
}
]
add_instances [
containerInstance {
name "nginx"
image "nginx:alpine"
add_volume_mount "html" "/usr/share/nginx/html"
add_public_ports [ 80us; 443us ]
memory 0.5<Gb>
cpu_cores 0.2
}
]
}
]
}
```
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/container-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Container Registry"
date: 2020-04-30T19:10:46+02:00
chapter: false
weight: 6
weight: 3
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/cosmos-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Cosmos DB"
date: 2020-02-05T08:53:46+01:00
chapter: false
weight: 7
weight: 3
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/data-lake.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Data Lake"
date: 2020-06-11T00:55:30+02:00
chapter: false
weight: 8
weight: 4
---

#### Overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Databricks Workspace"
date: 2021-01-31T15:43:30+00:00
chapter: false
weight: 8
weight: 4
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/deployment-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Deployment Script"
date: 2020-10-22T15:19:14.3221080-04:00
chapter: false
weight: 5
weight: 4
---

#### Overview
Expand Down
59 changes: 59 additions & 0 deletions docs/content/api-overview/resources/diagnosticsetting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: " Diagnostic Settings "
date: 2020-12-02T12:10:03 +00:00
chapter: false
weight: 4
---

#### Overview

The Diagnostic Settings builder is used to create diagnostic settings instances to send platform logs and metrics to different destinations (storage, event hub and log analytics). Support for Farmer builders and external resources is supported.

- Diagnostic Settings (`providers/diagnosticSettings`)

#### Builder Keywords

| Keyword | Purpose|
|-|-|
| name | Sets the name of the Diagnostic Settings resource. |
| metrics_source | The resource that will be used for the source of logging and metrics information. Can be any Builder, or you can supply a ResourceId for an external resource. |
| capture_metrics | Specifies the list of Metrics to capture from the source resource. |
| capture_logs | Specifies the list of Log Categories to capture from the source resource. |
| add_destination | Adds a destination for all logs and metrics, either a storage account, log analytics workspacce, event hub or a Resource ID pointing to any valid Resource for those three resource types. |
| event_hub_destination_name | Allows you to override the event hub name to use. |
| loganalytics_output_type | If a Log Analytics Workspace is specified as output, specifies whether to use the default Azure Diagnostics grouping or a dedicated grouping for logging and metrics. |

#### Example
The example below illustrates how to create a web application and set up a diagnostics setting against it,
whilst setting up three destinations for the diagnostics (storage, event hub and log analytics). Also notice
the using of the `Logging.` namespace, which contains all documented Logging categories.

```fsharp
open Farmer
open Farmer.Builders
open Farmer.DiagnosticSettings
let data = storageAccount { name "isaacsuperdata" }
let hub = eventHub { name "isaacsuperhub" }
let logs = logAnalytics { name "isaacsuperlogs" }
let web = webApp { name "isaacdiagsuperweb"; app_insights_off }
let mydiagnosticSetting = diagnosticSettings {
name "myDiagnosticSetting"
metrics_source web
add_destination data
add_destination logs
add_destination hub
loganalytics_output_type Dedicated
capture_metrics [ "AllMetrics" ]
capture_logs [
Logging.Web.Sites.AppServicePlatformLogs
Logging.Web.Sites.AppServiceAntivirusScanAuditLogs
]
}
let deployment = arm {
add_resources [ data; web; hub; logs; mydiagnosticSetting ]
}
```
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "DNS Zone"
date: 2020-09-14T18:53:46+01:00
chapter: false
weight: 8
weight: 4
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/event-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Event Grid"
date: 2020-07-06T20:00:00+01:00
chapter: false
weight: 9
weight: 5
---

## Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/event-hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Event Hub"
date: 2020-02-23T20:00:00+01:00
chapter: false
weight: 10
weight: 5
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/express-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "ExpressRoute"
date: 2020-06-07T21:57:00+01:00
chapter: false
weight: 11
weight: 5
---

#### Overview
Expand Down
3 changes: 2 additions & 1 deletion docs/content/api-overview/resources/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Functions"
date: 2020-02-05T08:53:46+01:00
chapter: false
weight: 12
weight: 6
---

#### Overview
Expand Down Expand Up @@ -40,6 +40,7 @@ The Functions builder is used to create Azure Functions accounts. It abstracts t
| add_identity | Adds a managed identity to the the Function App. |
| system_identity | Activates the system identity of the Function App. |
| always_on | Stops the app from sleeping if idle for a few minutes of inactivity. |
| worker_process | Specifies whether to set the app to 32 or 64 Bitness. |

#### Post-deployment Builder Keywords
The Functions builder contains special commands that are executed *after* the ARM deployment is completed.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/iot-hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "IOT Hub"
date: 2020-05-19T23:14:14+02:00
chapter: false
weight: 13
weight: 9
---

#### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/keyvault.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Key Vault"
date: 2020-02-05T08:53:46+01:00
chapter: false
weight: 14
weight: 11
---

### Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api-overview/resources/loganalytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Log Analytics"
date: 2020-10-7T19:10:46+02:00
chapter: false
weight: 14
weight: 12
---

#### Overview
Expand Down
Loading

0 comments on commit c0675eb

Please sign in to comment.