How to make use of the internal functions?

Cataster 636 Reputation points
2021-09-07T02:33:06.583+00:00

Not sure the best way to title this thread but basically we want to store backups on Azure Blob storage, yet Invoke-DbaDbLogShipping requires a $BackupNetworkPath. The closest I was to this was Azure File Shares but unfortunately port 445 is blocked it seems so I cant utilize that.

Im now trying to modify the Invoke-DbaDbLogShipping function to replace the mandatory $BackupNetworkPath with Azure Blob Storage upload backups logic but Im running into some issues:

Write-Message : The term 'Write-Message' is not recognized as the name of a cmdlet, function, script file, or operable program.
Test-FunctionInterrupt : The term 'Test-FunctionInterrupt' is not recognized as the name of a cmdlet, function, script file, or operable program.
Stop-Function : The term 'Stop-Function' is not recognized as the name of a cmdlet, function, script file, or operable program.
The property 'StatementTimeout' cannot be found on this object. Verify that the property exists and can be set.

To circumvent these errors, I copied/pasted them from the dbatools internal helper functions:
Write-Message
Stop-Function

but i ran into yet another issue with [Sqlcollaborative.Dbatools.dbaSystem...]
For example:

Unable to find type [Sqlcollaborative.Dbatools.dbaSystem.MessageLevel].

I tried importing the module Import-Module dbatools in the script before the Invoke-DbaDbLogShipping and that didnt help...

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,892 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 37,771 Reputation points
    2021-09-07T11:30:07.27+00:00

    Hello,

    Not sure about that script, but did you try passing SAS keys or Access keys or connection string ? Also easiest way will be looking port 445 to be open, usually it is.

    Please go through the below links and see if connection strings are useful

    https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string?toc=/azure/storage/blobs/toc.json

    https://azure.microsoft.com/en-in/blog/microsoft-azure-block-blob-storage-backup/

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    Thanks,