簡體   English   中英

如何將Azure Powershell輸出流式傳輸到Azure表存儲

[英]How to stream Azure Powershell output to Azure table storage

我有Powershell cmdlet,可以輸出列表或將其格式化為表格。 我想將輸出流式傳輸到Power BI可以訪問的蔚藍表存儲中。

這可能嗎?

謝謝

使用Azure存儲表時,您無法直接流式傳輸到它們,但可以逐行寫入數據。

寫入表是這樣完成的

# 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存儲表的更多詳細信息,請參見此頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM