Skip to content

Commit f3f24f0

Browse files
committed
AzTable module doesn't natively support OAuth
1 parent 1b1f469 commit f3f24f0

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

articles/storage/common/storage-account-recover.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,4 @@ To restore a deleted storage account from within another storage account, follow
7171

7272
- [Storage account overview](storage-account-overview.md)
7373
- [Create a storage account](storage-account-create.md)
74-
- [Upgrade to a general-purpose v2 storage account](storage-account-upgrade.md)
7574
- [Move an Azure Storage account to another region](storage-account-move.md)

articles/storage/tables/table-storage-how-to-use-powershell.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: roygara
55

66
ms.service: storage
77
ms.topic: article
8-
ms.date: 04/05/2019
8+
ms.date: 06/23/2022
99
ms.author: rogarana
1010
ms.subservice: tables
1111
ms.custom: devx-track-azurepowershell
@@ -26,32 +26,36 @@ This how-to article covers common Azure Table storage operations. You learn how
2626
> * Delete table entities
2727
> * Delete a table
2828
29-
This how-to article shows you how to create a new Azure Storage account in a new resource group so you can easily remove it when you're done. If you'd rather use an existing Storage account, you can do that instead.
29+
This how-to article shows you how to create a new storage account in a new resource group so you can easily remove it when you're done. You can also use an existing storage account.
3030

3131
The examples require Az PowerShell modules `Az.Storage (1.1.0 or greater)` and `Az.Resources (1.2.0 or greater)`. In a PowerShell window, run `Get-Module -ListAvailable Az*` to find the version. If nothing is displayed, or you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-az-ps).
3232

3333
> [!IMPORTANT]
34-
> Using this Azure feature from PowerShell requires that you have the `Az` module installed. The current version of `AzTable` is not compatible with the older AzureRM module.
35-
> Follow the [latest install instructions for installing Az module](/powershell/azure/install-az-ps) if needed.
34+
> Using this Azure feature from PowerShell requires that you have the `Az` module installed. The current version of `AzTable` is not compatible with the older AzureRM module. Follow the [latest install instructions for installing Az module](/powershell/azure/install-az-ps) if needed.
35+
>
36+
> For module name compatibility reasons, this module is also published under the previous name `AzureRmStorageTables` in PowerShell Gallery. This document will reference the new name only.
3637
3738
After Azure PowerShell is installed or updated, you must install module **AzTable**, which has the commands for managing the entities. To install this module, run PowerShell as an administrator and use the **Install-Module** command.
3839

39-
> [!IMPORTANT]
40-
> For module name compatibility reasons we are still publishing this same module under the old name `AzureRmStorageTables` in PowerShell Gallery. This document will reference the new name only.
41-
4240
```powershell
4341
Install-Module AzTable
4442
```
4543

