microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

[BUG]: Invoke-Sqlcmd : Could not load file or assembly 'Azure.Core, Version=1.6.0.0, Culture=neutral #20025

Open Varaprasad91 opened 4 months ago

Varaprasad91 commented 4 months ago

New issue checklist

Task name

Azurepowershell

Task version

5.241.0

Issue Description

$serverName = "$()" $databaseName = "$()" $userName = "$()" $password = "$()" $sql_query_ad_groups_list ="select distinct arm from [HMDP_Access_Management].[access_group] ag inner join [HMDP_Access_Management].[access_object_group_assignment] aoga

$csvFilePath = "ad_groups_list.csv" Invoke-Sqlcmd -ConnectionString "Server=$serverName;Database=$databaseName;User ID=$userName;Password=$password;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" -Query $sql_query_ad_groups_list |Export-Csv -Path $csvFilePath -NoTypeInformation

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows 2019 and windows latest

Relevant log output

Invoke-Sqlcmd : Could not load file or assembly 'Azure.Core, Version=1.6.0.0, Culture=neutral, 
PublicKeyToken=92742159e12e44c8' or one of its dependencies. The system cannot find the file specified.
 D:\a\_temp\7ec9c846-c687-4604-ab85-bc00e6e70b6d.ps1:46 char:1
 Invoke-Sqlcmd -ConnectionString "Server=$serverName;Database=$databas ...

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

v-schhabra commented 4 months ago

Hi @https://github.com/microsoft/SQLServerPSModule/issues Could you please check this issue? It seems like the error is thrown from Invoke-Sqlcmd Error record: 2024-06-18T08:14:18.7721788Z ##[debug]Invoke-Sqlcmd : Method not found: 'Void Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.SqlColumnEncryptionAzureKeyVaultProvider..ctor(Azure.Core.TokenCredential)'.

Varaprasad91 commented 4 months ago

Tired with different patterns of the version , but sadly nothing of them working out