Azure / Azure/bicep-types-az

Standard CDN properties.azureOrigin fails

Open
#1,932 4 comments 2 reactions 1 assignee Claimed by @shenglol View on GitHub
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

**Bicep version**
Bicep CLI version 0.10.61 (8f44805506)

**Describe the bug**
Using `properties.AzureOrigin` when creating a Standard FrontDoor as [documented](https://learn.microsoft.com/en-us/azure/templates/microsoft.cdn/2020-09-01/profiles/origingroups/origins?pivots=deployment-language-bicep) causes this error:

`Could not find member 'azureOrigin' on object of type 'AfdOrigin'. Path 'properties.azureOrigin'`

**To Reproduce**
This fails:
```bicep
resource originGroup 'Microsoft.Cdn/profiles/originGroups@2022-05-01-preview' = {
parent: frontdoorProfile
name: '${systemName}-og'
properties: {
loadBalancingSettings: {
sampleSize: 4
successfulSamplesRequired: 3
}
}
// This fails
resource webappOrigin 'origins' = {
name: '${webapp.name}-origin'
properties: {
enabledState:'Enabled'
azureOrigin: {
id: webapp.id
}
}
}
}
```

Full version: [https://github.com/flytzen/Bicep.Play/blob/main/cdn.bicep](https://github.com/flytzen/Bicep.Play/blob/main/cdn.bicep)

This works:
```bicep
resource originGroup 'Microsoft.Cdn/profiles/originGroups@2022-05-01-preview' = {
parent: frontdoorProfile
name: '${systemName}-og'
properties: {
loadBalancingSettings: {
sampleSize: 4
successfulSamplesRequired: 3
}
}

resource webappOrigin 'origins' = {
name: '${webapp.name}-origin'
properties: {
hostName: webapp.properties.defaultHostName
httpPort: 80
httpsPort: 443
originHostHeader: webapp.properties.defaultHostName
priority: 1
weight: 1000
}
}
}
```
Full version: [https://github.com/flytzen/Bicep.Play/blob/main/cdn2.bicep](https://github.com/flytzen/Bicep.Play/blob/main/cdn2.bicep)

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.