Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ try {
@{ Label = 'Releases'; Suffix = 'releases' }
@{ Label = 'Wikis'; Suffix = 'wikis' }
@{ Label = 'Tag Descriptions'; Suffix = 'tagDescriptions' }
@{ Label = 'MCP Servers'; Suffix = 'mcpServers' }
)

foreach ($apiName in $apiNames) {
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/all-resource-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The kitchen sink APIM instance includes **every resource type and API protocol v
| `src-websocket` | WebSocket | None |
| `src-rest-versioned-v1` | REST (versioned) | OpenAPI |
| `src-rest-revisioned` | REST (revisioned) | OpenAPI |
| `src-rest-mcp-style` | REST (MCP-style backend) | None |
| `src-mcp-from-api` | MCP (from existing API) | None |
| `src-mcp-from-external` | MCP (from external MCP server) | None |

### Backend Variations
| Backend | Type |
Expand Down
41 changes: 34 additions & 7 deletions tests/integration/all-resource-types/expected-structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"files": ["backendInformation.json"],
"spotChecks": {
"backendInformation.json": {
"properties.url": "https://src-backend.example.com/api",
"properties.url": "https://httpbin.org",
"properties.protocol": "http",
"properties.tls.validateCertificateChain": true
}
Expand Down Expand Up @@ -361,7 +361,7 @@
]
},
"apis": {
"minCount": 8,
"minCount": 9,
"expected": [
{
"name": "src-rest-openapi",
Expand Down Expand Up @@ -569,16 +569,43 @@
"notes": "Revision 2 of src-rest-revisioned"
},
{
"name": "src-rest-mcp-style",
"files": ["apiInformation.json"],
"name": "src-mcp-from-api",
"files": ["apiInformation.json", "mcpServerInformation.json"],
"spotChecks": {
"apiInformation.json": {
"properties.displayName": "KS MCP-Style REST API",
"properties.path": "ks/mcp",
"properties.displayName": "KS MCP from Existing API",
"properties.path": "ks/mcp-from-api",
"properties.type": "mcp",
"properties.subscriptionRequired": false
},
"mcpServerInformation.json": {
"properties.mcpTools": "exists"
}
},
"children": {
"operations": {
"minCount": 1,
"notes": "Explicit operation for ApiOperation BVT coverage"
}
},
"notes": "MCP API exposing REST backend operations as MCP tools; has explicit operation and mcpServerInformation.json"
},
{
"name": "src-mcp-from-external",
"files": ["apiInformation.json", "mcpServerInformation.json"],
"spotChecks": {
"apiInformation.json": {
"properties.displayName": "KS MCP from External Server",
"properties.path": "ks/mcp-external",
"properties.type": "mcp",
"properties.subscriptionRequired": false
},
"mcpServerInformation.json": {
"properties.mcpProperties": "exists",
"properties.mcpProperties.serverUrl": "https://api.githubcopilot.com/mcp"
}
},
"notes": "REST API with explicitly defined operation (no operation-level policies, so no operations directory)"
"notes": "MCP API repackaging a public external MCP server; has mcpServerInformation.json with mcpProperties.serverUrl"
}
]
},
Expand Down
94 changes: 70 additions & 24 deletions tests/integration/all-resource-types/source-apim.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ var wsdlSpec = '''
</binding>
<service name="CalculatorService">
<port name="CalculatorSoapPort" binding="tns:CalculatorSoapBinding">
<soap:address location="https://src-soap-backend.example.com/calculator"/>
<soap:address location="https://httpbin.org/post"/>
</port>
</service>
</definitions>
Expand Down Expand Up @@ -272,7 +272,7 @@ var resolverPolicyXml = '''
<http-data-source>
<http-request>
<set-method>GET</set-method>
<set-url>https://src-graphql-backend.example.com/api/hero</set-url>
<set-url>https://httpbin.org/get</set-url>
</http-request>
</http-data-source>
'''
Expand Down Expand Up @@ -506,7 +506,7 @@ resource backendHttp 'Microsoft.ApiManagement/service/backends@2024-05-01' = {
name: 'src-backend-http'
properties: {
description: 'Simple HTTP backend'
url: 'https://src-backend.example.com/api'
url: 'https://httpbin.org'
protocol: 'http'
tls: {
validateCertificateChain: true
Expand Down Expand Up @@ -544,7 +544,7 @@ resource backendCircuitBreaker 'Microsoft.ApiManagement/service/backends@2024-05
name: 'src-backend-circuit-breaker'
properties: {
description: 'Backend with circuit breaker configuration'
url: 'https://src-cb-backend.example.com/api'
url: 'https://httpbin.org'
protocol: 'http'
circuitBreaker: {
rules: [
Expand Down Expand Up @@ -750,7 +750,7 @@ resource apiRestOpenapi 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
protocols: ['https']
format: 'openapi'
value: openApiSpec
serviceUrl: 'https://src-backend.example.com/api'
serviceUrl: 'https://httpbin.org'
subscriptionRequired: false
apiType: 'http'
}
Expand All @@ -767,7 +767,7 @@ resource apiSoapPassthrough 'Microsoft.ApiManagement/service/apis@2024-05-01' =
protocols: ['https']
format: 'wsdl'
value: wsdlSpec
serviceUrl: 'https://src-soap-backend.example.com/calculator'
serviceUrl: 'https://httpbin.org/post'
apiType: 'soap'
wsdlSelector: {
wsdlServiceName: 'CalculatorService'
Expand All @@ -786,7 +786,7 @@ resource apiGraphqlSynthetic 'Microsoft.ApiManagement/service/apis@2024-05-01' =
description: 'Kitchen sink synthetic GraphQL API with inline schema'
path: 'ks/graphql'
protocols: ['https']
serviceUrl: 'https://src-graphql-backend.example.com/graphql'
serviceUrl: 'https://httpbin.org/post'
type: 'graphql'
apiType: 'graphql'
}
Expand All @@ -813,7 +813,7 @@ resource apiGraphqlPassthrough 'Microsoft.ApiManagement/service/apis@2024-05-01'
description: 'Kitchen sink pass-through GraphQL API'
path: 'ks/graphql-pt'
protocols: ['https']
serviceUrl: 'https://src-graphql-pt-backend.example.com/graphql'
serviceUrl: 'https://httpbin.org/post'
type: 'graphql'
apiType: 'graphql'
}
Expand All @@ -840,7 +840,7 @@ resource apiWebsocket 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
description: 'Kitchen sink WebSocket API'
path: 'ks/ws'
protocols: ['wss']
serviceUrl: 'wss://src-ws-backend.example.com/socket'
serviceUrl: 'wss://echo.websocket.events'
type: 'websocket'
apiType: 'websocket'
}
Expand All @@ -857,7 +857,7 @@ resource apiVersionedV1 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
protocols: ['https']
format: 'openapi'
value: openApiSpecV1
serviceUrl: 'https://src-versioned-backend.example.com/api'
serviceUrl: 'https://httpbin.org'
Comment thread
EMaher marked this conversation as resolved.
Outdated
apiVersion: 'v1'
apiVersionSetId: versionSet.id
subscriptionRequired: false
Expand All @@ -876,7 +876,7 @@ resource apiRevisioned 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
protocols: ['https']
format: 'openapi'
value: openApiSpec
serviceUrl: 'https://src-revisioned-backend.example.com/api'
serviceUrl: 'https://httpbin.org'
subscriptionRequired: false
apiType: 'http'
isCurrent: true
Expand All @@ -890,25 +890,42 @@ resource apiRevisionedRev2 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
properties: {
path: 'ks/revisioned'
protocols: ['https']
serviceUrl: 'https://src-revisioned-backend-v2.example.com/api'
serviceUrl: 'https://httpbin.org'
apiRevisionDescription: 'Second revision for BVT testing'
sourceApiId: apiRevisioned.id
apiType: 'http'
}
}

// 8. REST API linked to backend (MCP-style HTTP backend)
resource apiMcpStyle 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
// 8. MCP API created from an existing REST API in the instance
resource apiMcpFromApi 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
parent: apim
name: 'src-rest-mcp-style'
name: 'src-mcp-from-api'
properties: {
displayName: 'KS MCP-Style REST API'
description: 'REST API configured with MCP-style backend pattern'
path: 'ks/mcp'
displayName: 'KS MCP from Existing API'
description: 'MCP server created by exposing an existing REST API in the instance as MCP tools'
path: 'ks/mcp-from-api'
protocols: ['https']
serviceUrl: 'https://src-mcp-server.example.com/mcp/v1'
serviceUrl: 'https://httpbin.org'
subscriptionRequired: false
apiType: 'http'
type: 'mcp'
apiType: 'mcp'
}
}

// 9. MCP API created from an existing (external) public MCP server
resource apiMcpFromExternal 'Microsoft.ApiManagement/service/apis@2024-05-01' = {
Comment thread
EMaher marked this conversation as resolved.
Outdated
parent: apim
name: 'src-mcp-from-external'
properties: {
displayName: 'KS MCP from External Server'
description: 'MCP server repackaging a public external MCP server via APIM'
path: 'ks/mcp-external'
protocols: ['https']
serviceUrl: 'https://api.githubcopilot.com/mcp'
subscriptionRequired: false
type: 'mcp'
apiType: 'mcp'
}
}

Expand Down Expand Up @@ -1033,9 +1050,9 @@ resource apiRestOpPolicy 'Microsoft.ApiManagement/service/apis/operations/polici
}
}

// --- Explicit API Operation (on MCP-style API for full coverage) ---
// --- Explicit API Operation (on MCP from-API API for full coverage of ApiOperation resource type) ---
resource apiMcpOperation 'Microsoft.ApiManagement/service/apis/operations@2024-05-01' = {
parent: apiMcpStyle
parent: apiMcpFromApi
name: 'src-mcp-invoke'
properties: {
displayName: 'Invoke MCP Tool'
Expand All @@ -1051,6 +1068,35 @@ resource apiMcpOperation 'Microsoft.ApiManagement/service/apis/operations@2024-0
}
}

// --- MCP Server (from existing API) ---
resource mcpServerFromApi 'Microsoft.ApiManagement/service/apis/mcpServers@2024-05-01' = {
parent: apiMcpFromApi
name: 'default'
properties: {
mcpTools: [
{
name: 'httpGet'
description: 'Perform a GET request via the underlying REST API backend'
}
{
name: 'httpPost'
description: 'Perform a POST request via the underlying REST API backend'
}
]
}
}

// --- MCP Server (from external MCP server) ---
resource mcpServerFromExternal 'Microsoft.ApiManagement/service/apis/mcpServers@2024-05-01' = {
parent: apiMcpFromExternal
name: 'default'
properties: {
mcpProperties: {
serverUrl: 'https://api.githubcopilot.com/mcp'
}
}
}

// --- Explicit API Schema (on REST API for full coverage) ---
resource apiRestSchema 'Microsoft.ApiManagement/service/apis/schemas@2024-05-01' = {
parent: apiRestOpenapi
Expand Down Expand Up @@ -1180,7 +1226,7 @@ resource wsBackend 'Microsoft.ApiManagement/service/workspaces/backends@2024-05-
name: 'src-ws-backend-http'
properties: {
description: 'Workspace-scoped HTTP backend'
url: 'https://src-ws-backend.example.com/api'
url: 'https://httpbin.org'
Comment thread
EMaher marked this conversation as resolved.
Outdated
protocol: 'http'
}
}
Expand Down Expand Up @@ -1221,7 +1267,7 @@ resource wsApi 'Microsoft.ApiManagement/service/workspaces/apis@2024-05-01' = if
displayName: 'Workspace REST API'
path: 'ks/ws/rest'
protocols: ['https']
serviceUrl: 'https://src-ws-api-backend.example.com/api'
serviceUrl: 'https://httpbin.org'
apiType: 'http'
}
}
Expand Down