From bc5078d456b79ded7f42cd5305c27b4a785a768c Mon Sep 17 00:00:00 2001 From: JFolberth Date: Tue, 24 Nov 2020 15:56:20 -0500 Subject: [PATCH 1/7] adding windows web app --- docs/examples/101/web-app-windows/main.bicep | 44 +++++++++++++ docs/examples/101/web-app-windows/main.json | 66 ++++++++++++++++++++ src/playground/src/examples.ts | 2 + 3 files changed, 112 insertions(+) create mode 100644 docs/examples/101/web-app-windows/main.bicep create mode 100644 docs/examples/101/web-app-windows/main.json diff --git a/docs/examples/101/web-app-windows/main.bicep b/docs/examples/101/web-app-windows/main.bicep new file mode 100644 index 00000000000..c52a4442c30 --- /dev/null +++ b/docs/examples/101/web-app-windows/main.bicep @@ -0,0 +1,44 @@ +param skuName string = 'S1' +param skuCapacity int = 1 +param location string = resourceGroup().location +param appName string = uniqueString(resourceGroup().id) + +var appServicePlanName = toLower('asp-${appName}') +var webSiteName = toLower('wapp-${appName}') + +resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = { + name: appServicePlanName // Globally unique storage account name + location: location // Azure Region + sku: { + name: skuName + capacity: skuCapacity + } + tags: { + displayName: 'HostingPlan' + ProjectName: appName + } +} + +resource appService 'Microsoft.Web/sites@2020-06-01' = { + name: webSiteName + location: location + identity: { + type: 'SystemAssigned' + } + tags: { + displayName: 'Website' + ProjectName: appName + } + properties: { + serverFarmId: appServicePlan.id + httpsOnly: true + siteConfig: { + minTlsVersion: '1.2' + } + } +} + + + + + diff --git a/docs/examples/101/web-app-windows/main.json b/docs/examples/101/web-app-windows/main.json new file mode 100644 index 00000000000..95137439bc2 --- /dev/null +++ b/docs/examples/101/web-app-windows/main.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "skuName": { + "type": "string", + "defaultValue": "S1" + }, + "skuCapacity": { + "type": "int", + "defaultValue": 1 + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "appName": { + "type": "string", + "defaultValue": "[uniqueString(resourceGroup().id)]" + } + }, + "functions": [], + "variables": { + "appServicePlanName": "[toLower(format('asp-{0}', parameters('appName')))]", + "webSiteName": "[toLower(format('wapp-{0}', parameters('appName')))]" + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2020-06-01", + "name": "[variables('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": { + "name": "[parameters('skuName')]", + "capacity": "[parameters('skuCapacity')]" + }, + "tags": { + "displayName": "HostingPlan", + "ProjectName": "[parameters('appName')]" + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2020-06-01", + "name": "[variables('webSiteName')]", + "location": "[parameters('location')]", + "identity": { + "type": "SystemAssigned" + }, + "tags": { + "displayName": "Website", + "ProjectName": "[parameters('appName')]" + }, + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", + "httpsOnly": true, + "siteConfig": { + "minTlsVersion": "1.2" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" + ] + } + ] +} \ No newline at end of file diff --git a/src/playground/src/examples.ts b/src/playground/src/examples.ts index 13ca5c3aac7..a2cd04870fe 100644 --- a/src/playground/src/examples.ts +++ b/src/playground/src/examples.ts @@ -12,6 +12,7 @@ import example_101_vm_simple_linux from '../../../docs/examples/101/vm-simple-li import example_101_key_vault_secret_only from '../../../docs/examples/101/key-vault-secret-only/main.bicep' import example_101_website_with_container from '../../../docs/examples/101/website-with-container/main.bicep' import example_101_1vm_2nics_2subnets_1vnet from '../../../docs/examples/101/1vm-2nics-2subnets-1vnet/main.bicep' +import example_101_web_app_windows from '../../../docs/examples/101/web-app-windows/main.bicep' import example_201_vm_windows_with_custom_script_extension from '../../../docs/examples/201/vm-windows-with-custom-script-extension/main.bicep' import example_201_key_vault_secret_create from '../../../docs/examples/201/key-vault-secret-create/main.bicep' import example_201_vm_push_cert_windows from '../../../docs/examples/201/vm-push-cert-windows/main.bicep' @@ -59,6 +60,7 @@ export const examples = { '101/key-vault-secret-only': example_101_key_vault_secret_only, '101/website-with-container': example_101_website_with_container, '101/1vm-2nics-2subnets-1vnet': example_101_1vm_2nics_2subnets_1vnet, + '101/web-app-windows': example_101_web_app_windows, '201/vm-windows-with-custom-script-extension': example_201_vm_windows_with_custom_script_extension, '201/key-vault-secret-create': example_201_key_vault_secret_create, '201/vm-push-cert-windows': example_201_vm_push_cert_windows, From f5c9f678b8cf6bd0ca971a653570539a768c8fc3 Mon Sep 17 00:00:00 2001 From: JFolberth Date: Tue, 24 Nov 2020 16:17:21 -0500 Subject: [PATCH 2/7] formatted file --- docs/examples/101/web-app-windows/main.bicep | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/examples/101/web-app-windows/main.bicep b/docs/examples/101/web-app-windows/main.bicep index c52a4442c30..ecf23ddb390 100644 --- a/docs/examples/101/web-app-windows/main.bicep +++ b/docs/examples/101/web-app-windows/main.bicep @@ -36,9 +36,4 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = { minTlsVersion: '1.2' } } -} - - - - - +} \ No newline at end of file From 7f984259d3b6b94c056aaa9c2aefa85279d8e81a Mon Sep 17 00:00:00 2001 From: JFolberth Date: Tue, 24 Nov 2020 16:28:37 -0500 Subject: [PATCH 3/7] added new line at end of file --- docs/examples/101/web-app-windows/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/101/web-app-windows/main.bicep b/docs/examples/101/web-app-windows/main.bicep index ecf23ddb390..37bc92f8ed0 100644 --- a/docs/examples/101/web-app-windows/main.bicep +++ b/docs/examples/101/web-app-windows/main.bicep @@ -36,4 +36,4 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = { minTlsVersion: '1.2' } } -} \ No newline at end of file +} From fa59d76c773f54b66f825630f8154c23166a143d Mon Sep 17 00:00:00 2001 From: JFolberth Date: Tue, 24 Nov 2020 22:14:29 -0500 Subject: [PATCH 4/7] data-factory-v2-blob-to-blob-copy example --- .../main.bicep | 130 ++++++++++++++ .../main.json | 170 ++++++++++++++++++ src/Bicep.Core.Samples/ExamplesTests.cs | 11 +- src/playground/src/examples.ts | 2 + 4 files changed, 308 insertions(+), 5 deletions(-) create mode 100644 docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep create mode 100644 docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json diff --git a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep new file mode 100644 index 00000000000..f09b758cfed --- /dev/null +++ b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep @@ -0,0 +1,130 @@ +param systemName string = uniqueString(resourceGroup().id) +param location string = resourceGroup().location + +var dataFactoryName = 'df${systemName}' +var storageAccountName = 'sa${systemName}' +var blobContainerName = 'blob${systemName}' +var pipelineName = 'pipe${systemName}' +var dataFactoryLinkedServiceName = 'ArmtemplateStorageLinkedService' +var DataFactoryDataSetInName = 'ArmtemplateTestDatasetIn' +var DataFactoryDataSetOutName = 'ArmtemplateTestDatasetOut' + +resource storageAccount 'Microsoft.Storage/storageAccounts@2020-08-01-preview' = { + name: storageAccountName + location: location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' +} + +resource blobContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2020-08-01-preview' = { + name: '${storageAccount.name}/default/${blobContainerName}' +} + +resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = { + name: dataFactoryName + location: location + identity: { + type: 'SystemAssigned' + } +} + +resource dataFactoryLinkedService 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = { + name: '${dataFactory.name}/${dataFactoryLinkedServiceName}' + properties: { + type: 'AzureBlobStorage' + typeProperties: { + connectionString: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${listKeys(storageAccount.id, storageAccount.apiVersion).keys[0].value}' + } + } +} + +resource dataFactoryDataSetIn 'Microsoft.DataFactory/factories/datasets@2018-06-01' = { + name: '${dataFactory.name}/${DataFactoryDataSetInName}' + properties: { + linkedServiceName: { + referenceName: dataFactoryLinkedServiceName + type: 'LinkedServiceReference' + } + type: 'Binary' + typeProperties: { + location: { + type: 'AzureBlobStorageLocation' + container: blobContainer.name + folderPath: 'input' + fileName: 'emp.txt' + } + } + } +} +resource dataFactoryDataSetOut 'Microsoft.DataFactory/factories/datasets@2018-06-01' = { + name: '${dataFactory.name}/${DataFactoryDataSetOutName}' + properties: { + linkedServiceName: { + referenceName: dataFactoryLinkedServiceName + type: 'LinkedServiceReference' + } + type: 'Binary' + typeProperties: { + location: { + type: 'AzureBlobStorageLocation' + container: blobContainer.name + folderPath: 'output' + } + } + } +} + +resource dataFactoryPipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = { + name: '${dataFactory.name}/${pipelineName}' + properties: { + activities: [ + { + name: 'MyCopyActivity' + type: 'Copy' + policy: { + timeout: '7.00:00:00' + retry: 0 + retryIntervalInSeconds: 30 + secureOutput: false + secureInput: false + } + typeProperties: { + source: { + type: 'BinarySource' + storeSettings: { + type: 'AzureBlobStorageReadSettings' + recursive: true + } + } + sink: { + type: 'BinarySink' + storeSettings: { + type: 'AzureBlobStorageWriterSettings' + } + } + enableStaging: false + } + inputs: [ + { + referenceName: DataFactoryDataSetInName + type: 'DatasetReference' + properties: {} + } + ] + outputs: [ + { + referenceName: DataFactoryDataSetOutName + type: 'DatasetReference' + properties: {} + } + ] + } + ] + } + dependsOn: [ + dataFactoryDataSetIn + dataFactoryDataSetOut + ] +} diff --git a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json new file mode 100644 index 00000000000..f23a4a5ef7d --- /dev/null +++ b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json @@ -0,0 +1,170 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "systemName": { + "type": "string", + "defaultValue": "[uniqueString(resourceGroup().id)]" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + } + }, + "functions": [], + "variables": { + "dataFactoryName": "[format('df{0}', parameters('systemName'))]", + "storageAccountName": "[format('sa{0}', parameters('systemName'))]", + "blobContainerName": "[format('blob{0}', parameters('systemName'))]", + "pipelineName": "[format('pipe{0}', parameters('systemName'))]", + "dataFactoryLinkedServiceName": "ArmtemplateStorageLinkedService", + "DataFactoryDataSetInName": "ArmtemplateTestDatasetIn", + "DataFactoryDataSetOutName": "ArmtemplateTestDatasetOut" + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2020-08-01-preview", + "name": "[variables('storageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS" + }, + "kind": "StorageV2" + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "2020-08-01-preview", + "name": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" + ] + }, + { + "type": "Microsoft.DataFactory/factories", + "apiVersion": "2018-06-01", + "name": "[variables('dataFactoryName')]", + "location": "[parameters('location')]", + "identity": { + "type": "SystemAssigned" + } + }, + { + "type": "Microsoft.DataFactory/factories/linkedservices", + "apiVersion": "2018-06-01", + "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('dataFactoryLinkedServiceName'))]", + "properties": { + "type": "AzureBlobStorage", + "typeProperties": { + "connectionString": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2020-08-01-preview').keys[0].value)]" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]", + "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" + ] + }, + { + "type": "Microsoft.DataFactory/factories/datasets", + "apiVersion": "2018-06-01", + "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName'))]", + "properties": { + "linkedServiceName": { + "referenceName": "[variables('dataFactoryLinkedServiceName')]", + "type": "LinkedServiceReference" + }, + "type": "Binary", + "typeProperties": { + "location": { + "type": "AzureBlobStorageLocation", + "container": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", + "folderPath": "input", + "fileName": "emp.txt" + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[0], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[1], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[2])]", + "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]" + ] + }, + { + "type": "Microsoft.DataFactory/factories/datasets", + "apiVersion": "2018-06-01", + "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName'))]", + "properties": { + "linkedServiceName": { + "referenceName": "[variables('dataFactoryLinkedServiceName')]", + "type": "LinkedServiceReference" + }, + "type": "Binary", + "typeProperties": { + "location": { + "type": "AzureBlobStorageLocation", + "container": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", + "folderPath": "output" + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[0], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[1], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[2])]", + "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]" + ] + }, + { + "type": "Microsoft.DataFactory/factories/pipelines", + "apiVersion": "2018-06-01", + "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('pipelineName'))]", + "properties": { + "activities": [ + { + "name": "MyCopyActivity", + "type": "Copy", + "policy": { + "timeout": "7.00:00:00", + "retry": 0, + "retryIntervalInSeconds": 30, + "secureOutput": false, + "secureInput": false + }, + "typeProperties": { + "source": { + "type": "BinarySource", + "storeSettings": { + "type": "AzureBlobStorageReadSettings", + "recursive": true + } + }, + "sink": { + "type": "BinarySink", + "storeSettings": { + "type": "AzureBlobStorageWriterSettings" + } + }, + "enableStaging": false + }, + "inputs": [ + { + "referenceName": "[variables('DataFactoryDataSetInName')]", + "type": "DatasetReference", + "properties": {} + } + ], + "outputs": [ + { + "referenceName": "[variables('DataFactoryDataSetOutName')]", + "type": "DatasetReference", + "properties": {} + } + ] + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]", + "[resourceId('Microsoft.DataFactory/factories/datasets', split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName')), '/')[0], split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName')), '/')[1])]", + "[resourceId('Microsoft.DataFactory/factories/datasets', split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName')), '/')[0], split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName')), '/')[1])]" + ] + } + ] +} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/ExamplesTests.cs b/src/Bicep.Core.Samples/ExamplesTests.cs index 496a4a76a2d..ea683a36f83 100644 --- a/src/Bicep.Core.Samples/ExamplesTests.cs +++ b/src/Bicep.Core.Samples/ExamplesTests.cs @@ -85,18 +85,19 @@ private static bool IsPermittedMissingTypeDiagnostic(Diagnostic diagnostic) { "Resource type \"Microsoft.AppConfiguration/configurationStores@2020-07-01-preview\" does not have types available.", "Resource type \"Microsoft.AppConfiguration/configurationStores/keyValues@2020-07-01-preview\" does not have types available.", - "Resource type \"Microsoft.Web/sites/config@2018-11-01\" does not have types available.", + "Resource type \"Microsoft.DataFactory/factories/pipelines@2018-06-01\" does not have types available.", + "Resource type \"Microsoft.KeyVault/vaults@2019-06-01\" does not have types available.", "Resource type \"Microsoft.KeyVault/vaults/keys@2019-09-01\" does not have types available.", + "Resource type \"Microsoft.KeyVault/vaults/secrets@2019-09-01\" does not have types available.", "Resource type \"Microsoft.KeyVault/vaults/secrets@2018-02-14\" does not have types available.", - "Resource type \"microsoft.web/serverFarms@2018-11-01\" does not have types available.", + "Resource type \"microsoft.network/networkSecurityGroups@2020-08-01\" does not have types available.", "Resource type \"Microsoft.OperationalInsights/workspaces/providers/diagnosticSettings@2017-05-01-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers@2020-02-02-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers/databases@2020-02-02-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers/databases/transparentDataEncryption@2017-03-01-preview\" does not have types available.", + "Resource type \"microsoft.web/serverFarms@2018-11-01\" does not have types available.", + "Resource type \"Microsoft.Web/sites/config@2018-11-01\" does not have types available.", "Resource type \"Microsoft.Web/sites/config@2020-06-01\" does not have types available.", - "Resource type \"Microsoft.KeyVault/vaults/secrets@2019-09-01\" does not have types available.", - "Resource type \"Microsoft.KeyVault/vaults@2019-06-01\" does not have types available.", - "Resource type \"microsoft.network/networkSecurityGroups@2020-08-01\" does not have types available.", "Resource type \"Microsoft.Web/sites/siteextensions@2020-06-01\" does not have types available." }; diff --git a/src/playground/src/examples.ts b/src/playground/src/examples.ts index a2cd04870fe..562b35b737f 100644 --- a/src/playground/src/examples.ts +++ b/src/playground/src/examples.ts @@ -33,6 +33,7 @@ import example_101_container_registry from '../../../docs/examples/101/container import example_101_create_rg_lock_role_assignment from '../../../docs/examples/101/create-rg-lock-role-assignment/main.bicep' import example_101_function_app_create from '../../../docs/examples/101/function-app-create/main.bicep' import example_101_redis_cache from '../../../docs/examples/101/redis-cache/main.bicep' +import example_101_data_factory_v2_blob_to_blob_copy from '../../../docs/examples/101/data-example_101_data_factory_v2_blob_to_blob_copy/main.bicep' import example_201_1vm_2nics_2subnets_1vnet from '../../../docs/examples/201/1vm-2nics-2subnets-1vnet/main.bicep' import example_201_aci_wordpress from '../../../docs/examples/201/aci-wordpress/main.bicep' import example_201_anchored_proximity_placement_group from '../../../docs/examples/201/anchored-proximity-placement-group/main.bicep' @@ -61,6 +62,7 @@ export const examples = { '101/website-with-container': example_101_website_with_container, '101/1vm-2nics-2subnets-1vnet': example_101_1vm_2nics_2subnets_1vnet, '101/web-app-windows': example_101_web_app_windows, + '101/data-factory-v2-blob-to-bloyb-copy': example_101_data_factory_v2_blob_to_blob_copy, '201/vm-windows-with-custom-script-extension': example_201_vm_windows_with_custom_script_extension, '201/key-vault-secret-create': example_201_key_vault_secret_create, '201/vm-push-cert-windows': example_201_vm_push_cert_windows, From 3a70e45393fd5d1c6234e0ad3ffca54320243c74 Mon Sep 17 00:00:00 2001 From: JFolberth Date: Sun, 29 Nov 2020 20:13:56 -0500 Subject: [PATCH 5/7] fat fingered reference to new .bicep file --- src/playground/src/examples.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playground/src/examples.ts b/src/playground/src/examples.ts index 562b35b737f..947edce01b5 100644 --- a/src/playground/src/examples.ts +++ b/src/playground/src/examples.ts @@ -33,7 +33,7 @@ import example_101_container_registry from '../../../docs/examples/101/container import example_101_create_rg_lock_role_assignment from '../../../docs/examples/101/create-rg-lock-role-assignment/main.bicep' import example_101_function_app_create from '../../../docs/examples/101/function-app-create/main.bicep' import example_101_redis_cache from '../../../docs/examples/101/redis-cache/main.bicep' -import example_101_data_factory_v2_blob_to_blob_copy from '../../../docs/examples/101/data-example_101_data_factory_v2_blob_to_blob_copy/main.bicep' +import example_101_data_factory_v2_blob_to_blob_copy from '../../../docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep' import example_201_1vm_2nics_2subnets_1vnet from '../../../docs/examples/201/1vm-2nics-2subnets-1vnet/main.bicep' import example_201_aci_wordpress from '../../../docs/examples/201/aci-wordpress/main.bicep' import example_201_anchored_proximity_placement_group from '../../../docs/examples/201/anchored-proximity-placement-group/main.bicep' @@ -62,7 +62,7 @@ export const examples = { '101/website-with-container': example_101_website_with_container, '101/1vm-2nics-2subnets-1vnet': example_101_1vm_2nics_2subnets_1vnet, '101/web-app-windows': example_101_web_app_windows, - '101/data-factory-v2-blob-to-bloyb-copy': example_101_data_factory_v2_blob_to_blob_copy, + '101/data-factory-v2-blob-to-blob-copy': example_101_data_factory_v2_blob_to_blob_copy, '201/vm-windows-with-custom-script-extension': example_201_vm_windows_with_custom_script_extension, '201/key-vault-secret-create': example_201_key_vault_secret_create, '201/vm-push-cert-windows': example_201_vm_push_cert_windows, From 87a184a8f4453a2ac1aa04b6f2a9df146f525881 Mon Sep 17 00:00:00 2001 From: JFolberth Date: Sun, 29 Nov 2020 20:34:00 -0500 Subject: [PATCH 6/7] reordered playground examples --- src/playground/src/examples.ts | 54 ++++++++++++++++------------------ 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/src/playground/src/examples.ts b/src/playground/src/examples.ts index 947edce01b5..fd9f5a3933f 100644 --- a/src/playground/src/examples.ts +++ b/src/playground/src/examples.ts @@ -33,7 +33,6 @@ import example_101_container_registry from '../../../docs/examples/101/container import example_101_create_rg_lock_role_assignment from '../../../docs/examples/101/create-rg-lock-role-assignment/main.bicep' import example_101_function_app_create from '../../../docs/examples/101/function-app-create/main.bicep' import example_101_redis_cache from '../../../docs/examples/101/redis-cache/main.bicep' -import example_101_data_factory_v2_blob_to_blob_copy from '../../../docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep' import example_201_1vm_2nics_2subnets_1vnet from '../../../docs/examples/201/1vm-2nics-2subnets-1vnet/main.bicep' import example_201_aci_wordpress from '../../../docs/examples/201/aci-wordpress/main.bicep' import example_201_anchored_proximity_placement_group from '../../../docs/examples/201/anchored-proximity-placement-group/main.bicep' @@ -47,50 +46,49 @@ import example_301_nested_vms_in_virtual_network from '../../../docs/examples/30 export const examples = { 'blank': '', - '101/vm-simple-windows': example_101_vm_simple_windows, - '101/logic-app-create': example_101_logic_app_create, - '101/storage-blob-container': example_101_storage_blob_container, - '101/vnet-two-subnets': example_101_vnet_two_subnets, + '101/1vm-2nics-2subnets-1vnet': example_101_1vm_2nics_2subnets_1vnet, + '101/app-config': example_101_app_config, + '101/aks': example_101_aks, + '101/aks-vmss-systemassigned-identity': example_101_aks_vmss_systemassigned_identity, + '101/basic-publicip': example_101_basic_publicip, + '101/container-registry': example_101_container_registry, '101/cosmosdb-webapp': example_101_cosmosdb_webapp, - '101/key-vault-create': example_101_key_vault_create, + '101/create-rg-lock-role-assignment': example_101_create_rg_lock_role_assignment, '101/databricks-workspace': example_101_databricks_workspace, '101/databricks-all-in-one-template-for-vnet-injection': example_101_databricks_all_in_one_template_for_vnet_injection, - '101/aks': example_101_aks, - '101/monitor-action-groups': example_101_monitor_action_groups, - '101/vm-simple-linux': example_101_vm_simple_linux, - '101/key-vault-secret-only': example_101_key_vault_secret_only, - '101/website-with-container': example_101_website_with_container, - '101/1vm-2nics-2subnets-1vnet': example_101_1vm_2nics_2subnets_1vnet, - '101/web-app-windows': example_101_web_app_windows, - '101/data-factory-v2-blob-to-blob-copy': example_101_data_factory_v2_blob_to_blob_copy, - '201/vm-windows-with-custom-script-extension': example_201_vm_windows_with_custom_script_extension, - '201/key-vault-secret-create': example_201_key_vault_secret_create, - '201/vm-push-cert-windows': example_201_vm_push_cert_windows, - '201/decrypt-running-windows-vm-without-aad': example_201_decrypt_running_windows_vm_without_aad, - '201/iot-with-storage': example_201_iot_with_storage, - '201/vnet-peering': example_201_vnet_peering, - '201/sql': example_201_sql, - '201/201-web-app-loganalytics': example_201_web_app_loganalytics, '101/deployment-script-with-storage': example_101_deployment_script_with_storage, '101/front-door-basic': example_101_front_door_basic, '101/front-door-custom-domain': example_101_front_door_custom_domain, '101/front-door-redirect': example_101_front_door_redirect, - '101/mg-policy': example_101_mg_policy, - '101/aks-vmss-systemassigned-identity': example_101_aks_vmss_systemassigned_identity, - '101/app-config': example_101_app_config, - '101/basic-publicip': example_101_basic_publicip, - '101/container-registry': example_101_container_registry, - '101/create-rg-lock-role-assignment': example_101_create_rg_lock_role_assignment, '101/function-app-create': example_101_function_app_create, + '101/logic-app-create': example_101_logic_app_create, + '101/key-vault-create': example_101_key_vault_create, + '101/key-vault-secret-only': example_101_key_vault_secret_only, + '101/mg-policy': example_101_mg_policy, + '101/monitor-action-groups': example_101_monitor_action_groups, '101/redis-cache': example_101_redis_cache, + '101/storage-blob-container': example_101_storage_blob_container, + '101/website-with-container': example_101_website_with_container, + '101/web-app-windows': example_101_web_app_windows, + '101/vm-simple-linux': example_101_vm_simple_linux, + '101/vm-simple-windows': example_101_vm_simple_windows, + '101/vnet-two-subnets': example_101_vnet_two_subnets, '201/1vm-2nics-2subnets-1vnet': example_201_1vm_2nics_2subnets_1vnet, '201/aci-wordpress': example_201_aci_wordpress, '201/anchored-proximity-placement-group': example_201_anchored_proximity_placement_group, '201/cyclecloud': example_201_cyclecloud, + '201/decrypt-running-windows-vm-without-aad': example_201_decrypt_running_windows_vm_without_aad, '201/firewall-with-ip-from-prefix': example_201_firewall_with_ip_from_prefix, + '201/iot-with-storage': example_201_iot_with_storage, + '201/key-vault-secret-create': example_201_key_vault_secret_create, '201/log-analytics-with-solutions-and-diagnostics': example_201_log_analytics_with_solutions_and_diagnostics, '201/policy-with-initiative-definition-and-assignment': example_201_policy_with_initiative_definition_and_assignment, + '201/sql': example_201_sql, + '201/vm-push-cert-windows': example_201_vm_push_cert_windows, + '201/vm-windows-with-custom-script-extension': example_201_vm_windows_with_custom_script_extension, + '201/vnet-peering': example_201_vnet_peering, '201/vnet-to-vnet-bgp': example_201_vnet_to_vnet_bgp, '201/vwan-shared-services': example_201_vwan_shared_services, + '201/web-app-loganalytics': example_201_web_app_loganalytics, '301/nested-vms-in-virtual-network': example_301_nested_vms_in_virtual_network } \ No newline at end of file From d06dc215b30a5ab51bf7f180245d3390b5e914b1 Mon Sep 17 00:00:00 2001 From: JFolberth Date: Sun, 29 Nov 2020 20:36:57 -0500 Subject: [PATCH 7/7] Match from bad branch --- .../main.bicep | 130 -------------- .../main.json | 170 ------------------ src/Bicep.Core.Samples/ExamplesTests.cs | 15 +- 3 files changed, 8 insertions(+), 307 deletions(-) delete mode 100644 docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep delete mode 100644 docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json diff --git a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep deleted file mode 100644 index f09b758cfed..00000000000 --- a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.bicep +++ /dev/null @@ -1,130 +0,0 @@ -param systemName string = uniqueString(resourceGroup().id) -param location string = resourceGroup().location - -var dataFactoryName = 'df${systemName}' -var storageAccountName = 'sa${systemName}' -var blobContainerName = 'blob${systemName}' -var pipelineName = 'pipe${systemName}' -var dataFactoryLinkedServiceName = 'ArmtemplateStorageLinkedService' -var DataFactoryDataSetInName = 'ArmtemplateTestDatasetIn' -var DataFactoryDataSetOutName = 'ArmtemplateTestDatasetOut' - -resource storageAccount 'Microsoft.Storage/storageAccounts@2020-08-01-preview' = { - name: storageAccountName - location: location - sku: { - name: 'Standard_LRS' - } - kind: 'StorageV2' -} - -resource blobContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2020-08-01-preview' = { - name: '${storageAccount.name}/default/${blobContainerName}' -} - -resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = { - name: dataFactoryName - location: location - identity: { - type: 'SystemAssigned' - } -} - -resource dataFactoryLinkedService 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = { - name: '${dataFactory.name}/${dataFactoryLinkedServiceName}' - properties: { - type: 'AzureBlobStorage' - typeProperties: { - connectionString: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${listKeys(storageAccount.id, storageAccount.apiVersion).keys[0].value}' - } - } -} - -resource dataFactoryDataSetIn 'Microsoft.DataFactory/factories/datasets@2018-06-01' = { - name: '${dataFactory.name}/${DataFactoryDataSetInName}' - properties: { - linkedServiceName: { - referenceName: dataFactoryLinkedServiceName - type: 'LinkedServiceReference' - } - type: 'Binary' - typeProperties: { - location: { - type: 'AzureBlobStorageLocation' - container: blobContainer.name - folderPath: 'input' - fileName: 'emp.txt' - } - } - } -} -resource dataFactoryDataSetOut 'Microsoft.DataFactory/factories/datasets@2018-06-01' = { - name: '${dataFactory.name}/${DataFactoryDataSetOutName}' - properties: { - linkedServiceName: { - referenceName: dataFactoryLinkedServiceName - type: 'LinkedServiceReference' - } - type: 'Binary' - typeProperties: { - location: { - type: 'AzureBlobStorageLocation' - container: blobContainer.name - folderPath: 'output' - } - } - } -} - -resource dataFactoryPipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = { - name: '${dataFactory.name}/${pipelineName}' - properties: { - activities: [ - { - name: 'MyCopyActivity' - type: 'Copy' - policy: { - timeout: '7.00:00:00' - retry: 0 - retryIntervalInSeconds: 30 - secureOutput: false - secureInput: false - } - typeProperties: { - source: { - type: 'BinarySource' - storeSettings: { - type: 'AzureBlobStorageReadSettings' - recursive: true - } - } - sink: { - type: 'BinarySink' - storeSettings: { - type: 'AzureBlobStorageWriterSettings' - } - } - enableStaging: false - } - inputs: [ - { - referenceName: DataFactoryDataSetInName - type: 'DatasetReference' - properties: {} - } - ] - outputs: [ - { - referenceName: DataFactoryDataSetOutName - type: 'DatasetReference' - properties: {} - } - ] - } - ] - } - dependsOn: [ - dataFactoryDataSetIn - dataFactoryDataSetOut - ] -} diff --git a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json b/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json deleted file mode 100644 index f23a4a5ef7d..00000000000 --- a/docs/examples/101/data-factory-v2-blob-to-blob-copy/main.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "systemName": { - "type": "string", - "defaultValue": "[uniqueString(resourceGroup().id)]" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - } - }, - "functions": [], - "variables": { - "dataFactoryName": "[format('df{0}', parameters('systemName'))]", - "storageAccountName": "[format('sa{0}', parameters('systemName'))]", - "blobContainerName": "[format('blob{0}', parameters('systemName'))]", - "pipelineName": "[format('pipe{0}', parameters('systemName'))]", - "dataFactoryLinkedServiceName": "ArmtemplateStorageLinkedService", - "DataFactoryDataSetInName": "ArmtemplateTestDatasetIn", - "DataFactoryDataSetOutName": "ArmtemplateTestDatasetOut" - }, - "resources": [ - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2020-08-01-preview", - "name": "[variables('storageAccountName')]", - "location": "[parameters('location')]", - "sku": { - "name": "Standard_LRS" - }, - "kind": "StorageV2" - }, - { - "type": "Microsoft.Storage/storageAccounts/blobServices/containers", - "apiVersion": "2020-08-01-preview", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.DataFactory/factories", - "apiVersion": "2018-06-01", - "name": "[variables('dataFactoryName')]", - "location": "[parameters('location')]", - "identity": { - "type": "SystemAssigned" - } - }, - { - "type": "Microsoft.DataFactory/factories/linkedservices", - "apiVersion": "2018-06-01", - "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('dataFactoryLinkedServiceName'))]", - "properties": { - "type": "AzureBlobStorage", - "typeProperties": { - "connectionString": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2020-08-01-preview').keys[0].value)]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.DataFactory/factories/datasets", - "apiVersion": "2018-06-01", - "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName'))]", - "properties": { - "linkedServiceName": { - "referenceName": "[variables('dataFactoryLinkedServiceName')]", - "type": "LinkedServiceReference" - }, - "type": "Binary", - "typeProperties": { - "location": { - "type": "AzureBlobStorageLocation", - "container": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", - "folderPath": "input", - "fileName": "emp.txt" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[0], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[1], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[2])]", - "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]" - ] - }, - { - "type": "Microsoft.DataFactory/factories/datasets", - "apiVersion": "2018-06-01", - "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName'))]", - "properties": { - "linkedServiceName": { - "referenceName": "[variables('dataFactoryLinkedServiceName')]", - "type": "LinkedServiceReference" - }, - "type": "Binary", - "typeProperties": { - "location": { - "type": "AzureBlobStorageLocation", - "container": "[format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName'))]", - "folderPath": "output" - } - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[0], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[1], split(format('{0}/default/{1}', variables('storageAccountName'), variables('blobContainerName')), '/')[2])]", - "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]" - ] - }, - { - "type": "Microsoft.DataFactory/factories/pipelines", - "apiVersion": "2018-06-01", - "name": "[format('{0}/{1}', variables('dataFactoryName'), variables('pipelineName'))]", - "properties": { - "activities": [ - { - "name": "MyCopyActivity", - "type": "Copy", - "policy": { - "timeout": "7.00:00:00", - "retry": 0, - "retryIntervalInSeconds": 30, - "secureOutput": false, - "secureInput": false - }, - "typeProperties": { - "source": { - "type": "BinarySource", - "storeSettings": { - "type": "AzureBlobStorageReadSettings", - "recursive": true - } - }, - "sink": { - "type": "BinarySink", - "storeSettings": { - "type": "AzureBlobStorageWriterSettings" - } - }, - "enableStaging": false - }, - "inputs": [ - { - "referenceName": "[variables('DataFactoryDataSetInName')]", - "type": "DatasetReference", - "properties": {} - } - ], - "outputs": [ - { - "referenceName": "[variables('DataFactoryDataSetOutName')]", - "type": "DatasetReference", - "properties": {} - } - ] - } - ] - }, - "dependsOn": [ - "[resourceId('Microsoft.DataFactory/factories', variables('dataFactoryName'))]", - "[resourceId('Microsoft.DataFactory/factories/datasets', split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName')), '/')[0], split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetInName')), '/')[1])]", - "[resourceId('Microsoft.DataFactory/factories/datasets', split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName')), '/')[0], split(format('{0}/{1}', variables('dataFactoryName'), variables('DataFactoryDataSetOutName')), '/')[1])]" - ] - } - ] -} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/ExamplesTests.cs b/src/Bicep.Core.Samples/ExamplesTests.cs index ea683a36f83..1f235b39f04 100644 --- a/src/Bicep.Core.Samples/ExamplesTests.cs +++ b/src/Bicep.Core.Samples/ExamplesTests.cs @@ -85,20 +85,21 @@ private static bool IsPermittedMissingTypeDiagnostic(Diagnostic diagnostic) { "Resource type \"Microsoft.AppConfiguration/configurationStores@2020-07-01-preview\" does not have types available.", "Resource type \"Microsoft.AppConfiguration/configurationStores/keyValues@2020-07-01-preview\" does not have types available.", - "Resource type \"Microsoft.DataFactory/factories/pipelines@2018-06-01\" does not have types available.", - "Resource type \"Microsoft.KeyVault/vaults@2019-06-01\" does not have types available.", + "Resource type \"Microsoft.Web/sites/config@2018-11-01\" does not have types available.", "Resource type \"Microsoft.KeyVault/vaults/keys@2019-09-01\" does not have types available.", - "Resource type \"Microsoft.KeyVault/vaults/secrets@2019-09-01\" does not have types available.", "Resource type \"Microsoft.KeyVault/vaults/secrets@2018-02-14\" does not have types available.", - "Resource type \"microsoft.network/networkSecurityGroups@2020-08-01\" does not have types available.", + "Resource type \"microsoft.web/serverFarms@2018-11-01\" does not have types available.", "Resource type \"Microsoft.OperationalInsights/workspaces/providers/diagnosticSettings@2017-05-01-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers@2020-02-02-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers/databases@2020-02-02-preview\" does not have types available.", "Resource type \"Microsoft.Sql/servers/databases/transparentDataEncryption@2017-03-01-preview\" does not have types available.", - "Resource type \"microsoft.web/serverFarms@2018-11-01\" does not have types available.", - "Resource type \"Microsoft.Web/sites/config@2018-11-01\" does not have types available.", "Resource type \"Microsoft.Web/sites/config@2020-06-01\" does not have types available.", - "Resource type \"Microsoft.Web/sites/siteextensions@2020-06-01\" does not have types available." + "Resource type \"Microsoft.KeyVault/vaults/secrets@2019-09-01\" does not have types available.", + "Resource type \"Microsoft.KeyVault/vaults@2019-06-01\" does not have types available.", + "Resource type \"microsoft.network/networkSecurityGroups@2020-08-01\" does not have types available.", + "Resource type \"Microsoft.Web/sites/siteextensions@2020-06-01\" does not have types available.", + "Resource type \"Microsoft.DesktopVirtualization/hostpools/providers/diagnosticSettings@2017-05-01-preview\" does not have types available.", + "Resource type \"Microsoft.DesktopVirtualization/workspaces/providers/diagnosticSettings@2017-05-01-preview\" does not have types available." }; return permittedMissingTypeDiagnostics.Contains(diagnostic.Message);