Skip to content

Commit ae8c443

Browse files
Merge pull request #227732 from NandiniMurali/main
How to enable CORS
2 parents d4f269c + 2ac15f0 commit ae8c443

File tree

6 files changed

+62
-1
lines changed

6 files changed

+62
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: How to enable CORS - Azure Data Manager for Energy Preview #Required; page title is displayed in search results. Include the brand.
3+
description: Guide on CORS in Azure data manager for Energy and how to set up CORS #Required; article description that is displayed in search results.
4+
author: NandiniMurali #Required; your GitHub user alias, with correct capitalization.
5+
ms.author: Nandinim #Required; microsoft alias of author; optional team alias.
6+
ms.service: energy-data-services #Required; service per approved list. slug assigned by ACOM.
7+
ms.topic: how-to #Required; leave this attribute/value as-is.
8+
ms.date: 02/28/2023 #Required; mm/dd/yyyy format.
9+
ms.custom: template-how-to-pattern #Required; leave this attribute/value as-is.
10+
---
11+
# Use CORS for resource sharing in Azure Data Manager for Energy Preview
12+
This document is to help you as user of Azure Data Manager for Energy preview to set up CORS policies.
13+
14+
## What is CORS?
15+
16+
CORS (Cross Origin Resource Sharing) is an HTTP feature that enables a web application running under one domain to access resources in another domain. In order to reduce the possibility of cross-site scripting attacks, all modern web browsers implement a security restriction known as same-origin policy, which prevents a web page from calling APIs in a different domain. CORS provides a secure way to allow one origin (the origin domain) to call APIs in another origin.
17+
You can set CORS rules for each Azure Data Manager for Energy Preview instance. When you set CORS rules for the instance it gets applied automatically across all the services and storage accounts linked with Azure Data Manager for Energy Preview services. Once you set the CORS rules, then a properly authorized request made against the service evaluates from a different domain to determine whether it's allowed according to the rules you've specified.
18+
19+
20+
## Enabling CORS on Azure Data Manager for Energy instance Preview
21+
22+
1. Create an **Azure Data Manager for Energy Preview** instance.
23+
2. Select the **Resource Sharing(CORS)** tab.
24+
[![Screenshot of Resource Sharing(CORS) tab while creating Microsoft Energy Data Services.](media/how-to-enable-cors/enable-cors-1.png)](media/how-to-enable-cors/enable-cors-1.png#lightbox)
25+
26+
3. In the Resource Sharing(CORS) tab, select **Allowed Origins**.
27+
4. There can be upto 5 **Allowed Origins** added for a given instance.
28+
[![Screenshot of 1 allowed origin selected.](media/how-to-enable-cors/enable-cors-2.png)](media/how-to-enable-cors/enable-cors-2.png#lightbox)
29+
5. If you explicitly want to have ***(Wildcard)**, then in the allowed origin * can be added.
30+
6. If no setting is enabled on CORS page it's defaulted to Wildcard*, allow all.
31+
7. The other values of CORS policy like **Allowed Methods**, **Allowed Headers**, **Exposed Headers**, **Max age in seconds** are set with default values displayed on the screen.
32+
7. Next, select “**Review+Create**” after completing other tabs.
33+
8. Select the "**Create**" button.
34+
9. An **Azure Data Manager for Energy Preview** instance is created with CORS policy.
35+
10. Next, once the instance is created the CORS policy set can be viewed in instance **overview** page.
36+
11. You can navigate to **Resource Sharing(CORS)** and see that CORS is enabled with required **Allowed Origins**.
37+
[![Screenshot of viewing the CORS policy set out.](media/how-to-enable-cors/enable-cors-3.png)](media/how-to-enable-cors/enable-cors-3.png#lightbox)
38+
39+
## How are CORS rules evaluated?
40+
CORS rules are evaluated as follows:
41+
1. First, the origin domain of the request is checked against the domains listed for the AllowedOrigins element.
42+
2. If the origin domain is included in the list, or all domains are allowed with the wildcard character '*', then rules evaluation proceeds. If the origin domain isn't included, then the request fails.
43+
44+
## Limitations on CORS policy
45+
The following limitations apply to CORS rules:
46+
- You can specify up to five CORS rules per instance.
47+
- The maximum size of all CORS rules settings on the request, excluding XML tags, shouldn't exceed 2 KiB.
48+
- The length of allowed origin shouldn't exceed 256 characters.
49+
50+
51+
## Next steps
52+
- CORS policy once set up during provisioning can be modified only through a Support request
53+
> [!div class="nextstepaction"]
54+
> [Create an Azure support request](../azure-portal/supportability/how-to-create-azure-support-request.md)
55+
- To learn more about CORS
56+
> [!div class="nextstepaction"]
57+
> [CORS overview](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services)

articles/energy-data-services/index.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,6 @@ landingContent:
107107
- text: Set up Lockbox
108108
url: how-to-create-lockbox.md
109109
- text: Set up use Managed Identity
110-
url: how-to-use-managed-identity.md
110+
url: how-to-use-managed-identity.md
111+
- text: Enable resource sharing (CORS)
112+
url: how-to-enable-cors.md
116 KB
Loading
592 KB
Loading
50 KB
Loading

articles/energy-data-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
href: how-to-create-lockbox.md
7575
- name: Set up Managed Identity
7676
href: how-to-use-managed-identity.md
77+
- name: Set up Resource sharing (CORS)
78+
href: how-to-enable-cors.md
7779
- name: Load datasets
7880
href: https://github.com/Azure/osdu-data-load-tno
7981
- name: Convert SEG-Y to ZGY

0 commit comments

Comments
 (0)