This template provides an example of how to create API Management service and configure all sub-entities
{"type": "microsoft.apimanagement/service/loggers", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('apimanagementservicename'), "appinsightslogger')]", "properties": {"loggertype": "applicationinsights", "credentials": {"instrumentationkey": "[reference(resourceid('microsoft.insights/components", format('ai-{0}", variables('basename')))).instrumentationkey]"}}, "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apimanagementservicename'))]", "[resourceid('microsoft.insights/components", format('ai-{0}", variables('basename')))]"]}{"type": "microsoft.apimanagement/service/diagnostics", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('apimanagementservicename'), "applicationinsights')]", "properties": {"loggerid": "[resourceid('microsoft.apimanagement/service/loggers", variables('apimanagementservicename'), "appinsightslogger')]", "logclientip": true, "alwayslog": "allerrors", "verbosity": "information", "sampling": {"percentage": 100, "samplingtype": "fixed"}, "httpcorrelationprotocol": "legacy"}, "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apimanagementservicename'))]", "[resourceid('microsoft.apimanagement/service/loggers", variables('apimanagementservicename'), "appinsightslogger')]"]}{"type": "microsoft.apimanagement/service", "apiversion": "2020-12-01", "name": "[variables('apimanagementservicename')]", "location": "[parameters('location')]", "sku": {"capacity": 1, "name": "[parameters('apimanagementsku')]"}, "properties": {"publisheremail": "[parameters('apimanagementpublisheremailaddress')]", "publishername": "[parameters('apimanagementpublishername')]", "virtualnetworktype": "internal", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('apimsubnetid')]"}, "hostnameconfigurations": [{"type": "developerportal", "hostname": "[parameters('apimanagementportalcustomhostname')]", "encodedcertificate": "[parameters('apimanagementportalcustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementportalcertificatepassword')]", "negotiateclientcertificate": false}, {"type": "proxy", "hostname": "[parameters('apimanagementproxycustomhostname')]", "encodedcertificate": "[parameters('apimanagementproxycustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementproxycertificatepassword')]", "negotiateclientcertificate": false}, {"type": "management", "hostname": "[parameters('apimanagementmanagementcustomhostname')]", "encodedcertificate": "[parameters('apimanagementmanagementcustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementmanagementcertificatepassword')]", "negotiateclientcertificate": false}]}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"]} 