Skip to content

Commit

Permalink
Update bicep version (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Apr 22, 2024
1 parent 86d6a65 commit 78fd7ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
DOTNET_VERSION: 6.0.x
BICEP_VERSION: 0.26.54
BICEP_VERSION: 0.26.170

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
DOTNET_VERSION: 6.0.x
BICEP_VERSION: 0.26.54
BICEP_VERSION: 0.26.170

jobs:
publish:
Expand Down
14 changes: 9 additions & 5 deletions azuredeploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var acmebotAppSettings = [
}
]

resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: storageAccountName
location: location
kind: 'Storage'
Expand All @@ -111,7 +111,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
}
}

resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
resource appServicePlan 'Microsoft.Web/serverfarms@2023-01-01' = {
name: appServicePlanName
location: location
sku: {
Expand All @@ -121,7 +121,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
properties: {}
}

resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
name: workspaceName
location: location
properties: {
Expand All @@ -145,7 +145,7 @@ resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
}
}

resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
resource functionApp 'Microsoft.Web/sites@2023-01-01' = {
name: functionAppName
location: location
kind: 'functionapp'
Expand All @@ -162,11 +162,15 @@ resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
ftpsState: 'Disabled'
minTlsVersion: '1.2'
scmMinTlsVersion: '1.2'
cors: {
allowedOrigins: ['https://portal.azure.com']
supportCredentials: false
}
}
}
}

resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = if (createWithKeyVault) {
resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' = if (createWithKeyVault) {
name: keyVaultName
location: location
properties: {
Expand Down
30 changes: 18 additions & 12 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "2724628433207629896"
"version": "0.26.170.59819",
"templateHash": "5662418896052070318"
}
},
"parameters": {
Expand Down Expand Up @@ -97,7 +97,7 @@
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"apiVersion": "2023-01-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"kind": "Storage",
Expand All @@ -112,7 +112,7 @@
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-03-01",
"apiVersion": "2023-01-01",
"name": "[variables('appServicePlanName')]",
"location": "[parameters('location')]",
"sku": {
Expand All @@ -123,7 +123,7 @@
},
{
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2022-10-01",
"apiVersion": "2023-09-01",
"name": "[variables('workspaceName')]",
"location": "[parameters('location')]",
"properties": {
Expand Down Expand Up @@ -152,7 +152,7 @@
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2022-03-01",
"apiVersion": "2023-01-01",
"name": "[variables('functionAppName')]",
"location": "[parameters('location')]",
"kind": "functionapp",
Expand All @@ -164,11 +164,17 @@
"httpsOnly": true,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
"siteConfig": {
"appSettings": "[concat(createArray(createObject('name', 'APPLICATIONINSIGHTS_CONNECTION_STRING', 'value', format('InstrumentationKey={0};EndpointSuffix={1}', reference(resourceId('Microsoft.Insights/components', variables('appInsightsName')), '2020-02-02').InstrumentationKey, variables('appInsightsEndpoints')[environment().name])), createObject('name', 'AzureWebJobsStorage', 'value', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2022-09-01').keys[0].value, environment().suffixes.storage)), createObject('name', 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING', 'value', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2022-09-01').keys[0].value, environment().suffixes.storage)), createObject('name', 'WEBSITE_CONTENTSHARE', 'value', toLower(variables('functionAppName'))), createObject('name', 'WEBSITE_RUN_FROM_PACKAGE', 'value', 'https://stacmebotprod.blob.core.windows.net/keyvault-acmebot/v4/latest.zip'), createObject('name', 'FUNCTIONS_EXTENSION_VERSION', 'value', '~4'), createObject('name', 'FUNCTIONS_WORKER_RUNTIME', 'value', 'dotnet'), createObject('name', 'Acmebot:Contacts', 'value', parameters('mailAddress')), createObject('name', 'Acmebot:Endpoint', 'value', parameters('acmeEndpoint')), createObject('name', 'Acmebot:VaultBaseUrl', 'value', if(parameters('createWithKeyVault'), format('https://{0}{1}', variables('keyVaultName'), environment().suffixes.keyvaultDns), parameters('keyVaultBaseUrl'))), createObject('name', 'Acmebot:Environment', 'value', environment().name)), parameters('additionalAppSettings'))]",
"appSettings": "[concat(createArray(createObject('name', 'APPLICATIONINSIGHTS_CONNECTION_STRING', 'value', format('InstrumentationKey={0};EndpointSuffix={1}', reference(resourceId('Microsoft.Insights/components', variables('appInsightsName')), '2020-02-02').InstrumentationKey, variables('appInsightsEndpoints')[environment().name])), createObject('name', 'AzureWebJobsStorage', 'value', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2023-01-01').keys[0].value, environment().suffixes.storage)), createObject('name', 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING', 'value', format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};EndpointSuffix={2}', variables('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2023-01-01').keys[0].value, environment().suffixes.storage)), createObject('name', 'WEBSITE_CONTENTSHARE', 'value', toLower(variables('functionAppName'))), createObject('name', 'WEBSITE_RUN_FROM_PACKAGE', 'value', 'https://stacmebotprod.blob.core.windows.net/keyvault-acmebot/v4/latest.zip'), createObject('name', 'FUNCTIONS_EXTENSION_VERSION', 'value', '~4'), createObject('name', 'FUNCTIONS_WORKER_RUNTIME', 'value', 'dotnet'), createObject('name', 'Acmebot:Contacts', 'value', parameters('mailAddress')), createObject('name', 'Acmebot:Endpoint', 'value', parameters('acmeEndpoint')), createObject('name', 'Acmebot:VaultBaseUrl', 'value', if(parameters('createWithKeyVault'), format('https://{0}{1}', variables('keyVaultName'), environment().suffixes.keyvaultDns), parameters('keyVaultBaseUrl'))), createObject('name', 'Acmebot:Environment', 'value', environment().name)), parameters('additionalAppSettings'))]",
"netFrameworkVersion": "v6.0",
"ftpsState": "Disabled",
"minTlsVersion": "1.2",
"scmMinTlsVersion": "1.2"
"scmMinTlsVersion": "1.2",
"cors": {
"allowedOrigins": [
"https://portal.azure.com"
],
"supportCredentials": false
}
}
},
"dependsOn": [
Expand All @@ -180,7 +186,7 @@
{
"condition": "[parameters('createWithKeyVault')]",
"type": "Microsoft.KeyVault/vaults",
"apiVersion": "2022-07-01",
"apiVersion": "2023-07-01",
"name": "[variables('keyVaultName')]",
"location": "[parameters('location')]",
"properties": {
Expand All @@ -200,7 +206,7 @@
"name": "[guid(resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName')), variables('functionAppName'), variables('roleDefinitionId'))]",
"properties": {
"roleDefinitionId": "[variables('roleDefinitionId')]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2022-03-01', 'full').identity.principalId]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2023-01-01', 'full').identity.principalId]",
"principalType": "ServicePrincipal"
},
"dependsOn": [
Expand All @@ -216,11 +222,11 @@
},
"principalId": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2022-03-01', 'full').identity.principalId]"
"value": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2023-01-01', 'full').identity.principalId]"
},
"tenantId": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2022-03-01', 'full').identity.tenantId]"
"value": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2023-01-01', 'full').identity.tenantId]"
},
"keyVaultName": {
"type": "string",
Expand Down

0 comments on commit 78fd7ba

Please sign in to comment.