Backup/Restore Managed Instance (#1428)

* Enabled backup to and restore from URL

* Created RPC, but when process tries to load Microsoft.Azure.Storage.Blob.dll, it crashes

* Added create shared access token

* Code refactor

* Minor changes

* Changed RPC path

* Moved createSas RPC to the newly created BlobService, fixed PR comments

* Added sas expiration date parameter to the RPC

* Added copyright headers

* Removed ConnectionInstance property from BlobService

* Removed unhelpful comment

* Removed unused using statements

* Changed copy/paste comments

* Disposable objects fix

* Small formatting fix

* Changed backup to/restore from url supported device types

* Added backup to url integration test

* Created restore integration test. Test are now getting azure blob params from env variables instead of file.

* Culture invariant epiration date param, fixed comment, and typo

* Updated headers

* PR comments fix

* Changed supported device type logic

* string localization fix

* String formatting fix

* build failure fix

* Typo

* Updated supported restore device types
This commit is contained in:
Nemanja Milovančević
2022-04-20 23:01:13 +02:00
committed by GitHub
parent 35e1782a3f
commit 881c335cdf
21 changed files with 828 additions and 7 deletions

View File

@@ -2589,6 +2589,30 @@ namespace Microsoft.SqlTools.ServiceLayer
}
}
public static string NotSupportedCloudCreateSas
{
get
{
return Keys.GetString(Keys.NotSupportedCloudCreateSas);
}
}
public static string CreateSasForBlobContainerFailed
{
get
{
return Keys.GetString(Keys.CreateSasForBlobContainerFailed);
}
}
public static string WriteSASCredentialToSqlServerFailed
{
get
{
return Keys.GetString(Keys.WriteSASCredentialToSqlServerFailed);
}
}
public static string CategoryLocal
{
get
@@ -9192,6 +9216,11 @@ namespace Microsoft.SqlTools.ServiceLayer
return Keys.GetString(Keys.EditDataIncorrectTable, tableName);
}
public static string UnsupportedDeviceType(String deviceType, String engineEdition)
{
return Keys.GetString(Keys.UnsupportedDeviceType, deviceType, engineEdition);
}
public static string CreateSessionFailed(String error)
{
return Keys.GetString(Keys.CreateSessionFailed, error);
@@ -10388,6 +10417,9 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string NoBackupsetsToRestore = "NoBackupsetsToRestore";
public const string UnsupportedDeviceType = "UnsupportedDeviceType";
public const string ScriptTaskName = "ScriptTaskName";
@@ -10418,6 +10450,15 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string SessionAlreadyExists = "SessionAlreadyExists";
public const string NotSupportedCloudCreateSas = "NotSupportedCloudCreateSas";
public const string CreateSasForBlobContainerFailed = "CreateSasForBlobContainerFailed";
public const string WriteSASCredentialToSqlServerFailed = "WriteSASCredentialToSqlServerFailed";
public const string CategoryLocal = "CategoryLocal";

View File

@@ -1532,6 +1532,11 @@
<value>No backupset selected to be restored</value>
<comment></comment>
</data>
<data name="UnsupportedDeviceType" xml:space="preserve">
<value>Unsupported device type {0} for engine edition {1}.</value>
<comment>.
Parameters: 0 - deviceType (String), 1 - engineEdition (String) </comment>
</data>
<data name="ScriptTaskName" xml:space="preserve">
<value>scripting</value>
<comment></comment>
@@ -1577,6 +1582,18 @@
<comment>.
Parameters: 0 - sessionName (String) </comment>
</data>
<data name="NotSupportedCloudCreateSas" xml:space="preserve">
<value>Create shared access signature is not supported for cloud instances.</value>
<comment></comment>
</data>
<data name="CreateSasForBlobContainerFailed" xml:space="preserve">
<value>Cannot generate SAS URI for blob container.</value>
<comment></comment>
</data>
<data name="WriteSASCredentialToSqlServerFailed" xml:space="preserve">
<value>Failed storing shared access signature token on the SQL Servers.</value>
<comment></comment>
</data>
<data name="CategoryLocal" xml:space="preserve">
<value>[Uncategorized (Local)]</value>
<comment>job categories</comment>

View File

@@ -742,6 +742,7 @@ RestoreBackupSetUserName = User Name
RestoreBackupSetExpiration = Expiration
TheLastBackupTaken = The last backup taken ({0})
NoBackupsetsToRestore = No backupset selected to be restored
UnsupportedDeviceType(String deviceType, String engineEdition) = Unsupported device type {0} for engine edition {1}.
############################################################################
# Generate Script
@@ -762,6 +763,11 @@ StopSessionFailed(String error) = Failed to stop session: {0}
SessionNotFound = Cannot find requested XEvent session
SessionAlreadyExists(String sessionName) = An XEvent session named {0} already exists
############################################################################
# Azure Blob Service
NotSupportedCloudCreateSas = Create shared access signature is not supported for cloud instances.
CreateSasForBlobContainerFailed = Cannot generate SAS URI for blob container.
WriteSASCredentialToSqlServerFailed = Failed storing shared access signature token on the SQL Servers.
;job categories
CategoryLocal = [Uncategorized (Local)]

View File

@@ -5757,6 +5757,26 @@ The Query Processor estimates that implementing the following index could improv
*/</target>
<note>title of missing index details</note>
</trans-unit>
<trans-unit id="CreateSasForBlobContainerFailed">
<source>Cannot generate SAS URI for blob container.</source>
<target state="new">Cannot generate SAS URI for blob container.</target>
<note></note>
</trans-unit>
<trans-unit id="WriteSASCredentialToSqlServerFailed">
<source>Failed storing shared access signature token on the SQL Servers.</source>
<target state="new">Failed storing shared access signature token on the SQL Servers.</target>
<note></note>
</trans-unit>
<trans-unit id="UnsupportedDeviceType">
<source>Unsupported device type {0} for engine edition {1}.</source>
<target state="new">Unsupported device type {0} for engine edition {1}.</target>
<note></note>
</trans-unit>
<trans-unit id="NotSupportedCloudCreateSas">
<source>Create shared access signature is not supported for cloud instances.</source>
<target state="new">Create shared access signature is not supported for cloud instances.</target>
<note></note>
</trans-unit>
<trans-unit id="TableDesignerGraphTableTypeTitle">
<source>Type</source>
<target state="new">Type</target>