Search This Blog

Tuesday, February 28, 2023

Azure API Management

 

Azure API Management

Azure API Management is a service that is responsible for managing back-end services like web API, WCF, open API, etc. It provides most of the tools required for end-to-end management of API’s. You can add validations for the headers, restrict the number of calls to an API, add an IP filter, etc.

Components

Gateway

This is the front-end of the APIs. The request lands on the gateway. Authentication, authorization, validations are done on this layer. It verifies the identity, restricts the number of calls, and redirects to backend API. You can also transform the HTTP response with custom properties as well as monitoring and logging can be done at this level.

Azure Configuration Portal

Construct the APIs, mock response data, and package your APIs into products. You can create access policies and monitor your incoming requests.

Developer Portal

This is a kind of developer website which is exposed to clients/consumers. Its created from your API schema and allow clients to see the endpoints-related information. It also provides a console to test the endpoints.

Create APIM

  • Login into the Azure Portal with valid credentials.
  • In the search box type “API Management Services”

Azure API Management

  • Enter the details as per your requirement.

Azure API Management

  • Hit Review and Create.
  • It will take approximately 15- 20 minutes, so relax and wait for an email from azure that API Management has been created.
  • Once its created, navigate to API Management services, you will see the newly created API service with status = Online

Products, API’s and Operations

Operation

An operation is an endpoint that is consumed by the client for HTTP requests, it could be Post, Get, Delete, Head, etc.

Apis

When you group together the operations, then they became an API like Coffee API has multiple operations to Add, Delete Get Coffee.

Product

The collection of APIs is called a Product.

Azure API Management

It’s time to do some practical.

  • Log in to the Azure portal and navigate to API Management.
  • Click on the APIs link available under the APIs section. You will see lots of options to create a new API or create from the definition.
  • In this demo, we will be using the Open API option. I have already deployed my Web API application on the app service.
  • Select the Open API option and enter the JSON configuration file or URL of your API.
  • Hit create button.

Azure API Management

Your newly created API should be visible under the developer's portal. Click on the API, you will see all the operations available under that API under the ALL Operations tab.

Azure API Management

On the right-hand side, you will see Frontend, Inbound processing, Outbound processing, and Backend.

Frontend

This is the APIM URL that you will share with the client. You can edit them according to your need. The request will land on the frontend layer first. You can define request headers, any additional query parameters.

Inbound Processing

Modify the request before it is sent to the backend service. In this layer, you can add different policies like limit the number of requests, the time delay between the request, CORS, IP-filter, etc.

Backend

This is your HTTP(s) endpoint, see it like this is the actual code of your Web API. This will have your app service web API URL.

Outbound processing

Modify the response before it is sent back to the client. You can add headers, validate status code, validate content, etc.

API Testing

Select the particular operation from the All Operation panel that you want to test and from the top menu, click Test. A new panel will show up which has the template parameters, query parameters, and header. you can fill in the details according to your endpoint. In my endpoint, it expects the item id, so I am going to pass the id of the item that I want to fetch using the Get call. After filling in the required details, hit the send button. you will see the HTTP Request and HTTP Response.

Azure API Management


    Saturday, February 25, 2023

    Difference between Dynamics Access and Owner Teams

     Owner Teams can own records and security roles assigned to the team.

    The team’s privileges are defined in the security roles assigned to it. Plus, every team member has his/her own security roles and the security roles assigned to the teams they are part of. An owner team has the full privileges on the records they own.

    Access Teams cannot own records, and no security roles can be assigned to these teams.

    The records can be shared with an access team; therefore, the team is granted access rights to the shared records such as Read, Write, and Append.

    Top 6 scenarios to help identify when to use each team:

    Owner Teams:
    • The company wants to let a group of users or teams own entity records.
    • The manager requires teams to report results daily.
    • Team members are equally given access rights, there is no variation between any two users.
    Access Teams:
    • The manager wants to give a team access rights to records without owning them.
    • You want to grant multiple teams different access rights to the same records, for example: Team A has Read access right to a specific record, while Team B has Write and Append access rights to the same record.
    • If you want to add team members to a team from different business units.

    Teams:

    • Teams allow for sharing of records that users otherwise would not have access to.
    • Creating a new business will automatically create a new team.
    • Although team belongs to a business unit, users from different business can also be added to it.

    There are two types teams – Owner and Access

    Owner Team

    Access Team

    Shares a record with a team

    Shares a record with a specific user

    Team owns the record

    No ownership to the user

    Security role can be assigned

    Security role cannot be assigned

    An owner can be converted to Access Team

    Cannot to be converted to an owner team