Pages

Wednesday, January 20, 2016

Enable CORS for web API 2 through Azure portal

Introduction

We can enable Cross-Origin Request (CORS) by adding “Microsoft ASP.Net Cross Origin Support” nuget package. Also we can enable CORS thorough Azure portal if we have deployed our web API 2 in azure as a app service.

Enable CORS for web API 2 through Azure portal
  1. Login to your azure portal through a browser
  2. Go to app services and click on you app service where web api 2 is hosted.
  3. Go to setting page and scroll thorough
  4. You will find API section and under that you will find CORS (I have highlighted in yellow)

cors1

  1. Click on CORS and you can add one or more your client apps. Also you can * mark to grant access to all client applications.
cors2

1 comment:

  1. How to bind api with service bus

    If it is from local,it is better

    ReplyDelete