Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Runbook无法使用命令New AzureRmSqlDatabaseExport(对象引用未设置为对象的实例)_Azure_Azure Runbook - Fatal编程技术网

Runbook无法使用命令New AzureRmSqlDatabaseExport(对象引用未设置为对象的实例)

Runbook无法使用命令New AzureRmSqlDatabaseExport(对象引用未设置为对象的实例),azure,azure-runbook,Azure,Azure Runbook,当我尝试在PowerShell Runbook中运行命令New AzureRmSqlDatabaseExport时,失败并显示错误消息: New-AzureRmSqlDatabaseExport : Object reference not set to an instance of an object. 我已经验证了所有模块都已更新,编写本文时AzureRM.Sql的版本为4.12.1。新的AzureRmSqlDatabaseExport是AzureRM.Sql的一部分,也可以在runboo

当我尝试在PowerShell Runbook中运行命令New AzureRmSqlDatabaseExport时,失败并显示错误消息:

New-AzureRmSqlDatabaseExport : Object reference not set to an instance of an object.
我已经验证了所有模块都已更新,编写本文时AzureRM.Sql的版本为4.12.1。新的AzureRmSqlDatabaseExport是AzureRM.Sql的一部分,也可以在runbook编辑器中找到

我错过了什么

更新:我尝试运行的代码如下所示:

$exportRequest = New-AzureRmSqlDatabaseExport -ResourceGroupName "MyResourceGroup" -ServerName "MyServerName" -DatabaseName "MyDatabaseName" -StorageKeytype StorageAccessKey -StorageKey "MyStorageKey" -StorageUri "https://mystorage.blob.core.windows.net/backupdb/db.bacpac" -AdministratorLogin "userName" -AdministratorLoginPassword (ConvertTo-SecureString "mypassword" -AsPlainText -Force)

它确实可以在Azure Cloud Shell中工作。

在执行命令之前,请确保您已通过身份验证。在命令之前添加这些行将解决此问题:

$connection = Get-AutomationConnection -Name AzureRunAsConnection
Connect-AzureRmAccount -ServicePrincipal -Tenant $connection.TenantID `
-ApplicationId $connection.ApplicationID -CertificateThumbprint $connection.CertificateThumbprint
您可以在此处找到更多信息:


你能显示代码吗?检查你所有的参数都是你期望的正确值,并且与新的AzureRmSqlDatabaseExport期望的值相匹配。你是对的,我应该提供一个例子。问题已更新。