Skip to content

Commit

Permalink
Merge pull request #16 from IATI/fix/validator-services-name
Browse files Browse the repository at this point in the history
update validator services backend and parameterise
  • Loading branch information
nosvalds authored Aug 24, 2021
2 parents 1fc209b + 3863ee3 commit 56cdfd0
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 80 deletions.
2 changes: 1 addition & 1 deletion service/apim-iati-dev-apis.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@
},
{
"properties": {
"description": "Import from \"dev-func-validator-services\" Function App",
"description": "Validator Services Routes",
"authenticationSettings": {
"subscriptionKeyRequired": false
},
Expand Down
28 changes: 16 additions & 12 deletions service/apim-iati-dev-backends.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,52 @@
"type": "string"
},
"Environment": {
"type": "string"
"type": "string"
},
"SubscriptionId": {
"type": "string"
"type": "string"
}
},
"variables": {
"ValidatorServicesNameWithEnv": "[concat('func-validator-services-', parameters('Environment'))]",
"ValidatorAPINameWithEnv": "[concat('func-iativalidator-', parameters('Environment'))]"
},
"resources": [
{
"properties": {
"description": "[concat(parameters('Environment'), '-func-validator-services')]",
"resourceId": "[concat('https://management.azure.com/subscriptions/', parameters('SubscriptionId'), '/resourceGroups/rg-validator-services-', parameters('Environment'), '/providers/Microsoft.Web/sites/' , parameters('Environment'), '-func-validator-services')]",
"description": "[variables('ValidatorServicesNameWithEnv')]",
"resourceId": "[concat('https://management.azure.com/subscriptions/', parameters('SubscriptionId'), '/resourceGroups/rg-validator-services-', parameters('Environment'), '/providers/Microsoft.Web/sites/' , variables('ValidatorServicesNameWithEnv'))]",
"credentials": {
"header": {
"x-functions-key": [
"[concat('{{', parameters('Environment'), '-func-validator-services-key}}')]"
]
}
},
"url": "[concat( 'https://', parameters('Environment'), '-func-validator-services.azurewebsites.net/api')]",
"url": "[concat( 'https://', variables('ValidatorServicesNameWithEnv'), '.azurewebsites.net/api')]",
"protocol": "http"
},
"name": "[concat(parameters('ApimServiceName'), '/', parameters('Environment'), '-func-validator-services')]",
"name": "[concat(parameters('ApimServiceName'), '/', variables('ValidatorServicesNameWithEnv'))]",
"type": "Microsoft.ApiManagement/service/backends",
"apiVersion": "2020-12-01"
},
{
"properties": {
"description": "[concat('func-iativalidator-', parameters('Environment'))]",
"resourceId": "[concat('https://management.azure.com/subscriptions/', parameters('SubscriptionId'), '/resourceGroups/rg-iativalidator-', parameters('Environment'), '/providers/Microsoft.Web/sites/func-iativalidator-', parameters('Environment'))]",
"description": "[variables('ValidatorAPINameWithEnv')]",
"resourceId": "[concat('https://management.azure.com/subscriptions/', parameters('SubscriptionId'), '/resourceGroups/rg-iativalidator-', parameters('Environment'), '/providers/Microsoft.Web/sites/', variables('ValidatorAPINameWithEnv'))]",
"credentials": {
"header": {
"x-functions-key": [
"[concat('{{func-iativalidator-', parameters('Environment'), '-key}}')]"
"[concat('{{',variables('ValidatorAPINameWithEnv'),'-key}}')]"
]
}
},
"url": "[concat( 'https://func-iativalidator-', parameters('Environment'), '.azurewebsites.net/api')]",
"url": "[concat( 'https://', variables('ValidatorAPINameWithEnv'), '.azurewebsites.net/api')]",
"protocol": "http"
},
"name": "[concat(parameters('ApimServiceName'), '/func-iativalidator-', parameters('Environment'))]",
"name": "[concat(parameters('ApimServiceName'), '/', variables('ValidatorAPINameWithEnv'))]",
"type": "Microsoft.ApiManagement/service/backends",
"apiVersion": "2020-12-01"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
<rewrite-uri template="/pub/validation/existing" />
</inbound>
<backend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
<cors>
<allowed-origins>
<origin>*</origin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none" />
</inbound>
<backend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none" />
</inbound>
<backend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<set-backend-service id="apim-generated-policy" backend-id="{{Environment}}-func-validator-services" />
<set-backend-service id="apim-generated-policy" backend-id="func-validator-services-{{Environment}}" />
<cors>
<allowed-origins>
<origin>*</origin>
Expand Down

0 comments on commit 56cdfd0

Please sign in to comment.