Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Output Azure Function Data to Azure Table Service with an PowerShell Azure Function. Associated blog
$breweryDBURI = ''
$key = 'myAPIKey'
$stylesURI = "$($breweryDBURI)styles?key=$($key)"
$beerStyles = Invoke-RestMethod -Uri $stylesURI -Method Get
[PSObject []] $outputArray = $null
foreach ($style in ${
$entity = [PSObject]@{
partitionKey = 'myEvents'
rowKey = $"/","-")
name = $style.shortName
ibuMin = $style.ibuMin
ibuMax = $style.ibuMax
abvMax = $style.abvMax
abvMin = $style.abvMin
srmMax = $style.srmMax
srmMin = $style.srmMin
ogMax = $style.ogMax
ogMin = $style.ogMin
fgMax = $style.fgMax
fgMin = $style.fgMin
$outputArray += $entity
if ($outputArray){
write-host "$($outputArray.Count) Styles"
# write rows out to the Table
$outputArray | ConvertTo-Json | Out-File $outputTable
Out-File -Encoding Ascii -FilePath $res -inputObject "$($outputArray.Count) Styles added to Azure Table Service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.