diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3f73ce47e..25e82323d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,11 @@ Release Notes ============= +## 1.7.12 +* Maintenance: Updating Azure API versions to latest + +## 1.7.11 +* Dedicated Hosts: Support for Host Groups and Hosts +* WebApps: Added support for Node 14, 16 and 18 ## 1.7.10 * Container Groups and Container Apps: Support for link_to_identity for ACR managed identities. diff --git a/docs/content/api-overview/expressions.md b/docs/content/api-overview/expressions.md index 1b7296513..9b9ca0f16 100644 --- a/docs/content/api-overview/expressions.md +++ b/docs/content/api-overview/expressions.md @@ -32,7 +32,7 @@ This will be written to the ARM template file as follows: "appSettings": [ { "name": "storageKey", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=myStorageAccount;AccountKey=', listKeys('myStorageAccount', '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=myStorageAccount;AccountKey=', listKeys('myStorageAccount', '2022-05-01').keys[0].value)]" } ``` diff --git a/docs/content/api-overview/parameters.md b/docs/content/api-overview/parameters.md index 343cc816a..e37ecc16a 100644 --- a/docs/content/api-overview/parameters.md +++ b/docs/content/api-overview/parameters.md @@ -41,7 +41,7 @@ This will generate an ARM template which looks as follows (irrelevant content is }, "resources": [ { - "apiVersion": "2014-04-01-preview", + "apiVersion": "2021-11-01", "name": "myserver", "properties": { "administratorLogin": "mradmin", diff --git a/docs/content/contributing/arm-basics.md b/docs/content/contributing/arm-basics.md index 913bda2a5..59898aa7d 100644 --- a/docs/content/contributing/arm-basics.md +++ b/docs/content/contributing/arm-basics.md @@ -48,6 +48,6 @@ Your resource you create will have a [type of service](https://docs.microsoft.co ### Where can I find docs on ARM templates schemas themselves? There are three good sources to learning about specific ARM resources and what parts need to be used in creating an equivalent Farmer resource: -* **Reference Docs**: The reference documentation contains details on the schema for every resource and every version e.g. [Container Registry](https://docs.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2017-10-01/registries) reference. +* **Reference Docs**: The reference documentation contains details on the schema for every resource and every version e.g. [Container Registry](https://docs.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2021-09-01/registries) reference. * **Sample Template**: The Azure Quickstart Templates github repository contains many examples of real-world ARM templates e.g. [Container Registry with Geo Replication](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.containerregistry/container-registry-geo-replication) sample. * **Reverse engineer**: You can manually create a required resource in Azure, and then use Azure's [export ARM template](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/export-template-portal) functionality to create an ARM template. It's important that you test out the exported template yourself before porting it to Farmer, because Azure sometimes exports invalid templates! diff --git a/docs/content/contributing/outputs-and-expressions.md b/docs/content/contributing/outputs-and-expressions.md index 0bc6c16d8..2a83fc9b0 100644 --- a/docs/content/contributing/outputs-and-expressions.md +++ b/docs/content/contributing/outputs-and-expressions.md @@ -16,7 +16,7 @@ Farmer ARM expressions are in reality just wrapped strings, and are easy to crea let buildKey accountName : ArmExpression = // Create the raw string of the expression let rawValue = - $"concat('DefaultEndpointsProtocol=https;AccountName={accountName};AccountKey=', listKeys('{accountName}', '2017-10-01').keys[0].value)" + $"concat('DefaultEndpointsProtocol=https;AccountName={accountName};AccountKey=', listKeys('{accountName}', '2022-05-01').keys[0].value)" // Wrap the raw value in an ARM Expression and return it ArmExpression.create rawValue diff --git a/docs/content/quickstarts/quickstart-2.md b/docs/content/quickstarts/quickstart-2.md index b0d2cecb7..e9cdff696 100644 --- a/docs/content/quickstarts/quickstart-2.md +++ b/docs/content/quickstarts/quickstart-2.md @@ -75,7 +75,7 @@ Also observe the application setting that has been created: "appSettings": [ { "name": "storageKey", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=yourfirststorage;AccountKey=', listKeys('yourfirststorage', '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=yourfirststorage;AccountKey=', listKeys('yourfirststorage', '2022-05-01').keys[0].value)]" } ] } diff --git a/samples/scripts/template.json b/samples/scripts/template.json index 01d9f5ed7..320c91188 100644 --- a/samples/scripts/template.json +++ b/samples/scripts/template.json @@ -42,7 +42,7 @@ }, "resources": [ { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "westeurope", diff --git a/src/Farmer/Arm/App.fs b/src/Farmer/Arm/App.fs index ac67f275b..a0672afc7 100644 --- a/src/Farmer/Arm/App.fs +++ b/src/Farmer/Arm/App.fs @@ -71,7 +71,7 @@ type ManagedEnvironmentStorage = ShareName = share AccountName = accountName AccountKey = - $"[listKeys('Microsoft.Storage/storageAccounts/{accountName.ResourceName.Value}', '2018-07-01').keys[0].value]" + $"[listKeys('Microsoft.Storage/storageAccounts/{accountName.ResourceName.Value}', '2022-05-01').keys[0].value]" AccessMode = accessMode |} } diff --git a/src/Farmer/Arm/ContainerInstance.fs b/src/Farmer/Arm/ContainerInstance.fs index 5ee45dd84..c9706f97d 100644 --- a/src/Farmer/Arm/ContainerInstance.fs +++ b/src/Farmer/Arm/ContainerInstance.fs @@ -448,7 +448,7 @@ type ContainerGroup = shareName = shareName.Value storageAccountName = accountName.ResourceName.Value storageAccountKey = - $"[listKeys('Microsoft.Storage/storageAccounts/{accountName.ResourceName.Value}', '2018-07-01').keys[0].value]" + $"[listKeys('Microsoft.Storage/storageAccounts/{accountName.ResourceName.Value}', '2022-05-01').keys[0].value]" |} emptyDir = null gitRepo = Unchecked.defaultof<_> diff --git a/src/Farmer/Arm/EventGrid.fs b/src/Farmer/Arm/EventGrid.fs index 1d82ed3c7..e662f5180 100644 --- a/src/Farmer/Arm/EventGrid.fs +++ b/src/Farmer/Arm/EventGrid.fs @@ -4,11 +4,10 @@ module Farmer.Arm.EventGrid open Farmer open EventGrid -let systemTopics = - ResourceType("Microsoft.EventGrid/systemTopics", "2020-04-01-preview") +let systemTopics = ResourceType("Microsoft.EventGrid/systemTopics", "2022-06-15") let eventSubscriptions = - ResourceType("Microsoft.EventGrid/systemTopics/eventSubscriptions", "2020-04-01-preview") + ResourceType("Microsoft.EventGrid/systemTopics/eventSubscriptions", "2022-06-15") type TopicType = | TopicType of ResourceType * topic: string diff --git a/src/Farmer/Arm/Insights.fs b/src/Farmer/Arm/Insights.fs index 75ba72787..3d60341f1 100644 --- a/src/Farmer/Arm/Insights.fs +++ b/src/Farmer/Arm/Insights.fs @@ -7,7 +7,7 @@ let private createComponents version = ResourceType("Microsoft.Insights/components", version) /// Classic AI instance -let components = createComponents "2014-04-01" +let components = createComponents "2015-05-01" /// Workspace-enabled AI instance let componentsWorkspace = createComponents "2020-02-02" diff --git a/src/Farmer/Arm/KeyVault.fs b/src/Farmer/Arm/KeyVault.fs index 928205291..555bb0244 100644 --- a/src/Farmer/Arm/KeyVault.fs +++ b/src/Farmer/Arm/KeyVault.fs @@ -5,13 +5,13 @@ open Farmer open Farmer.KeyVault open System -let secrets = ResourceType("Microsoft.KeyVault/vaults/secrets", "2019-09-01") +let secrets = ResourceType("Microsoft.KeyVault/vaults/secrets", "2022-07-01") let accessPolicies = - ResourceType("Microsoft.KeyVault/vaults/accessPolicies", "2019-09-01") + ResourceType("Microsoft.KeyVault/vaults/accessPolicies", "2022-07-01") -let vaults = ResourceType("Microsoft.KeyVault/vaults", "2019-09-01") -let keys = ResourceType("Microsoft.keyVault/vaults/keys", "2019-09-01") +let vaults = ResourceType("Microsoft.KeyVault/vaults", "2022-07-01") +let keys = ResourceType("Microsoft.keyVault/vaults/keys", "2022-07-01") module Vaults = type Secret = diff --git a/src/Farmer/Arm/LogAnalytics.fs b/src/Farmer/Arm/LogAnalytics.fs index 4638f86fe..132a560e6 100644 --- a/src/Farmer/Arm/LogAnalytics.fs +++ b/src/Farmer/Arm/LogAnalytics.fs @@ -4,7 +4,7 @@ module Farmer.Arm.LogAnalytics open Farmer let workspaces = - ResourceType("Microsoft.OperationalInsights/workspaces", "2020-03-01-preview") + ResourceType("Microsoft.OperationalInsights/workspaces", "2022-10-01") type Workspace = { diff --git a/src/Farmer/Arm/RoleAssignment.fs b/src/Farmer/Arm/RoleAssignment.fs index cb990b501..60a747ec1 100644 --- a/src/Farmer/Arm/RoleAssignment.fs +++ b/src/Farmer/Arm/RoleAssignment.fs @@ -4,7 +4,7 @@ module Farmer.Arm.RoleAssignment open Farmer let roleAssignments = - ResourceType("Microsoft.Authorization/roleAssignments", "2021-04-01-preview") + ResourceType("Microsoft.Authorization/roleAssignments", "2022-04-01") [] type PrincipalType = diff --git a/src/Farmer/Arm/Sql.fs b/src/Farmer/Arm/Sql.fs index 7cd22e8c4..2bcf17266 100644 --- a/src/Farmer/Arm/Sql.fs +++ b/src/Farmer/Arm/Sql.fs @@ -5,19 +5,17 @@ open Farmer open Farmer.Sql open System.Net -let servers = ResourceType("Microsoft.Sql/servers", "2019-06-01-preview") +let servers = ResourceType("Microsoft.Sql/servers", "2021-11-01") -let elasticPools = - ResourceType("Microsoft.Sql/servers/elasticPools", "2017-10-01-preview") +let elasticPools = ResourceType("Microsoft.Sql/servers/elasticPools", "2021-11-01") let firewallRules = - ResourceType("Microsoft.Sql/servers/firewallrules", "2014-04-01") + ResourceType("Microsoft.Sql/servers/firewallrules", "2021-11-01") -let databases = - ResourceType("Microsoft.Sql/servers/databases", "2019-06-01-preview") +let databases = ResourceType("Microsoft.Sql/servers/databases", "2021-11-01") let transparentDataEncryption = - ResourceType("Microsoft.Sql/servers/databases/transparentDataEncryption", "2014-04-01-preview") + ResourceType("Microsoft.Sql/servers/databases/transparentDataEncryption", "2021-11-01") type DbKind = | Standalone of DbPurchaseModel diff --git a/src/Farmer/Arm/Storage.fs b/src/Farmer/Arm/Storage.fs index dc797c435..544e40fc4 100644 --- a/src/Farmer/Arm/Storage.fs +++ b/src/Farmer/Arm/Storage.fs @@ -5,37 +5,37 @@ open Farmer open Farmer.Storage let storageAccounts = - ResourceType("Microsoft.Storage/storageAccounts", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts", "2022-05-01") let blobServices = - ResourceType("Microsoft.Storage/storageAccounts/blobServices", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/blobServices", "2022-05-01") let containers = - ResourceType("Microsoft.Storage/storageAccounts/blobServices/containers", "2018-03-01-preview") + ResourceType("Microsoft.Storage/storageAccounts/blobServices/containers", "2022-05-01") let fileServices = - ResourceType("Microsoft.Storage/storageAccounts/fileServices", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/fileServices", "2022-05-01") let fileShares = - ResourceType("Microsoft.Storage/storageAccounts/fileServices/shares", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/fileServices/shares", "2022-05-01") let queueServices = - ResourceType("Microsoft.Storage/storageAccounts/queueServices", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/queueServices", "2022-05-01") let queues = - ResourceType("Microsoft.Storage/storageAccounts/queueServices/queues", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/queueServices/queues", "2022-05-01") let tableServices = - ResourceType("Microsoft.Storage/storageAccounts/tableServices", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/tableServices", "2022-05-01") let tables = - ResourceType("Microsoft.Storage/storageAccounts/tableServices/tables", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/tableServices/tables", "2022-05-01") let managementPolicies = - ResourceType("Microsoft.Storage/storageAccounts/managementPolicies", "2019-06-01") + ResourceType("Microsoft.Storage/storageAccounts/managementPolicies", "2022-05-01") let roleAssignments = - ResourceType("Microsoft.Storage/storageAccounts/providers/roleAssignments", "2018-09-01-preview") + ResourceType("Microsoft.Storage/storageAccounts/providers/roleAssignments", "2022-05-01") [] type NetworkRuleSetBypass = diff --git a/src/Farmer/Arm/Web.fs b/src/Farmer/Arm/Web.fs index 2f1b80dc4..7e22330c6 100644 --- a/src/Farmer/Arm/Web.fs +++ b/src/Farmer/Arm/Web.fs @@ -6,7 +6,7 @@ open Farmer.Identity open Farmer.WebApp open System -let serverFarms = ResourceType("Microsoft.Web/serverfarms", "2018-02-01") +let serverFarms = ResourceType("Microsoft.Web/serverfarms", "2022-03-01") let sites = ResourceType("Microsoft.Web/sites", "2021-03-01") let config = ResourceType("Microsoft.Web/sites/config", "2016-08-01") diff --git a/src/Farmer/Builders/Builders.Storage.fs b/src/Farmer/Builders/Builders.Storage.fs index 087739814..25fd39d84 100644 --- a/src/Farmer/Builders/Builders.Storage.fs +++ b/src/Farmer/Builders/Builders.Storage.fs @@ -13,7 +13,7 @@ type StorageAccount = /// Gets an ARM Expression connection string for any Storage Account. static member getConnectionString(storageAccount: ResourceId) = let expr = - $"concat('DefaultEndpointsProtocol=https;AccountName={storageAccount.Name.Value};AccountKey=', listKeys({storageAccount.ArmExpression.Value}, '2017-10-01').keys[0].value)" + $"concat('DefaultEndpointsProtocol=https;AccountName={storageAccount.Name.Value};AccountKey=', listKeys({storageAccount.ArmExpression.Value}, '2022-05-01').keys[0].value)" ArmExpression.create (expr, storageAccount) diff --git a/src/Tests/AppInsights.fs b/src/Tests/AppInsights.fs index b9b98a8f5..6b3e1d10a 100644 --- a/src/Tests/AppInsights.fs +++ b/src/Tests/AppInsights.fs @@ -20,7 +20,7 @@ let tests = Expect.equal ai.InstrumentationKey.Value - ("reference(resourceId('Microsoft.Insights/components', 'foo'), '2014-04-01').InstrumentationKey") + ("reference(resourceId('Microsoft.Insights/components', 'foo'), '2015-05-01').InstrumentationKey") "Incorrect Value" } @@ -28,7 +28,7 @@ let tests = let deployment = arm { add_resource (appInsights { name "foo" }) } let json = deployment.Template |> Writer.toJson |> JObject.Parse let version = json.SelectToken("resources[?(@.name=='foo')].apiVersion").ToString() - Expect.equal version "2014-04-01" "Incorrect API version" + Expect.equal version "2015-05-01" "Incorrect API version" } test "Create generated keys correctly" { @@ -39,7 +39,7 @@ let tests = Expect.equal generatedKey.Value - "reference(resourceId('group', 'Microsoft.Insights/components', 'foo'), '2014-04-01').InstrumentationKey" + "reference(resourceId('group', 'Microsoft.Insights/components', 'foo'), '2015-05-01').InstrumentationKey" "Incorrect generated key" } diff --git a/src/Tests/CognitiveServices.fs b/src/Tests/CognitiveServices.fs index 0ee4c1faf..b22e61736 100644 --- a/src/Tests/CognitiveServices.fs +++ b/src/Tests/CognitiveServices.fs @@ -27,7 +27,7 @@ let tests = add_tags [ "a", "1"; "b", "2" ] } - let model: Models.CognitiveServicesAccount = service |> getResourceAtIndex 0 + let model: Models.Account = service |> getResourceAtIndex 0 Expect.equal model.Name "test" "Name is wrong" Expect.equal model.Kind "TextAnalytics" "Kind is wrong" diff --git a/src/Tests/ContainerApps.fs b/src/Tests/ContainerApps.fs index 2a3b56f0d..74e327b9d 100644 --- a/src/Tests/ContainerApps.fs +++ b/src/Tests/ContainerApps.fs @@ -180,7 +180,7 @@ let tests = Expect.equal (kubeEnvLogAnalyticsCustomerId.["customerId"] |> string) - "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'containerlogs'), '2020-03-01-preview').customerId]" + "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'containerlogs'), '2022-10-01').customerId]" "Incorrect log analytics customerId reference" } diff --git a/src/Tests/ContainerGroup.fs b/src/Tests/ContainerGroup.fs index 7143a6671..3588cca3f 100644 --- a/src/Tests/ContainerGroup.fs +++ b/src/Tests/ContainerGroup.fs @@ -633,7 +633,7 @@ async { Expect.equal (firstEnvVar.["secureValue"] |> string) - "[concat('DefaultEndpointsProtocol=https;AccountName=containerdata1234;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'containerdata1234'), '2017-10-01').keys[0].value)]" + "[concat('DefaultEndpointsProtocol=https;AccountName=containerdata1234;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'containerdata1234'), '2022-05-01').keys[0].value)]" "Incorrect env var expression value" } test "Container with liveness and readiness probes" { @@ -1102,12 +1102,12 @@ async { Expect.equal (string workspaceId) - "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'containergrouplogs1234'), '2020-03-01-preview').customerId]" + "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'containergrouplogs1234'), '2022-10-01').customerId]" "Incorrect value for workspaceId" Expect.equal (string workspaceKey) - "[listkeys(resourceId('Microsoft.OperationalInsights/workspaces', 'containergrouplogs1234'), '2020-03-01-preview').primarySharedKey]" + "[listkeys(resourceId('Microsoft.OperationalInsights/workspaces', 'containergrouplogs1234'), '2022-10-01').primarySharedKey]" "Incorrect value for workspaceKey" Expect.equal (string logType) "ContainerInstanceLogs" "Incorrect value for workspaceId" @@ -1153,12 +1153,12 @@ async { Expect.equal (string workspaceId) - "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'my-log-analytics-workspace'), '2020-03-01-preview').customerId]" + "[reference(resourceId('Microsoft.OperationalInsights/workspaces', 'my-log-analytics-workspace'), '2022-10-01').customerId]" "Incorrect value for workspaceId" Expect.equal (string workspaceKey) - "[listkeys(resourceId('Microsoft.OperationalInsights/workspaces', 'my-log-analytics-workspace'), '2020-03-01-preview').primarySharedKey]" + "[listkeys(resourceId('Microsoft.OperationalInsights/workspaces', 'my-log-analytics-workspace'), '2022-10-01').primarySharedKey]" "Incorrect value for workspaceKey" Expect.equal (string logType) "ContainerInstanceLogs" "Incorrect value for workspaceId" diff --git a/src/Tests/ContainerService.fs b/src/Tests/ContainerService.fs index bdbd049d1..4a0cd5233 100644 --- a/src/Tests/ContainerService.fs +++ b/src/Tests/ContainerService.fs @@ -9,6 +9,7 @@ open Microsoft.Azure.Management.Compute.Models open Microsoft.Azure.Management.ContainerService open Microsoft.Rest open System +open Microsoft.Azure.Management.ContainerService.Models let dummyClient = new ContainerServiceClient(Uri "http://management.azure.com", TokenCredentials "NotNullOrWhiteSpace") @@ -31,13 +32,13 @@ let tests = let aks = template - |> findAzureResources dummyClient.SerializationSettings + |> findAzureResources dummyClient.SerializationSettings |> Seq.head Expect.equal aks.Name "aks-cluster" "" Expect.hasLength aks.AgentPoolProfiles 1 "" Expect.equal aks.AgentPoolProfiles.[0].Name "nodepool1" "" - Expect.equal aks.AgentPoolProfiles.[0].Count 3 "" + Expect.equal aks.AgentPoolProfiles.[0].Count (Nullable 3) "" let json = template.Template |> Writer.toJson let jobj = Newtonsoft.Json.Linq.JObject.Parse(json) @@ -57,13 +58,13 @@ let tests = let aks = template - |> findAzureResources dummyClient.SerializationSettings + |> findAzureResources dummyClient.SerializationSettings |> Seq.head Expect.equal aks.Name "aks-cluster" "" Expect.hasLength aks.AgentPoolProfiles 1 "" Expect.equal aks.AgentPoolProfiles.[0].Name "nodepool1" "" - Expect.equal aks.AgentPoolProfiles.[0].Count 3 "" + Expect.equal aks.AgentPoolProfiles.[0].Count (Nullable 3) "" let json = template.Template |> Writer.toJson let jobj = Newtonsoft.Json.Linq.JObject.Parse(json) @@ -100,13 +101,13 @@ let tests = let aks = arm { add_resource myAks } - |> findAzureResources dummyClient.SerializationSettings + |> findAzureResources dummyClient.SerializationSettings |> Seq.head Expect.equal aks.Name "k8s-cluster" "" Expect.hasLength aks.AgentPoolProfiles 1 "" Expect.equal aks.AgentPoolProfiles.[0].Name "linuxpool" "" - Expect.equal aks.AgentPoolProfiles.[0].Count 3 "" + Expect.equal aks.AgentPoolProfiles.[0].Count (Nullable 3) "" Expect.equal aks.AgentPoolProfiles.[0].VmSize "Standard_DS2_v2" "" Expect.equal aks.LinuxProfile.AdminUsername "aksuser" "" Expect.equal aks.LinuxProfile.Ssh.PublicKeys.Count 1 "" @@ -133,7 +134,7 @@ let tests = let aks = arm { add_resource myAks } - |> findAzureResources dummyClient.SerializationSettings + |> findAzureResources dummyClient.SerializationSettings |> Seq.head Expect.equal @@ -175,7 +176,7 @@ let tests = let aks = arm { add_resource myAks } - |> findAzureResources dummyClient.SerializationSettings + |> findAzureResources dummyClient.SerializationSettings |> Seq.head Expect.hasLength aks.AgentPoolProfiles 1 "" diff --git a/src/Tests/Functions.fs b/src/Tests/Functions.fs index d486e2b29..e9e4b635e 100644 --- a/src/Tests/Functions.fs +++ b/src/Tests/Functions.fs @@ -601,7 +601,7 @@ let tests = {| name = "AzureWebJobsDashboard" value = - "[concat('DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=', listKeys(resourceId('shared-group', 'Microsoft.Storage/storageAccounts', 'accountName'), '2017-10-01').keys[0].value)]" + "[concat('DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=', listKeys(resourceId('shared-group', 'Microsoft.Storage/storageAccounts', 'accountName'), '2022-05-01').keys[0].value)]" |} "Invalid value for AzureWebJobsDashboard" @@ -635,7 +635,7 @@ let tests = {| name = "APPINSIGHTS_INSTRUMENTATIONKEY" value = - "[reference(resourceId('shared-group', 'Microsoft.Insights/components', 'theName'), '2014-04-01').InstrumentationKey]" + "[reference(resourceId('shared-group', 'Microsoft.Insights/components', 'theName'), '2015-05-01').InstrumentationKey]" |} "Invalid value for APPINSIGHTS_INSTRUMENTATIONKEY" } diff --git a/src/Tests/JsonRegression.fs b/src/Tests/JsonRegression.fs index 650a50c25..5dc48bd2c 100644 --- a/src/Tests/JsonRegression.fs +++ b/src/Tests/JsonRegression.fs @@ -291,7 +291,7 @@ let tests = test "Can parse JSON into an ARM template" { let json = """ { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", diff --git a/src/Tests/ServiceBus.fs b/src/Tests/ServiceBus.fs index 8978e3229..6f03a1946 100644 --- a/src/Tests/ServiceBus.fs +++ b/src/Tests/ServiceBus.fs @@ -357,7 +357,7 @@ let tests = Expect.equal sbAuthorizationRule.Name "serviceBus/my-queue/my-rule" "Name is wrong" Expect.equal sbAuthorizationRule.Rights.Count 1 "Wrong number of rights" - Expect.equal sbAuthorizationRule.Rights.[0] (Nullable AccessRights.Manage) "Wrong rights" + Expect.equal sbAuthorizationRule.Rights.[0] (AccessRights.Manage) "Wrong rights" } test "Queue IArmResource has correct resourceId for unmanaged namespace" { @@ -836,7 +836,7 @@ let tests = Expect.equal sbAuthorizationRule.Name "serviceBus/my-rule" "Wrong name" Expect.equal sbAuthorizationRule.Rights.Count 1 "Wrong number of rights" - Expect.equal sbAuthorizationRule.Rights.[0] (Nullable AccessRights.Manage) "Wrong rights" + Expect.equal sbAuthorizationRule.Rights.[0] (AccessRights.Manage) "Wrong rights" } ] ] diff --git a/src/Tests/Sql.fs b/src/Tests/Sql.fs index bfb8f951d..9c47deb1c 100644 --- a/src/Tests/Sql.fs +++ b/src/Tests/Sql.fs @@ -59,7 +59,7 @@ let tests = ] } - let encryptionModel: Models.TransparentDataEncryption = + let encryptionModel: Models.ManagedTransparentDataEncryption = sql |> getResourceAtIndex client.SerializationSettings 2 Expect.equal encryptionModel.Name "server/db/current" "Should always equal to current" diff --git a/src/Tests/Storage.fs b/src/Tests/Storage.fs index 9ae1f15f2..fa7e92380 100644 --- a/src/Tests/Storage.fs +++ b/src/Tests/Storage.fs @@ -273,12 +273,12 @@ let tests = StorageAccount.getConnectionString (StorageAccountName.Create("account").OkValue, "rg") Expect.equal - "concat('DefaultEndpointsProtocol=https;AccountName=account;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'account'), '2017-10-01').keys[0].value)" + "concat('DefaultEndpointsProtocol=https;AccountName=account;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'account'), '2022-05-01').keys[0].value)" strongConn.Value "Strong connection string" Expect.equal - "concat('DefaultEndpointsProtocol=https;AccountName=account;AccountKey=', listKeys(resourceId('rg', 'Microsoft.Storage/storageAccounts', 'account'), '2017-10-01').keys[0].value)" + "concat('DefaultEndpointsProtocol=https;AccountName=account;AccountKey=', listKeys(resourceId('rg', 'Microsoft.Storage/storageAccounts', 'account'), '2022-05-01').keys[0].value)" rgConn.Value "Complex connection string" } @@ -316,7 +316,7 @@ let tests = Expect.equal builder.WebsitePrimaryEndpoint.Value - "reference(resourceId('Microsoft.Storage/storageAccounts', 'foo'), '2019-06-01').primaryEndpoints.web" + "reference(resourceId('Microsoft.Storage/storageAccounts', 'foo'), '2022-05-01').primaryEndpoints.web" "Zone names are not fixed and should be related to a storage account name" } test "Creates different SKU kinds correctly" { diff --git a/src/Tests/Tests.fsproj b/src/Tests/Tests.fsproj index e4b93ce88..6126e7028 100644 --- a/src/Tests/Tests.fsproj +++ b/src/Tests/Tests.fsproj @@ -67,33 +67,33 @@ - + - - + + - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/Tests/test-data/aks-with-acr.json b/src/Tests/test-data/aks-with-acr.json index 6aaa8ab46..042dc6ee8 100644 --- a/src/Tests/test-data/aks-with-acr.json +++ b/src/Tests/test-data/aks-with-acr.json @@ -77,7 +77,7 @@ "type": "Microsoft.ContainerService/managedClusters" }, { - "apiVersion": "2021-04-01-preview", + "apiVersion": "2022-04-01", "dependsOn": [ "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', 'clusterIdentity')]" ], @@ -90,7 +90,7 @@ "type": "Microsoft.Authorization/roleAssignments" }, { - "apiVersion": "2021-04-01-preview", + "apiVersion": "2022-04-01", "dependsOn": [ "[resourceId('Microsoft.ContainerRegistry/registries', 'farmercontainerregistry1234')]", "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', 'kubeletIdentity')]" diff --git a/src/Tests/test-data/diagnostics.json b/src/Tests/test-data/diagnostics.json index 90f488485..d631d671a 100644 --- a/src/Tests/test-data/diagnostics.json +++ b/src/Tests/test-data/diagnostics.json @@ -1,11 +1,11 @@ -{ + { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "outputs": {}, "parameters": {}, "resources": [ { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", @@ -18,7 +18,7 @@ "type": "Microsoft.Storage/storageAccounts" }, { - "apiVersion": "2018-02-01", + "apiVersion": "2022-03-01", "location": "northeurope", "name": "isaacdiagsuperweb-farm", "properties": { @@ -98,7 +98,7 @@ "type": "Microsoft.EventHub/namespaces/eventhubs" }, { - "apiVersion": "2020-03-01-preview", + "apiVersion": "2022-10-01", "location": "northeurope", "name": "isaacsuperlogs", "properties": { diff --git a/src/Tests/test-data/event-grid.json b/src/Tests/test-data/event-grid.json index 3eee581e3..b6d69c065 100644 --- a/src/Tests/test-data/event-grid.json +++ b/src/Tests/test-data/event-grid.json @@ -5,7 +5,7 @@ "parameters": {}, "resources": [ { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", @@ -18,7 +18,7 @@ "type": "Microsoft.Storage/storageAccounts" }, { - "apiVersion": "2018-03-01-preview", + "apiVersion": "2022-05-01", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', 'isaacgriddevprac')]" ], @@ -29,7 +29,7 @@ "type": "Microsoft.Storage/storageAccounts/blobServices/containers" }, { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', 'isaacgriddevprac')]" ], @@ -58,7 +58,7 @@ "type": "Microsoft.ServiceBus/namespaces/queues" }, { - "apiVersion": "2020-04-01-preview", + "apiVersion": "2022-06-15", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', 'isaacgriddevprac')]" ], @@ -72,7 +72,7 @@ "type": "Microsoft.EventGrid/systemTopics" }, { - "apiVersion": "2020-04-01-preview", + "apiVersion": "2022-06-15", "dependsOn": [ "[resourceId('Microsoft.EventGrid/systemTopics', 'newblobscreated')]", "[resourceId('Microsoft.ServiceBus/namespaces/queues', 'farmereventpubservicebusns', 'events')]" @@ -95,7 +95,7 @@ "type": "Microsoft.EventGrid/systemTopics/eventSubscriptions" }, { - "apiVersion": "2020-04-01-preview", + "apiVersion": "2022-06-15", "dependsOn": [ "[resourceId('Microsoft.EventGrid/systemTopics', 'newblobscreated')]", "[resourceId('Microsoft.Storage/storageAccounts/queueServices/queues', 'isaacgriddevprac', 'default', 'todo')]" @@ -118,4 +118,4 @@ "type": "Microsoft.EventGrid/systemTopics/eventSubscriptions" } ] -} +} \ No newline at end of file diff --git a/src/Tests/test-data/lots-of-resources.json b/src/Tests/test-data/lots-of-resources.json index 6c988cb30..6a0b3872f 100644 --- a/src/Tests/test-data/lots-of-resources.json +++ b/src/Tests/test-data/lots-of-resources.json @@ -1,4 +1,4 @@ -{ + { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "outputs": {}, @@ -12,7 +12,7 @@ }, "resources": [ { - "apiVersion": "2019-06-01-preview", + "apiVersion": "2021-11-01", "location": "northeurope", "name": "farmersql1979", "properties": { @@ -26,7 +26,7 @@ "type": "Microsoft.Sql/servers" }, { - "apiVersion": "2019-06-01-preview", + "apiVersion": "2021-11-01", "dependsOn": [ "[resourceId('Microsoft.Sql/servers', 'farmersql1979')]", "[resourceId('Microsoft.Sql/servers/elasticPools', 'farmersql1979', 'farmersql1979-pool')]" @@ -43,7 +43,7 @@ "type": "Microsoft.Sql/servers/databases" }, { - "apiVersion": "2014-04-01-preview", + "apiVersion": "2021-11-01", "comments": "Transparent Data Encryption", "dependsOn": [ "[resourceId('Microsoft.Sql/servers/databases', 'farmersql1979', 'farmertestdb')]" @@ -55,7 +55,7 @@ "type": "Microsoft.Sql/servers/databases/transparentDataEncryption" }, { - "apiVersion": "2014-04-01", + "apiVersion": "2021-11-01", "dependsOn": [ "[resourceId('Microsoft.Sql/servers', 'farmersql1979')]" ], @@ -68,7 +68,7 @@ "type": "Microsoft.Sql/servers/firewallrules" }, { - "apiVersion": "2017-10-01-preview", + "apiVersion": "2021-11-01", "dependsOn": [ "[resourceId('Microsoft.Sql/servers', 'farmersql1979')]" ], @@ -83,7 +83,7 @@ "type": "Microsoft.Sql/servers/elasticPools" }, { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", @@ -96,7 +96,7 @@ "type": "Microsoft.Storage/storageAccounts" }, { - "apiVersion": "2014-04-01", + "apiVersion": "2015-05-01", "dependsOn": [], "kind": "web", "location": "northeurope", @@ -114,7 +114,7 @@ "type": "Microsoft.Insights/components" }, { - "apiVersion": "2018-02-01", + "apiVersion": "2022-03-01", "location": "northeurope", "name": "farmerwebapp1979-farm", "properties": { @@ -157,7 +157,7 @@ "appSettings": [ { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", - "value": "[reference(resourceId('Microsoft.Insights/components', 'farmerwebapp1979-ai'), '2014-04-01').InstrumentationKey]" + "value": "[reference(resourceId('Microsoft.Insights/components', 'farmerwebapp1979-ai'), '2015-05-01').InstrumentationKey]" }, { "name": "APPINSIGHTS_PROFILERFEATURE_VERSION", @@ -205,7 +205,7 @@ "type": "Microsoft.Web/sites" }, { - "apiVersion": "2018-02-01", + "apiVersion": "2022-03-01", "location": "northeurope", "name": "farmerfuncs1979-farm", "properties": { @@ -223,7 +223,7 @@ "type": "Microsoft.Web/serverfarms" }, { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", @@ -236,7 +236,7 @@ "type": "Microsoft.Storage/storageAccounts" }, { - "apiVersion": "2014-04-01", + "apiVersion": "2015-05-01", "dependsOn": [], "kind": "web", "location": "northeurope", @@ -271,15 +271,15 @@ "appSettings": [ { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", - "value": "[reference(resourceId('Microsoft.Insights/components', 'farmerfuncs1979-ai'), '2014-04-01').InstrumentationKey]" + "value": "[reference(resourceId('Microsoft.Insights/components', 'farmerfuncs1979-ai'), '2015-05-01').InstrumentationKey]" }, { "name": "AzureWebJobsDashboard", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2022-05-01').keys[0].value)]" }, { "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2022-05-01').keys[0].value)]" }, { "name": "FUNCTIONS_EXTENSION_VERSION", @@ -291,7 +291,7 @@ }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=farmerfuncs1979storage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'farmerfuncs1979storage'), '2022-05-01').keys[0].value)]" }, { "name": "WEBSITE_CONTENTSHARE", @@ -409,12 +409,12 @@ "isHttpAllowed": true, "isHttpsAllowed": true, "optimizationType": "GeneralWebDelivery", - "originHostHeader": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', 'farmerstorage1979'), '2019-06-01').primaryEndpoints.web, 'https://', ''), '/', '')]", + "originHostHeader": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', 'farmerstorage1979'), '2022-05-01').primaryEndpoints.web, 'https://', ''), '/', '')]", "origins": [ { "name": "origin", "properties": { - "hostName": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', 'farmerstorage1979'), '2019-06-01').primaryEndpoints.web, 'https://', ''), '/', '')]" + "hostName": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', 'farmerstorage1979'), '2022-05-01').primaryEndpoints.web, 'https://', ''), '/', '')]" } } ], @@ -761,7 +761,7 @@ "type": "Microsoft.Resources/deployments" }, { - "apiVersion": "2018-02-01", + "apiVersion": "2022-03-01", "location": "northeurope", "name": "docker-func-farm", "properties": { @@ -779,7 +779,7 @@ "type": "Microsoft.Web/serverfarms" }, { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope", @@ -809,11 +809,11 @@ "appSettings": [ { "name": "AzureWebJobsDashboard", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2022-05-01').keys[0].value)]" }, { "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2022-05-01').keys[0].value)]" }, { "name": "DOCKER_REGISTRY_SERVER_PASSWORD", @@ -837,7 +837,7 @@ }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2017-10-01').keys[0].value)]" + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=dockerfuncstorage;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'dockerfuncstorage'), '2022-05-01').keys[0].value)]" }, { "name": "WEBSITE_CONTENTSHARE", diff --git a/src/Tests/test-data/vm.json b/src/Tests/test-data/vm.json index d6d08747e..f5be108bb 100644 --- a/src/Tests/test-data/vm.json +++ b/src/Tests/test-data/vm.json @@ -20,7 +20,7 @@ "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', 'isaacsvmstorage'), '2019-06-01').primaryEndpoints.blob]" + "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', 'isaacsvmstorage'), '2022-05-01').primaryEndpoints.blob]" } }, "hardwareProfile": { @@ -143,7 +143,7 @@ "type": "Microsoft.Network/publicIPAddresses" }, { - "apiVersion": "2019-06-01", + "apiVersion": "2022-05-01", "dependsOn": [], "kind": "StorageV2", "location": "northeurope",