46-
## Sign in to Azure
44+
## Authorizing table data operations
45+
46+
The AzTable PowerShell module supports authorization with the account key via Shared Key authorization. For examples that show how to use Shared Key authorization for data access with the AzTable module, see [Use Shared Key authorization with the AzTable module](#use-shared-key-authorization-with-the-aztable-module).
47+
48+
Azure Table Storage supports authorization with Azure AD. However, the AzTable PowerShell module does not natively support authorization with Azure AD. Using Azure AD with the AzTable module requires that you call methods in the .NET client library from PowerShell.
4749

48-
Sign in to your Azure subscription with the `Add-AzAccount` command and follow the on-screen directions.
50+
## Use Shared Key authorization with the AzTable module
51+
52+
To get started, sign in to your Azure subscription with the `Add-AzAccount` command and follow the on-screen directions.
4953

5054
```powershell
5155
Add-AzAccount
5256
```
5357

54-
## Retrieve list of locations
58+
### Retrieve list of locations
5559

5660
If you don't know which location you want to use, you can list the available locations. After the list is displayed, find the one you want to use. These examples use **eastus**. Store this value in the variable **location** for future use.
5761

@@ -60,9 +64,9 @@ Get-AzLocation | select Location
6064
$location = "eastus"
6165
```
6266

63-
## Create resource group
67+
### Create resource group
6468

65-
Create a resource group with the [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) command.
69+
Create a resource group with the [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) command.
6670

6771
An Azure resource group is a logical container into which Azure resources are deployed and managed. Store the resource group name in a variable for future use. In this example, a resource group named *pshtablesrg* is created in the *eastus* region.
6872

@@ -71,7 +75,7 @@ $resourceGroup = "pshtablesrg"
7175
New-AzResourceGroup -ResourceGroupName $resourceGroup -Location $location
7276
```
7377

74-
## Create storage account
78+
### Create storage account
7579

7680
Create a standard general-purpose storage account with locally redundant storage (LRS) using [New-AzStorageAccount](/powershell/module/az.storage/New-azStorageAccount). Be sure to specify a unique storage account name. Next, get the context that represents the storage account. When acting on a storage account, you can reference the context instead of repeatedly providing your credentials.
7781

@@ -86,7 +90,7 @@ $storageAccount = New-AzStorageAccount -ResourceGroupName $resourceGroup `
8690
$ctx = $storageAccount.Context
8791
```
8892

89-
## Create a new table
93+
### Create a new table
9094

9195
To create a table, use the [New-AzStorageTable](/powershell/module/az.storage/New-AzStorageTable) cmdlet. In this example, the table is called `pshtesttable`.
9296

@@ -95,36 +99,36 @@ $tableName = "pshtesttable"
9599
New-AzStorageTable –Name $tableName –Context $ctx
96100
```
97101

98-
## Retrieve a list of tables in the storage account
102+
### Retrieve a list of tables in the storage account
99103

100104
Retrieve a list of tables in the storage account using [Get-AzStorageTable](/powershell/module/az.storage/Get-AzStorageTable).
101105

102106
```powershell
103107
Get-AzStorageTable –Context $ctx | select Name
104108
```
105109

106-
## Retrieve a reference to a specific table
110+
### Retrieve a reference to a specific table
107111

108112
To perform operations on a table, you need a reference to the specific table. Get a reference using [Get-AzStorageTable](/powershell/module/az.storage/Get-AzStorageTable).
109113

110114
```powershell
111115
$storageTable = Get-AzStorageTable –Name $tableName –Context $ctx
112116
```
113117

114-
## Reference CloudTable property of a specific table
118+
### Reference the CloudTable property of a specific table
115119

116120
> [!IMPORTANT]
117-
> Usage of CloudTable is mandatory when working with **AzTable** PowerShell module. Call the **Get-AzStorageTable** command to get the reference to this object. This command also creates the table if it does not already exist.
121+
> Using the **CloudTable** property is mandatory when working with table data via the **AzTable** PowerShell module. Call the **Get-AzStorageTable** command to get the reference to this object. This command also creates the table if it does not already exist.
118122
119-
To perform operations on a table using **AzTable**, you need a reference to CloudTable property of a specific table.
123+
To perform operations on a table using **AzTable**, return a reference to the **CloudTable** property of a specific table. The **CloudTable** property exposes the .NET methods available for managing table data from PowerShell.
120124

121125
```powershell
122-
$cloudTable = (Get-AzStorageTable –Name $tableName –Context $ctx).CloudTable
126+
$cloudTable = $storageTable.CloudTable
123127
```
124128

125129
[!INCLUDE [storage-table-entities-powershell-include](../../../includes/storage-table-entities-powershell-include.md)]
126130

127-
## Delete a table
131+
### Delete a table
128132

129133
To delete a table, use [Remove-AzStorageTable](/powershell/module/az.storage/Remove-AzStorageTable). This cmdlet removes the table, including all of its data.
130134

@@ -135,6 +139,10 @@ Remove-AzStorageTable –Name $tableName –Context $ctx
135139
Get-AzStorageTable –Context $Ctx | select Name
136140
```
137141

142+
## Azure AD
143+
144+
145+
138146
## Clean up resources
139147

140148
If you created a new resource group and storage account at the beginning of this how-to, you can remove all of the assets you have created in this exercise by removing the resource group. This command deletes all resources contained within the group as well as the resource group itself.
@@ -145,7 +153,7 @@ Remove-AzResourceGroup -Name $resourceGroup
145153

146154
## Next steps
147155

148-
In this how-to article, you learned about common Azure Table storage operations with PowerShell, including how to:
156+
In this how-to article, you learned about common Azure Table storage operations with PowerShell, including how to:
149157

150158
> [!div class="checklist"]
151159
> * Create a table

includes/storage-table-entities-powershell-include.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
author: tamram
33
ms.service: storage
44
ms.topic: include
5-
ms.date: 03/27/2019
5+
ms.date: 06/23/2022
66
ms.author: tamram
77
---
88
<!--created by Robin Shahan to go in the articles for table storage w/powershell.
@@ -71,7 +71,7 @@ This command yields results similar to the following table:
7171
| 2 | Jessie | partition2 | NM |
7272
| 4 | Steven | partition2 | TX |
7373

74-
#### Retrieve entities for a specific partition
74+
#### Retrieve entities for a specific partition key
7575

7676
```powershell
7777
Get-AzTableRow -table $cloudTable -partitionKey $partitionKey1 | ft

0 commit comments

Comments
 (0)