Azure / Azure/bicep-types-az

Microsoft.Cdn/profiles/endpoint: Failed to update existing hostName

Open
#1,920 4 comments 1 reaction 0 assignees View on GitHub
Network - CDN Service Attention
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

**Bicep version**
Using `AzureCLI@2` and the command: `az deployment`

**Describe the bug**
When updating an existing Microsoft.Cdn profile with a `.bicep` file, there seems to be an issue replacing the existing `hostName` with the new `hostName`.

The `originHostHeader` gets updated as expected, however, it seems that the `hostName` failed to update, and remained as the previously configured `hostName`

**To Reproduce**
Steps to reproduce the behavior:
- Ensure an existing CDN profile (with matching `hostName` and `originHostHeader`) exists
- Update the profile using the bicep configuration specified
- Confirm that `hostName` and `originHostHeader` have updated to the newly configured values.

**Additional context**
```bicep
param location string = resourceGroup().location

resource profile 'Microsoft.Cdn/profiles@2023-05-01' = {
name: 'xxxxx-cdnprofile'
location: location
properties: {}
sku: {
name: 'Standard_Microsoft'
}
}

resource endpoint 'Microsoft.Cdn/profiles/endpoints@2023-05-01' = {
parent: profile
location: location
name: 'xxxxx-cdnendpoint'
properties: {
originHostHeader: 'newhostname'
isHttpAllowed: false
isHttpsAllowed: true
queryStringCachingBehavior: 'UseQueryString'
contentTypesToCompress: [
'text/plain'
'text/html'
'text/css'
'text/javascript'
'application/x-javascript'
'application/javascript'
'application/json'
]
isCompressionEnabled: true
origins: [
{
name: 'azurestorageaccount'
properties: {
hostName: 'newhostname'
originHostHeader: 'newhostname'
}
}
]
deliveryPolicy: {
rules: [
{
name: 'redirectToCorporateWebsite'
order: 1
conditions: [
{
name: 'RequestUri'
parameters: {
typeName: 'DeliveryRuleRequestUriConditionParameters'
operator: 'Equal'
negateCondition: false
matchValues: [
'https://xxxxx'
'https://xxxxx'
]
transforms: []
}
}
]
actions: [
{
name: 'UrlRedirect'
parameters: {
typeName: 'DeliveryRuleUrlRedirectActionParameters'
redirectType: 'Found'
destinationProtocol: 'Https'
customPath: '/'
customHostname: 'xxxxx'
}
}
]
}
]
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the update with the supplied Bicep configuration and an existing Microsoft.Cdn profile, then compare the endpoint's old and new hostName values with originHostHeader. Done means the existing endpoint reflects the newly configured hostName after deployment while originHostHeader remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.