Azure-Samples / azd-apic-sap

Discover your SAP & Azure API Management APIs in one place with Azure API Center
https://community.sap.com/t5/technology-blogs-by-members/govern-sap-apis-living-in-various-api-management-gateways-in-a-single-place/ba-p/13682483
MIT License
1 stars 0 forks source link
azd azd-templates azure-api-center azure-api-management sap-api-management sap-btp sap-integration-suite saponazure

page_type: sample languages:

Open in GitHub Codespaces Open in Dev Container

Discover your SAP & Azure API Management APIs in one place with Azure API Center

Improve the discoverability and governance of all your APIs in one place, with Azure API Center. In this sample we expose SAP APIs directly and Azure API Management APIs connected to an SAP OData backend to API Center, deployed with Azure Developer CLI (azd).

This repository provides guidance and tools for organizations looking to implement Azure API Center to improve the discoverability and governance of all APIs in one place. The repository includes a Bicep template for provisioning and deploying the resources, and a sample API implementation that demonstrates how to expose SAP APIs directly and Azure API Management APIs connected to an SAP OData backend to API Center.

[!TIP] Have a look at this blog post for more details on the approach.

Key features ⚙️

Architecture 🏛️

azd-apic-sap Read more: Architecture in detail

Assets 📦

Getting started 🛫

Prerequisites (steps not that are not automated by AZD)

[!TIP] Consider the SAP BTP terraform provider to automate the provisioning of SAP BTP services for a fully integrated experience. Find more information here.

Preparing your SAP APIs in Azure API Management

Arguably the fastest way to interact with an SAP OData API is the SAP Business Accelerator hub. Once signed up you can tryout for instance Business Partner API here. You'll find the API documentation here.

See these additional options for free and easy sandboxing with SAP APIs.

Find more information about on adding OData APIs in Azure API Management here. For SAP API Management have a look here.

1. Initialize a new azd environment

azd init -t azure-samples/azd-apic-sap

If you already cloned this repository to your local machine or run from a Dev Container or GitHub Codespaces you can run the following command from the root folder.

azd init

It will prompt you to provide a name that will later be used in the name of the deployed resources. If you're not logged into Azure, it will also prompt you to first login.

azd auth login

2. Provision and deploy all the resources

azd up

It will prompt you to login, pick a subscription, and provide a location (like "eastus"). We've added extra conditional parameters to optionally deploy: ...

For more details on the deployed services, see additional details below.

The conditional parameters set in the azd up command are stored in the .azure\\config.json file:

{
  "infra": {
    "parameters": {
      "deployAzureAPIMtoAPIC": "<true or false>", // Deploy Azure API Management APIs to API Center
      "deploySapAPIMtoAPIC": "<true or false>", // Deploy SAP API Management APIs to API Center
      // SAP API Management
      "sapApimTokenUrl": "<https://<your-sap-btp-service-instance-name>.authentication.<btp-region>.hana.ondemand.com/oauth/token>", // url property from SAP BTP service key
      "sapApimDiscoveryUrl": "<https://<btp-region>devportal.cfapps.<btp-region>.hana.ondemand.com/apidiscovery/v1/apis>", // The SAP API Management discovery URL
      "sapApimClientId": "<client id from SAP BTP service key>", // SAP API Management, developer portal
      "sapApimSecret": "<client secret from SAP BTP service key>", // SAP API Management, developer portal
      // Azure API Management specific for included automatic onboarding of OData API into Azure APIM
      "sapBackendEndpoint": "<SAP OData endpoint for Azure API Management>", // The SAP OData endpoint for Azure API Management
      "sapBackendApiKey": "<API key for Azure API Management solution>" // The SAP OData api key for API Azure Management
    }
  }
}

[!NOTE]
Deploy only SAP API Management APIs to Azure API Center skipping Azure API Management APIs, by setting the deployAzureAPIMtoAPIC parameter to false. All input related to Azure API Management will be ignored. Same applies for the deploySapAPIMtoAPIC parameter for the SAP API Management APIs.

Testing 🧪

azd env get-values

What's next?

You can do a lot more once the app is deployed. Curious? We got you covered with some more information on the setup, monitoring, and DevOps here.

Contributing 👩🏼‍🤝‍👨🏽

This project welcomes contributions and suggestions. Please use GitHub Issues to report errors or request new features.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks™

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.