Forum Discussion

JonCi90's avatar
JonCi90
Copper Contributor
Aug 02, 2023

Error when creating SQL Credential in SSMS 19

Hi all,

 

I recently installed SQL Server 22 CU4 and SSMS 19.1.56.0 on a new VM in Azure running Server 2022 Datacenter.

 

When attempting to setup a maintenance plan with a backup, I receive the following error:

 

"Could not load file or assembly "Microsoft.SqlServer.Management.AzureAuthenticationManagement, Version=15.0.0.0, Culture=neutral, PublicKeyToken=xxx or one of its dependencies. The system cannot find the file specified. 

 

I have searched all over for a resolution for this but haven't been able to find anything. If anyone could help point me in the right direction or tell me what I may have done wrong, it would be greatly appreciated!

    • JonCi90's avatar
      JonCi90
      Copper Contributor

      KrzysztofMigacz 

      unfortunately I have had no luck correcting this issue yet. It seems at a high level that the issue is with the file located here:

      C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\Application 

       

       

      for whatever reason, SSMS may be looking for the wrong file but I have still not found a way to correct it.

  • Woody0's avatar
    Woody0
    Copper Contributor

    I was able to resolve it in SSMS 19.1.56.0 by adding this snippet:

     

                <dependentAssembly>
                      <assemblyIdentity name="Microsoft.SqlServer.Management.AzureAuthenticationManagement" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
                      <bindingRedirect oldVersion="1.0.0.0-16.0.0.0" newVersion="16.200.0.0"/>
                  </dependentAssembly>

     

    in the assemblyBinding section of the file:
    C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Ssms.exe.config. note that the version numbers may vary based on your specific environment.

    • KrzysztofMigacz's avatar
      KrzysztofMigacz
      Copper Contributor

      Woody0 Thank you for the information. I had a session with Microsoft today and am pulling this topic with them as well. I will let you know what I can figure out.
      I will also check your solution.

      • Woody0's avatar
        Woody0
        Copper Contributor

        KrzysztofMigacz FWIW - I'm attempting to set up backups from an on-prem SQL2022 server to Azure Blob Storage.  The only way I was able to create the credential was to:

        1. Right-click a database, select all tasks then back up
        2. select the destination of URL
        3. Click the Add Button
        4. Click the New Container button
        5. Sign in to an azure subscription
        6. Select the Azure Subscription, Storage Account and Blob Container, then click OK.

         

        Once the container was created, I was able to select it as a destination from within the maintenance plan, however:

         

        When trying to create a database backup from a maintenance plan, the TSQL generated is:

        BACKUP DATABASE [MYDB] TO  URL = N'https://myblob.blob.core.windows.net/backup-sql' WITH  CREDENTIAL = N'https://myblob.blob.core.windows.net/backup-sql' , NOFORMAT, NOINIT,  NAME = N'MYDB_backup.bak', SKIP, REWIND, NOUNLOAD, COMPRESSION,  STATS = 10

        This generates the error:

        Msg 3225, Level 16, State 1, Line 2
        Use of WITH CREDENTIAL syntax is not valid for credentials containing a Shared Access Signature.
        Msg 3013, Level 16, State 1, Line 2
        BACKUP DATABASE is terminating abnormally.

        Syntax that worked is:

        BACKUP DATABASE [MYDB] TO  URL = N'https://myblob.blob.core.windows.net/backup-sql/MYDB_backup.bak' WITH FORMAT, NAME = N'MYDB-Full Database Backup', COPY_ONLY, NOREWIND, NOUNLOAD,  STATS = 10

         I ended up wrapping the working syntax into a script rather than using the maintenance plan. 

  • DrewB2455's avatar
    DrewB2455
    Copper Contributor

    Hi all - 

    I had great success with Woody0 's instructions up above. As they state, you cannot create the credential in the new task dialog box or wizard.

    After following those instructions, create the plan *with* the credential you need, setting the URLs, etc. After the task is created, click on the task and open the Properties panel  and remove the value for "CredentialName":

    "Sql Credential:" in the task box should be empty.

    Save the plan and it will execute! Hope this helps.

Resources