Skip to content

Commit 3938893

Browse files
authored
Merge pull request #111305 from dagiro/freshness48
freshness48
2 parents 797705d + 8038e78 commit 3938893

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

articles/hdinsight/hdinsight-storage-sharedaccesssignature-permissions.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ author: hrasheed-msft
55
ms.author: hrasheed
66
ms.reviewer: jasonh
77
ms.service: hdinsight
8-
ms.custom: hdinsightactive
98
ms.topic: conceptual
10-
ms.date: 11/13/2019
9+
ms.custom: hdinsightactive
10+
ms.date: 04/14/2020
1111
---
1212

1313
# Use Azure Storage Shared Access Signatures to restrict access to data in HDInsight
@@ -22,8 +22,6 @@ HDInsight has full access to data in the Azure Storage accounts associated with
2222
2323
## Prerequisites
2424

25-
* An Azure subscription.
26-
2725
* An SSH client. For more information, see [Connect to HDInsight (Apache Hadoop) using SSH](./hdinsight-hadoop-linux-use-ssh-unix.md).
2826

2927
* An existing [storage container](../storage/blobs/storage-quickstart-blobs-portal.md).
@@ -36,7 +34,7 @@ HDInsight has full access to data in the Azure Storage accounts associated with
3634

3735
* If using C#, Visual Studio must be version 2013 or higher.
3836

39-
* The [URI scheme](./hdinsight-hadoop-linux-information.md#URI-and-scheme) for your storage account. This would be `wasb://` for Azure Storage, `abfs://` for Azure Data Lake Storage Gen2 or `adl://` for Azure Data Lake Storage Gen1. If secure transfer is enabled for Azure Storage, the URI would be `wasbs://`. See also, [secure transfer](../storage/common/storage-require-secure-transfer.md).
37+
* The [URI scheme](./hdinsight-hadoop-linux-information.md#URI-and-scheme) for your storage account. This scheme would be `wasb://` for Azure Storage, `abfs://` for Azure Data Lake Storage Gen2 or `adl://` for Azure Data Lake Storage Gen1. If secure transfer is enabled for Azure Storage, the URI would be `wasbs://`. See also, [secure transfer](../storage/common/storage-require-secure-transfer.md).
4038

4139
* An existing HDInsight cluster to add a Shared Access Signature to. If not, you can use Azure PowerShell to create a cluster and add a Shared Access Signature during cluster creation.
4240

@@ -51,11 +49,11 @@ HDInsight has full access to data in the Azure Storage accounts associated with
5149

5250
There are two forms of Shared Access Signatures:
5351

54-
* Ad hoc: The start time, expiry time, and permissions for the SAS are all specified on the SAS URI.
52+
* `Ad hoc`: The start time, expiry time, and permissions for the SAS are all specified on the SAS URI.
5553

56-
* Stored access policy: A stored access policy is defined on a resource container, such as a blob container. A policy can be used to manage constraints for one or more shared access signatures. When you associate a SAS with a stored access policy, the SAS inherits the constraints - the start time, expiry time, and permissions - defined for the stored access policy.
54+
* `Stored access policy`: A stored access policy is defined on a resource container, such as a blob container. A policy can be used to manage constraints for one or more shared access signatures. When you associate a SAS with a stored access policy, the SAS inherits the constraints - the start time, expiry time, and permissions - defined for the stored access policy.
5755

58-
The difference between the two forms is important for one key scenario: revocation. A SAS is a URL, so anyone who obtains the SAS can use it, regardless of who requested it to begin with. If a SAS is published publicly, it can be used by anyone in the world. A SAS that is distributed is valid until one of four things happens:
56+
The difference between the two forms is important for one key scenario: revocation. A SAS is a URL, so anyone who obtains the SAS can use it. It doesn't matter who requested it to begin with. If a SAS is published publicly, it can be used by anyone in the world. A SAS that is distributed is valid until one of four things happens:
5957

6058
1. The expiry time specified on the SAS is reached.
6159

@@ -77,7 +75,7 @@ For more information on Shared Access Signatures, see [Understanding the SAS mod
7775

7876
## Create a stored policy and SAS
7977

80-
Save the SAS token that is produced at the end of each method. The token will look similar to the following:
78+
Save the SAS token that is produced at the end of each method. The token will look similar to the following output:
8179

8280
```output
8381
?sv=2018-03-28&sr=c&si=myPolicyPS&sig=NAxefF%2BrR2ubjZtyUtuAvLQgt%2FJIN5aHJMj6OsDwyy4%3D
@@ -200,29 +198,28 @@ Open the `SASToken.py` file and replace `storage_account_name`, `storage_account
200198
201199
You may need to execute `pip install --upgrade azure-storage` if you receive the error message `ImportError: No module named azure.storage`.
202200
203-
### Using C#
201+
### Using C\#
204202
205203
1. Open the solution in Visual Studio.
206204
207205
2. In Solution Explorer, right-click on the **SASExample** project and select **Properties**.
208206
209207
3. Select **Settings** and add values for the following entries:
210208
211-
* StorageConnectionString: The connection string for the storage account that you want to create a stored policy and SAS for. The format should be `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey` where `myaccount` is the name of your storage account and `mykey` is the key for the storage account.
212-
213-
* ContainerName: The container in the storage account that you want to restrict access to.
214-
215-
* SASPolicyName: The name to use for the stored policy to create.
216-
217-
* FileToUpload: The path to a file that is uploaded to the container.
209+
|Item |Description |
210+
|---|---|
211+
|StorageConnectionString|The connection string for the storage account that you want to create a stored policy and SAS for. The format should be `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey` where `myaccount` is the name of your storage account and `mykey` is the key for the storage account.|
212+
|ContainerName|The container in the storage account that you want to restrict access to.|
213+
|SASPolicyName|The name to use for the stored policy to create.|
214+
|FileToUpload|The path to a file that is uploaded to the container.|
218215
219216
4. Run the project. Save the SAS policy token, storage account name, and container name. These values are used when associating the storage account with your HDInsight cluster.
220217
221218
## Use the SAS with HDInsight
222219
223-
When creating an HDInsight cluster, you must specify a primary storage account and you can optionally specify additional storage accounts. Both of these methods of adding storage require full access to the storage accounts and containers that are used.
220+
When creating an HDInsight cluster, you must specify a primary storage account. You can also specify additional storage accounts. Both of these methods of adding storage require full access to the storage accounts and containers that are used.
224221
225-
To use a Shared Access Signature to limit access to a container, add a custom entry to the **core-site** configuration for the cluster. You can add the entry during cluster creation using PowerShell or after cluster creation using Ambari.
222+
Use a Shared Access Signature to limit container access. Add a custom entry to the **core-site** configuration for the cluster. You can add the entry during cluster creation using PowerShell or after cluster creation using Ambari.
226223
227224
### Create a cluster that uses the SAS
228225

0 commit comments

Comments
 (0)