arazzo: 1.0.1 info: title: Azure API Management Provision Product and Link API summary: Create a product, link an API to it, then list the product's APIs. description: >- Packages an API for consumption by creating a product, linking an existing API to that product, and listing the product's APIs to confirm the link. The product carries subscription and approval requirements that govern how developers gain access. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: azureApiManagementApi url: ../openapi/microsoft-azure-api-management-rest-api-openapi.yaml type: openapi workflows: - workflowId: provision-product-link-api summary: Create a product and link an API to it. description: >- Creates or updates a product with subscription/approval requirements, links the supplied API to it, then lists the product's APIs to confirm the link. inputs: type: object required: - subscriptionId - resourceGroupName - serviceName - productId - displayName - apiId properties: subscriptionId: type: string description: The Azure subscription identifier. resourceGroupName: type: string description: The resource group containing the service. serviceName: type: string description: The API Management service name. productId: type: string description: The product identifier to create or update. displayName: type: string description: The product display name. description: type: string description: The product description. apiId: type: string description: The API identifier to link to the product. steps: - stepId: createProduct description: >- Create or update the product that will package the API, with subscription required and no manual approval. operationId: Product_CreateOrUpdate parameters: - name: subscriptionId in: path value: $inputs.subscriptionId - name: resourceGroupName in: path value: $inputs.resourceGroupName - name: serviceName in: path value: $inputs.serviceName - name: productId in: path value: $inputs.productId requestBody: contentType: application/json payload: properties: displayName: $inputs.displayName description: $inputs.description subscriptionRequired: true approvalRequired: false state: published successCriteria: - condition: $statusCode == 200 outputs: productResourceId: $response.body#/id - stepId: linkApi description: >- Link the supplied API to the product so subscribers gain access to it. operationId: ProductApiLink_CreateOrUpdate parameters: - name: subscriptionId in: path value: $inputs.subscriptionId - name: resourceGroupName in: path value: $inputs.resourceGroupName - name: serviceName in: path value: $inputs.serviceName - name: productId in: path value: $inputs.productId - name: apiLinkId in: path value: $inputs.apiId requestBody: contentType: application/json payload: properties: apiId: $inputs.apiId successCriteria: - condition: $statusCode == 200 outputs: linkResourceId: $response.body#/id - stepId: listProductApis description: >- List the APIs linked to the product to confirm the new link is present. operationId: ProductApi_ListByProduct parameters: - name: subscriptionId in: path value: $inputs.subscriptionId - name: resourceGroupName in: path value: $inputs.resourceGroupName - name: serviceName in: path value: $inputs.serviceName - name: productId in: path value: $inputs.productId successCriteria: - condition: $statusCode == 200 outputs: apiCount: $response.body#/count outputs: productResourceId: $steps.createProduct.outputs.productResourceId apiCount: $steps.listProductApis.outputs.apiCount