We are encountering an error when attempting to add a new row to an Azure Storage Table using the -UseConnectedAccount context rather than a key based authentication in PowerShell.
Error Message is: MethodInvocationException: Exception calling "Execute" with "1" argument(s): "The specified resource does not exist."
Script code:
$StorageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -UseConnectedAccount
$table = Get-AzStorageTable -Name $tableName -Context $storageContext
Add-AzTableRow -Table $table.CloudTable -PartitionKey "PartitionKey1" -RowKey "RowKey1" -Property @{"Property1"="Value1"}
We have provided the Storage Table contributor role. Additionally, we have attempted to use the .NET SDK as shown below. However, we are encountering an error:
Exception calling "Execute" with "1" argument(s):
"The specified resource does not exist."
Microsoft.Azure.Cosmos.Table.StorageException: The specified resource does not exist."
Script Code:
$StorageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -UseConnectedAccount
$table = Get-AzStorageTable -Name $tableName -Context $storageContext
$entity = New-Object -TypeName Microsoft.Azure.Cosmos.Table.DynamicTableEntity -ArgumentList "PartitionKey1", "RowKey1"
$entity.Properties.Add("Property1", "Value1")
$table.CloudTable.Execute([Microsoft.Azure.Cosmos.Table.TableOperation]::InsertOrReplace($entity))


