我只是在看一些用于管理数据库和数据库服务器的"AzureRMSQL“powershell命令。清单在这里……
https://msdn.microsoft.com/library/azure/mt574084.aspx
似乎没有导出命令。我是不是遗漏了什么?这个函数在新的门户中,所以它应该是可能的。
对于非资源管理器SQL数据库,有命令"Start-AzureSqlDatabaseExport“,但我认为这不适用于RM数据库。
谢谢你,威尔
发布于 2016-02-24 17:03:49
我多次尝试使用以下命令:
$Credential = Get-Credential
$SqlContext = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credentials $Credential
$StorageContext = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
$Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageContext
$exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlContext -StorageContainer $Container -DatabaseName $DatabaseName -BlobName $BlobName但是,当使用New-AzureSqlDatabaseServerContext创建服务器连接上下文时,消息显示服务器未找到或无法访问:
New-AzureSqlDatabaseServerContext : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that S
QL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
At line:1 char:8
+ $Con = New-AzureSqlDatabaseServerContext -ServerName "derekserver" -C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureSqlDatabaseServerContext], SqlException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.NewAzureSqlDatabaseServerContext所以基本上我们可以推测New-AzureSqlDatabaseServerContext不能与Azure Resource Manager SQL数据库一起工作。
目前找不到具有相同功能的ARM cmdlet。
发布于 2016-02-12 23:22:49
乍一看,由于缺少适当的cmdlet,这可能会让人感到有点困惑。但是,SQL server的工作方式与存储类似。一旦有了身份验证上下文,ASM和ARM部署都会使用ASM cmdlet。
在这种情况下,您将执行如下操作
$cred = Get-Credential # sql authentication
$context = New-AzureSqlDatabaseServerContext `
-ServerName temp01confuseiosql `
-Credential $cred
$storagecontext = (Get-AzureRmStorageAccount `
-ResourceGroupName testrg `
-Name teststore01).Context
Start-AzureSqlDatabaseExport -SqlConnectionContext $context `
-StorageContext $storagecontext `
-StorageContainerName sql `
-DatabaseName testdb `
-BlobName $blobnamehttps://stackoverflow.com/questions/35359935
复制相似问题