Azure KeyVault nuget package issues - azure

When I installing Azure.KeyVault package version 3 alpha, I'm getting the following runtime exception:
Could not load file or assembly 'Microsoft.Azure.KeyVault, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)
Downgrading this package to latest stable 2.3.2 causes another error:
Here is my package list with dependencies:
Any ideas or workaround on this?

Seems like the problem was inside v2 runtime:
https://github.com/Azure/azure-functions-host/issues/2854
My decision was to turn roll back to v1 Functions, cause I found another issues during the KeyVault implementation by this article:
https://learn.microsoft.com/en-us/azure/app-service/app-service-managed-service-identity
Here is the issue:
https://github.com/Azure/azure-functions-host/issues/2852

Related

Get-AzureRmSnapshot throws error Get-AzureRmSnapshot : Method 'get_SerializationSettings'

When trying to restore my azure VM from previous snapshot using powershell I get error:
Get-AzureRmSnapshot : Method 'get_SerializationSettings' in type
'Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient'
from assembly 'Microsoft.Azure.Commands.ResourceManager.Common,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
does not have an implementation.
This is a known issue, documented by Microsoft.
The error indicates that the Azure Resource Manager modules and Az modules are loaded in the same session and those modules are not compatible with each other.
Remediation: Uninstall the conflicting modules. Either Azure Resource Manager modules or the Az modules
https://learn.microsoft.com/en-us/azure-stack/operator/azure-stack-powershell-install?view=azs-2008
Close powershell and try relauch. It fixed the issue.
Hope it help others who is facing the similar issue.

Azure Function Nuget Cache restore failing with "The user name or password is incorrect."

I have an Azure Function I deploy as a part of an ARM template. This Azure Function references a few external .NET DLLs. I have added the reference to these DLLs in the project.json file:
project.json:
{
"frameworks": {
"net46": {
"dependencies": {
"Microsoft.IdentityModel.Clients.ActiveDirectory":"3.13.8",
"Newtonsoft.Json": "10.0.2",
"Microsoft.CrmSdk.CoreAssemblies" : "8.2.0.2"
}
}
}
}
When I click run, the Nuget Cache restore is kicked off. It fails with "The user name or password is incorrect."
The strange thing is the Nuget Packages are being copied to the Functions Nuget cache correctly, but the project.lock.json file is failing to be created. It appears the username / password error is thrown after the Nuget cache restore completes and when Azure tries to write the project.lock.json file. The compile then fails as the project.lock.json file is not created.
2017-11-14T21:06:34.892 Restoring packages.
2017-11-14T21:06:34.892 Starting NuGet restore
2017-11-14T21:06:36.239 Function started (Id=1340feea-174d-4bee-97f2-e06afc2e2d6e)
2017-11-14T21:06:36.239 Package references have been updated.
2017-11-14T21:06:36.239 Restoring packages.
2017-11-14T21:06:36.239 Starting NuGet restore
2017-11-14T21:06:36.955 Restoring packages for D:\home\site\wwwroot\ProvisionUserToCRM\project.json...
2017-11-14T21:06:37.456 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.clients.activedirectory/index.json
2017-11-14T21:06:37.486 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.clients.activedirectory/3.13.8/microsoft.identitymodel.clients.activedirectory.3.13.8.nupkg
2017-11-14T21:06:37.705 CACHE https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
2017-11-14T21:06:37.705 CACHE https://api.nuget.org/v3-flatcontainer/newtonsoft.json/10.0.2/newtonsoft.json.10.0.2.nupkg
2017-11-14T21:06:37.800 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.crmsdk.coreassemblies/index.json
2017-11-14T21:06:37.800 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.crmsdk.coreassemblies/8.2.0.2/microsoft.crmsdk.coreassemblies.8.2.0.2.nupkg
2017-11-14T21:06:37.881 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel/index.json
2017-11-14T21:06:37.881 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel/6.1.7600.16394/microsoft.identitymodel.6.1.7600.16394.nupkg
2017-11-14T21:06:38.002 Installing Microsoft.IdentityModel 6.1.7600.16394.
2017-11-14T21:06:38.362 Installing Microsoft.CrmSdk.CoreAssemblies 8.2.0.2.
2017-11-14T21:06:38.939 Restoring packages for D:\home\site\wwwroot\ProvisionUserToCRM\project.json...
2017-11-14T21:06:39.113 Installing Newtonsoft.Json 10.0.2.
2017-11-14T21:06:39.255 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.clients.activedirectory/index.json
2017-11-14T21:06:39.284 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.clients.activedirectory/3.13.8/microsoft.identitymodel.clients.activedirectory.3.13.8.nupkg
2017-11-14T21:06:39.455 CACHE https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
2017-11-14T21:06:39.455 CACHE https://api.nuget.org/v3-flatcontainer/newtonsoft.json/10.0.2/newtonsoft.json.10.0.2.nupkg
2017-11-14T21:06:39.470 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.crmsdk.coreassemblies/index.json
2017-11-14T21:06:39.470 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.crmsdk.coreassemblies/8.2.0.2/microsoft.crmsdk.coreassemblies.8.2.0.2.nupkg
2017-11-14T21:06:39.490 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel/index.json
2017-11-14T21:06:39.502 CACHE https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel/6.1.7600.16394/microsoft.identitymodel.6.1.7600.16394.nupkg
2017-11-14T21:06:39.642 Installing Microsoft.IdentityModel.Clients.ActiveDirectory 3.13.8.
2017-11-14T21:06:41.211 Installing Microsoft.IdentityModel 6.1.7600.16394.
2017-11-14T21:06:42.367 Installing Microsoft.CrmSdk.CoreAssemblies 8.2.0.2.
2017-11-14T21:06:46.398 Installing Microsoft.IdentityModel.Clients.ActiveDirectory 3.13.8.
2017-11-14T21:06:49.197 Installing Newtonsoft.Json 10.0.2.
2017-11-14T21:06:52.171 The user name or password is incorrect.
2017-11-14T21:06:52.189
2017-11-14T21:06:52.189
2017-11-14T21:06:52.189 Packages restored.
2017-11-14T21:06:52.500 Script for function 'ProvisionUserToCRM' changed. Reloading.
2017-11-14T21:06:52.813 run.csx(2,18): error CS0234: The type or namespace name 'IdentityModel' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
2017-11-14T21:06:52.813 run.csx(3,8): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Does anyone know why this error is displayed? It seems to come intermittently for me. Seems like a bug in Azure Functions. Are there any known work arounds?
I found enabling 'Slots' preview feature on Azure Functions actually resolves this issue, but 'Slots' will not work for me as they are not compatible with Azure Logic Apps.
Looks like Microsoft has confirmed this is a bug in Azure Functions
https://github.com/Azure/Azure-Functions/issues/590
The only work around I am aware of is to:
enable slots feature
keep re deploying your ARM template until it works
(I did not verify this) but I suspect it would work if you manually generated and dropped the lock file to the Functions file system. You could generate the lock file locally with visual studio. I suspect this would work because from what I observed is the NuGet packages seem to be restored correctly, and the error comes during the write of the JSON file. The compiler must reference the lock file rather than the actual NuGet cache when trying to compile (hence why the error is coming even though the DLL actually exists).

