How to import a module in a Azure PowerShell Function?

前端 未结 2 736
一生所求
一生所求 2021-01-28 04:23

Im trying to query an azure table from a function ( using Get-AzTableRow ) . Works very well from my laptop but the module \"aztable\' is not present in the azure function, and

相关标签:
2条回答
  • 2021-01-28 04:57

    You do not need to install the AzTable module in the Azure Function yourself. When you run the command, it will install the corresponding module for you.

    Here are the screenshots:

    The example of the AzTable module:

    $location = "eastus"
    $resourceGroup = "charlesTable11"
    New-AzResourceGroup -ResourceGroupName $resourceGroup -Location $location
    $storageAccountName = "pshtablestorage1122"
    $storageAccount = New-AzStorageAccount -ResourceGroupName $resourceGroup `
      -Name $storageAccountName `
      -Location $location `
      -SkuName Standard_LRS `
      -Kind Storage
    
    $ctx = $storageAccount.Context
    $tableName = "pshtesttable"
    New-AzStorageTable –Name $tableName –Context $ctx
    Get-AzStorageTable –Context $ctx | select Name
    

    0 讨论(0)
  • 2021-01-28 05:02

    Azure PowerShell is installed or updated, you must install module AzTable, which has the commands for managing the entities. To install this module, run PowerShell as an administrator and use the Install-Module command. You may refer to the suggestion mentioned in this article. https://docs.microsoft.com/en-us/azure/storage/tables/table-storage-how-to-use-powershell

    Please see https://docs.microsoft.com/en-us/azure/azure-functions/supported-languages

    AzTable module:Supported languages in Azure Functions powershellgallery.com/packages/AzTable/2.0.1

    Kindly let us know if the above helps or you need further assistance on this issue.

    0 讨论(0)
提交回复
热议问题