How to import a module in a Azure PowerShell Function?

前端 未结 2 742
一生所求
一生所求 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
    

提交回复
热议问题