如何在Azure PowerShell函数中导入模块? [英] How to import a module in a Azure PowerShell Function?

查看:63
本文介绍了如何在Azure PowerShell函数中导入模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从一个函数查询azure表(使用Get-AzTableRow).从我的笔记本电脑上可以很好地工作,但是azure功能中没有模块"aztable",因此我得到的只是一个红色屏幕:(有安装的方法吗?

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 therefore all i get is a red screen :( Is there a way to install it ?

谢谢!大卫

推荐答案

您不需要自己在Azure函数中安装AzTable模块.运行命令时,它将为您安装相应的模块.

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.

以下是屏幕截图:

AzTable模块的示例:

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

这篇关于如何在Azure PowerShell函数中导入模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