File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <!--
2+ This is the global All APIs policy.
3+ If you want to apply CORS policies to all APIs, uncomment the CORS policy block below and make the necessary adjustments to the allowed origins.
4+ -->
5+ <policies >
6+ <inbound >
7+ <!--
8+ <cors allow-credentials="true" terminate-unmatched-request="false">
9+ <allowed-origins>
10+ <origin>[ADD YOUR ORIGINS]</origin>
11+ </allowed-origins>
12+ <allowed-methods preflight-result-max-age="300">
13+ <method>*</method>
14+ </allowed-methods>
15+ <allowed-headers>
16+ <header>*</header>
17+ </allowed-headers>
18+ <expose-headers>
19+ <header>*</header>
20+ </expose-headers>
21+ </cors>
22+ -->
23+ </inbound >
24+ <backend >
25+ <forward-request />
26+ </backend >
27+ <outbound />
28+ <on-error />
29+ </policies >
Original file line number Diff line number Diff line change @@ -67,9 +67,21 @@ param apimManagedIdentityType string = 'SystemAssigned'
6767param apimUserAssignedManagedIdentityId string = ''
6868
6969
70+ @description ('Content of the global All APIs policy XML. If provided, sets the global policy.' )
71+ param globalPolicyXml string = loadTextContent ('../../../../apim-policies/all-apis.xml' )
72+
7073// ------------------------------
7174// RESOURCES
7275// ------------------------------
76+ // https://learn.microsoft.com/azure/templates/microsoft.apimanagement/service/policies
77+ resource apimGlobalPolicy 'Microsoft.ApiManagement/service/policies@2024-06-01-preview' = if (!empty (globalPolicyXml )) {
78+ name : 'policy'
79+ parent : apimService
80+ properties : {
81+ format : 'xml'
82+ value : globalPolicyXml
83+ }
84+ }
7385
7486// https://learn.microsoft.com/azure/templates/microsoft.apimanagement/service
7587resource apimService 'Microsoft.ApiManagement/service@2024-06-01-preview' = {
You can’t perform that action at this time.
0 commit comments