Linked Server from On-Premise to Azure SQL Database
Depending on how you create the text file, it can be in all sorts of formats.  Unicode or ANSI. With or without a Byte order Mark.  With or without trailing whitespace and line feeds, either posix or Windows style. 

JSON is simpler that way.  

For instance if you run cmd.exe

c:\&gt;echo CowboYs4EVR! &gt; password.txt


and then dump the bulk column

SELECT BulkColumn
FROM    OPENROWSET(BULK 'C:\temp\password.txt', SINGLE_blob) AS x   


You'll see

0x436F77626F79733445565221200D0A


An ANSI tring with a trailing space and trailing CRLF, which you'll need to trim, like this:

set @password = trim(replace(replace(@password, char(13),''),char(10),''))


If you write the file from PowerShell it's likely to be unicode, etc.

But if you store the password in a json file instead, SQL Server will do the file format parsing for you.  

eg something as simple as:

C:\temp&gt;echo ["CowboYs4EVR!"] &gt; password.json


and

DECLARE @password VARCHAR(MAX)
SELECT  @password = json_value(BulkColumn, '$[0]')
FROM    OPENROWSET(BULK 'C:\temp\password.json', SINGLE_CLOB) AS x