如何将 Azure Powershell 输出流式传输到 Azure table 存储
How to stream Azure Powershell output to Azure table storage
我有 powershell cmdlet,可以输出列表或格式化为 table。
我想将输出流式传输到 azure table 存储以供 Power BI 访问。
这可能吗?
谢谢
使用 Azure 存储表时,您无法直接流式传输到它们,但可以逐行写入数据。
写入 table 是这样完成的
# Get the necessary modules, if needed. Latter one was not installed for me by running
# the top command.
# Install-Module AzureRM
# Install-Module AzureRMStorageTable
# Login to Azure RM model
Login-AzureRmAccount
# Some variables
$storageAccountName = <account name>
$tableName = <table name>
$partitionKey1 = <partition name
$rg = <resource group name>
# Get the storage account and its context
$storageAccount = Get-AzureRmStorageAccount -ResourceGroupName $rg `
-Name $storageAccountName
$ctx = $storageAccount.Context
# Create a new table, if needed
# New-AzureStorageTable –Name $tableName –Context $ctx
# Get a reference to the table
$storageTable = Get-AzureStorageTable –Name $tableName –Context $ctx
# Add some rows into the table
Add-StorageTableRow `
-table $storageTable `
-partitionKey $partitionKey1 `
-rowKey ("CA") -property @{"username"="Chris";"userid"=1}
有关如何使用 PowerShell 使用 Azure 存储表的更多详细信息,请参阅 this 页面。
我有 powershell cmdlet,可以输出列表或格式化为 table。 我想将输出流式传输到 azure table 存储以供 Power BI 访问。
这可能吗?
谢谢
使用 Azure 存储表时,您无法直接流式传输到它们,但可以逐行写入数据。
写入 table 是这样完成的
# Get the necessary modules, if needed. Latter one was not installed for me by running
# the top command.
# Install-Module AzureRM
# Install-Module AzureRMStorageTable
# Login to Azure RM model
Login-AzureRmAccount
# Some variables
$storageAccountName = <account name>
$tableName = <table name>
$partitionKey1 = <partition name
$rg = <resource group name>
# Get the storage account and its context
$storageAccount = Get-AzureRmStorageAccount -ResourceGroupName $rg `
-Name $storageAccountName
$ctx = $storageAccount.Context
# Create a new table, if needed
# New-AzureStorageTable –Name $tableName –Context $ctx
# Get a reference to the table
$storageTable = Get-AzureStorageTable –Name $tableName –Context $ctx
# Add some rows into the table
Add-StorageTableRow `
-table $storageTable `
-partitionKey $partitionKey1 `
-rowKey ("CA") -property @{"username"="Chris";"userid"=1}
有关如何使用 PowerShell 使用 Azure 存储表的更多详细信息,请参阅 this 页面。