Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/preserve-apim-backend-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gradientedge/cdk-utils-azure': patch
---

Preserve inherited API Management backend policies when custom backend policy content is configured.
3 changes: 2 additions & 1 deletion packages/azure/src/construct/rest-api-function/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ export class AzureRestApiFunction extends AzureFunctionApp {
</set-header>
</inbound>
<backend>
${this.api.backendPolicyXmlContent ?? '<base />'}
<base />
${this.api.backendPolicyXmlContent ?? ''}
</backend>
<outbound>
<base />
Expand Down
1 change: 1 addition & 0 deletions packages/azure/test/constructs/rest-api-function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ describe('TestAzureRestApiFunctionWithPolicyConstruct', () => {
expect(stackWithPolicy.construct).toBeDefined()
expect(stackWithPolicy.construct.api).toBeDefined()
await expect(customApiPolicyValue).resolves.toContain('<forward-request timeout="30" />')
await expect(customApiPolicyValue).resolves.toContain('<base />')
})

test('dashboardVariables returns expected variables', () => {
Expand Down