Entity framework assembly issue

When i am try to use bulkinsert method on EF by using entityframework.bulinsert dll getting Error message _"Could not load file or assembly 'EntityFramework.MappingAPI, Version=5.0.0.6, Culture=neutral, PublicKeyToken=7ee2e825d201459e' or one of its dependencies. The system cannot find the file specified".
It simply means the assembly is missing in your project AND/OR 'EntityFramework.MappingAPI, Version=5.0.0.6, is missing in your References.
Download the 'EntityFramework.MappingAPI, Version=5.0.0.6, from HERE
Extract the dll's from the folder and add a reference to the appropriate one that is version 5, from your solution.
OR
To install EntityFramework.MappingAPI, run the following command in the Package Manager Console
PM> Install-Package EntityFramework.MappingAPI -Version 5.0.0.6
This will install and automatically add a reference to it.``

Error rebuilding ATMHud.DLL for Monotouch

After updating to the latest versions of Xamarin Studio this morning the ZBar and ATMHud references in our project started throwing a bunch of errors, all of which were:
The type 'MonoTouch.UIKit.UIViewController' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0012)'
I did some reading and found out that I needed to rebuild both of the libraries because of something to do with "assembly strong names" in Xamarin. I was able to muddle my way through rebuilding the ZBar library, but the ATMHud rebuild has given me some trouble and I'm not familiar enough with what I'm doing to fix the problem.
I downloaded the ATMHud project from github and followed the instructions in the readme which state "Run 'make' in the binding directory to build ATMHud.dll", but when I do that I get errors.
Teds-Mac:binding ted$ make
/Developer/MonoTouch/usr/bin/btouch -e atmhud.cs enums.cs AssemblyInfo.cs --out=ATMHud.dll --link-with=libATMHudSDK.a,libATMHudSDK.a
/var/folders/75/vl_6zkyx03sc4tymnp41lsgw0000gn/T/09x9yx7m.nz9/AtmHud/AtmHud.g.cs(751,86): error CS0103: The name class_ptr' does not exist in the current context
/var/folders/75/vl_6zkyx03sc4tymnp41lsgw0000gn/T/09x9yx7m.nz9/AtmHud/AtmSoundFX.g.cs(75,104): error CS0103: The nameclass_ptr' does not exist in the current context
Compilation failed: 2 error(s), 0 warnings
btouch: API binding contains errors.
make: * [ATMHud.dll] Error 1
I've scanned through the files in the folders but can't seem to track down any references to "class_ptr".
Can anyone help with what might be the cause of the problem I'm seeing, and can you confirm that this will get me past the original "assembly strong names" problem I'm seeing?
As a temporary measure you can fix your old assemblies with this tool: https://github.com/rolfbjarne/iOSRefUpdater
Update
I've fixed the ATMHud bindings, now they should compile with newer versions of Xamarin.iOS installed as well.

SubSonic "Version" fails due to missing dependencies

I am using SubSonic 2.1 Final but having problems running "Version" with the SubCommander. I think this problem began when I installed SQL Server 2008 on my local machine and removed 2005.
This is the error I get:
ERROR: Trying to execute Version
Error Message: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.SmoEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.SmoEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbCollation(String dbname)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name)
at SubSonic.SubCommander.DBScripter.ScriptSchema(String connectionString) in C:\svn\subsonicproject\trunk\SubCommander\DBScripter.cs:line 51
at SubSonic.SubCommander.Program.ScriptSchema() in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 696
at SubSonic.SubCommander.Program.Main(String[] args) in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 68
Anybody knows how to make this work?
You probably have to compile SubCommander with the SqlServer 2008 version of Microsoft.SqlServer.Management.Smo dlls
I made this work by downloading the latest source and build it on my machine. Now it works great.

Resources