Skip to content

Commit

Permalink
Setup apim roatp subscription (#926)
Browse files Browse the repository at this point in the history
* Add APIM Subscription for roatp

* Fix duplicated name

* Fix Depends On

* Fix AI References

* Fix References

* Add final reference

* Fix a depends on

* Fix PR Comments
  • Loading branch information
nbowes24 authored Dec 17, 2021
1 parent ce1f61c commit 275aaaa
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions azure/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
},
"resourceGroupLocation": {
"type": "string"
},
"sharedApimResourceGroup": {
"type": "string"
},
"sharedApimName": {
"type": "string"
},
"utcValue": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"variables": {
Expand All @@ -83,7 +93,7 @@
},
{
"apiVersion": "2020-06-01",
"name": "ui-app-insights",
"name": "[concat(variables('uiAppServiceName'), '-app-insights-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand All @@ -104,7 +114,7 @@
},
{
"apiVersion": "2020-06-01",
"name": "api-app-insights",
"name": "[concat(variables('apiAppServiceName'), '-app-insights-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand All @@ -127,7 +137,7 @@
},
{
"apiVersion": "2020-06-01",
"name": "ui-app-service-certificate",
"name": "[concat('ui-',parameters('uiCertificateName'), '-', parameters('utcValue'))]",
"resourceGroup": "[parameters('sharedEnvResourceGroup')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand All @@ -151,7 +161,7 @@
},
{
"apiVersion": "2020-06-01",
"name": "api-app-service-certificate",
"name": "[concat('api-',parameters('apiCertificateName'), '-', parameters('utcValue'))]",
"resourceGroup": "[parameters('sharedEnvResourceGroup')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand All @@ -175,7 +185,7 @@
},
{
"apiVersion": "2020-06-01",
"name": "ui-app-service",
"name": "[concat(variables('uiAppServiceName'), '-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand Down Expand Up @@ -210,7 +220,7 @@
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference('ui-app-insights').outputs.InstrumentationKey.value]"
"value": "[reference(concat(variables('uiAppServiceName'), '-app-insights-', parameters('utcValue'))).outputs.InstrumentationKey.value]"
}
]
}
Expand All @@ -230,21 +240,17 @@
"value": "[parameters('uiCustomHostname')]"
},
"certificateThumbprint": {
"value": "[reference('ui-app-service-certificate').outputs.certificateThumbprint.value]"
"value": "[reference(concat('ui-',parameters('uiCertificateName'), '-', parameters('utcValue'))).outputs.certificateThumbprint.value]"
},
"ipSecurityRestrictions": {
"value": "[parameters('frontEndAccessRestrictions')]"
}
}
},
"dependsOn": [
"ui-app-insights",
"ui-app-service-certificate"
]
}
},
{
"apiVersion": "2020-06-01",
"name": "api-app-service",
"name": "[concat(variables('apiAppServiceName'), '-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand Down Expand Up @@ -279,11 +285,11 @@
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference('api-app-insights').outputs.InstrumentationKey.value]"
"value": "[reference(concat(variables('apiAppServiceName'), '-app-insights-', parameters('utcValue'))).outputs.InstrumentationKey.value]"
},
{
"name": "FileStorage:StorageConnectionString",
"value": "[reference('storage-account').outputs.storageConnectionString.value]"
"value": "[reference(concat(variables('storageAccountName'), '-', parameters('utcValue'))).outputs.storageConnectionString.value]"
}
]
}
Expand All @@ -303,21 +309,17 @@
"value": "[parameters('apiCustomHostname')]"
},
"certificateThumbprint": {
"value": "[reference('api-app-service-certificate').outputs.certificateThumbprint.value]"
"value": "[reference(concat('api-',parameters('apiCertificateName'), '-', parameters('utcValue'))).outputs.certificateThumbprint.value]"
},
"ipSecurityRestrictions": {
"value": "[parameters('backEndAccessRestrictions')]"
}
}
},
"dependsOn": [
"api-app-insights",
"api-app-service-certificate"
]
}
},
{
"apiVersion": "2020-06-01",
"name": "storage-account",
"name": "[concat(variables('storageAccountName'), '-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
Expand All @@ -335,6 +337,30 @@
}
}
}
},
{
"apiVersion": "2021-04-01",
"name": "[concat(variables('apiAppServiceName'), '-apim-subscription-', parameters('utcValue'))]",
"resourceGroup": "[parameters('sharedApimResourceGroup')]",
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('deploymentUrlBase'),'apim/apim-subscription.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"apimName": {
"value": "[parameters('sharedApimName')]"
},
"subscriptionName": {
"value": "[variables('apiAppServiceName')]"
},
"subscriptionScope": {
"value": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('sharedApimResourceGroup'), '/providers/Microsoft.ApiManagement/service/', parameters('sharedApimName'), '/products/RoatpOuterApi')]"
}
}
}
}
],
"outputs": {
Expand Down

0 comments on commit 275aaaa

Please sign in to comment.