Bicep Deploy Azure
{“code”:”DeploymentFailed”,”target”:”/subscriptions/…/resourceGroups/Earth-Webshop/providers/Microsoft.Resources/deployments/AzFuncs”,”message”:”At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.”,”details”:[{“target”:”/subscriptions/…/resourceGroups/Earth-Webshop/providers/Microsoft.Web/sites/saphir-webshop-order”,”message”:”There was a conflict. The remote name could not be resolved: ‘mtvpprlfzkau2azfunctions.file.core.windows.net'”}]}
Here is my bicep file!
@description(‘The name of the function app that you wish to create.’)
param appName string = ‘saphir-webshop-order’
@description(‘Storage Account type’)
@allowed([
‘Standard_LRS’
‘Standard_GRS’
‘Standard_RAGRS’
])
param storageAccountType string = ‘Standard_LRS’
@description(‘Location for all resources.’)
param location string = resourceGroup().location
@description(‘Location for Application Insights’)
param appInsightsLocation string
@description(‘The language worker runtime to load in the function app.’)
@allowed([
‘node’
‘dotnet’
‘java’
])
param runtime string = ‘dotnet’
var functionAppName = appName
var hostingPlanName = appName
var applicationInsightsName = appName
var storageAccountName = ‘${uniqueString(resourceGroup().id)}azfunctions’
var functionWorkerRuntime = runtime
resource storageAccount ‘Microsoft.Storage/storageAccounts@2022-05-01’ = {
name: ‘earthwebshopstorage’
location: location
sku: {
name: storageAccountType
}
kind: ‘Storage’
properties: {
supportsHttpsTrafficOnly: true
defaultToOAuthAuthentication: true
}
}
resource hostingPlan ‘Microsoft.Web/serverfarms@2021-03-01’ = {
name: hostingPlanName
location: location
sku: {
name: ‘Y1’
tier: ‘Dynamic’
}
properties: {}
}
resource functionApp ‘Microsoft.Web/sites@2023-12-01’ = {
name: appName
location: ‘West Europe’
kind: ‘functionapp’
identity: {
type: ‘SystemAssigned’
}
properties: {
serverFarmId: hostingPlan.id
siteConfig: {
appSettings: [
{
name: ‘FUNCTIONS_EXTENSION_VERSION’
value: ‘~4’
}
{
name: ‘WEBSITE_NODE_DEFAULT_VERSION’
value: ‘~14’
}
{
name: ‘APPINSIGHTS_INSTRUMENTATIONKEY’
value: applicationInsights.properties.InstrumentationKey
}
{
name: ‘FUNCTIONS_WORKER_RUNTIME’
value: functionWorkerRuntime
}
]
ftpsState: ‘FtpsOnly’
minTlsVersion: ‘1.2’
}
httpsOnly: true
}
}
resource applicationInsights ‘Microsoft.Insights/components@2020-02-02’ = {
name: applicationInsightsName
location: appInsightsLocation
kind: ‘web’
properties: {
Application_Type: ‘web’
Request_Source: ‘rest’
}
}
{“code”:”DeploymentFailed”,”target”:”/subscriptions/…/resourceGroups/Earth-Webshop/providers/Microsoft.Resources/deployments/AzFuncs”,”message”:”At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.”,”details”:[{“target”:”/subscriptions/…/resourceGroups/Earth-Webshop/providers/Microsoft.Web/sites/saphir-webshop-order”,”message”:”There was a conflict. The remote name could not be resolved: ‘mtvpprlfzkau2azfunctions.file.core.windows.net'”}]}Here is my bicep file! @description(‘The name of the function app that you wish to create.’)
param appName string = ‘saphir-webshop-order’
@description(‘Storage Account type’)
@allowed([
‘Standard_LRS’
‘Standard_GRS’
‘Standard_RAGRS’
])
param storageAccountType string = ‘Standard_LRS’
@description(‘Location for all resources.’)
param location string = resourceGroup().location
@description(‘Location for Application Insights’)
param appInsightsLocation string
@description(‘The language worker runtime to load in the function app.’)
@allowed([
‘node’
‘dotnet’
‘java’
])
param runtime string = ‘dotnet’
var functionAppName = appName
var hostingPlanName = appName
var applicationInsightsName = appName
var storageAccountName = ‘${uniqueString(resourceGroup().id)}azfunctions’
var functionWorkerRuntime = runtime
resource storageAccount ‘Microsoft.Storage/storageAccounts@2022-05-01’ = {
name: ‘earthwebshopstorage’
location: location
sku: {
name: storageAccountType
}
kind: ‘Storage’
properties: {
supportsHttpsTrafficOnly: true
defaultToOAuthAuthentication: true
}
}
resource hostingPlan ‘Microsoft.Web/serverfarms@2021-03-01’ = {
name: hostingPlanName
location: location
sku: {
name: ‘Y1’
tier: ‘Dynamic’
}
properties: {}
}
resource functionApp ‘Microsoft.Web/sites@2023-12-01’ = {
name: appName
location: ‘West Europe’
kind: ‘functionapp’
identity: {
type: ‘SystemAssigned’
}
properties: {
serverFarmId: hostingPlan.id
siteConfig: {
appSettings: [
{
name: ‘FUNCTIONS_EXTENSION_VERSION’
value: ‘~4’
}
{
name: ‘WEBSITE_NODE_DEFAULT_VERSION’
value: ‘~14’
}
{
name: ‘APPINSIGHTS_INSTRUMENTATIONKEY’
value: applicationInsights.properties.InstrumentationKey
}
{
name: ‘FUNCTIONS_WORKER_RUNTIME’
value: functionWorkerRuntime
}
]
ftpsState: ‘FtpsOnly’
minTlsVersion: ‘1.2’
}
httpsOnly: true
}
}
resource applicationInsights ‘Microsoft.Insights/components@2020-02-02’ = {
name: applicationInsightsName
location: appInsightsLocation
kind: ‘web’
properties: {
Application_Type: ‘web’
Request_Source: ‘rest’
}
} Read More