param
(
$table,
[string] $SubscriptionName,
[string] $SubscriptionGuid,
[string] $date,
[string] $ResourceQtyConsumed,
[string] $ResourceRate,
[string] $ExtendedCost
)
$entity = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity" #-ArgumentList $SubscriptionName,$SubscriptionGuid
$entity.Properties.Add("subscription Name",$SubscriptionName)
$entity.Properties.Add("subscriptionGuid",$SubscriptionGuid)
$entity.Properties.Add("Date",$date)
$entity.Properties.Add("resourceqtyconsumed",$ResourceQtyConsumed)
$entity.Properties.Add("resourcerate",$ResourceRate)
$entity.Properties.Add("extendedcost",$ExtendedCost)
$result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::Insert($entity))
我收到了400个错误请求,我正在尝试将数据从csv插入到azure存储表中。
下面是我得到的错误:
Exception calling "Execute" with "1" argument(s): "The remote server returned an error: (400) Bad Request."
At C:\kiran\powershell\Cost.ps1:76 char:2
+ $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : StorageException
经过研究,我知道有Rowkey和partition,但我真的不确定要把它们添加到哪里。我需要表中列出的列,但不需要分区或行键。
从powershell的azure存储表中插入数据时,会发生这种情况。
https://stackoverflow.com/questions/50881289
复制相似问题