New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-AzureRmKeyVault fails with an error after updating AzureRM to 5.0.0 #4953

Closed
ash1625 opened this Issue Nov 9, 2017 · 9 comments

Comments

Projects
None yet
8 participants
@ash1625

ash1625 commented Nov 9, 2017

Cmdlet(s)

New-AzureRmKeyVault

PowerShell Version

PSVersion : 5.1.16299.15
AzureRm Version : 5.0.0

Module Version

OS Version

10.0.16299.15

Description

I updated my AzureRM module to 5.0.0 and when I try to run New-AzureRMKeyVault I get the below error

New-AzureRmKeyVault : Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Debug Output

DEBUG: 2:56:57 PM - NewAzureKeyVault begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 2:56:57 PM - using account id 'ashind@microsoft.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'ashind@microsoft.com', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (2 items)
Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - TokenCache: 59.0154462816667 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 8c6e5150-e2de-4697-b92b-245defa6cdbb - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: 4O/F+/QRCQSUI6lonClludQukgAvRYwjsLK9vNcQuEo=
Refresh Token Hash: nOlZJvwr9lSwcHADyGRMjZB6oBzi8+2UuNO86a7PM2U=
Expiration Time: 11/09/2017 23:55:58 +00:00
User Hash: zgw64jLEdftXW61TkZVQoJt4KSuSGfpunJmXIjCssqA=

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: - TokenCache: Serializing token cache with 2 items.

DEBUG: [Common.Authentication]: Authenticating using Account: 'ashind@microsoft.com', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (2 items)
Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - TokenCache: 59.0154462816667 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: a1498cba-82e5-4eef-8d12-8f73157eee20 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: 4O/F+/QRCQSUI6lonClludQukgAvRYwjsLK9vNcQuEo=
Refresh Token Hash: nOlZJvwr9lSwcHADyGRMjZB6oBzi8+2UuNO86a7PM2U=
Expiration Time: 11/09/2017 23:55:58 +00:00
User Hash: zgw64jLEdftXW61TkZVQoJt4KSuSGfpunJmXIjCssqA=

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: - TokenCache: Serializing token cache with 2 items.

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (2 items)
Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - TokenCache: 59.01541286 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: 3f23b8d2-8605-474e-9293-f470f0a4ed9e - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: 4O/F+/QRCQSUI6lonClludQukgAvRYwjsLK9vNcQuEo=
Refresh Token Hash: nOlZJvwr9lSwcHADyGRMjZB6oBzi8+2UuNO86a7PM2U=
Expiration Time: 11/09/2017 23:55:58 +00:00
User Hash: zgw64jLEdftXW61TkZVQoJt4KSuSGfpunJmXIjCssqA=

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 11/09/2017 22:56:57: - TokenCache: Serializing token cache with 2 items.

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/a43a3132-ec4b-47e4-a861-c7b86e988659/resources?$filter=resourceType eq 'Microsoft.KeyVault%2Fvaults'&api-version=2016-09-01

Headers:
x-ms-client-request-id : f85f3dcf-1dce-4db4-bf56-519573709feb
accept-language : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-reads: 14956
x-ms-request-id : 06c565cd-3c67-4b79-bf80-0453c49b1b86
x-ms-correlation-request-id : 06c565cd-3c67-4b79-bf80-0453c49b1b86
x-ms-routing-request-id : WESTUS2:20171109T225658Z:06c565cd-3c67-4b79-bf80-0453c49b1b86
Strict-Transport-Security : max-age=31536000; includeSubDomains
Cache-Control : no-cache
Date : Thu, 09 Nov 2017 22:56:57 GMT

Body:
{
"value": [
{
"id": "/subscriptions/a43a3132-ec4b-47e4-a861-c7b86e988659/resourceGroups/DMSIPINFRA2SouthCentralUSRG/providers/Microsoft.KeyVault/vaults/dmsvaultsi2scus",
"name": "dmsvaultsi2scus",
"type": "Microsoft.KeyVault/vaults",
"location": "southcentralus",
"tags": {}
}
]
}

WARNING: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
New-AzureRmKeyVault : Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the
file specified.
At line:1 char:1

  • New-AzureRmKeyVault -VaultName testkeyVault -ResourceGroupName Geneva ...
  •   + CategoryInfo          : CloseError: (:) [New-AzureRmKeyVault], FileNotFoundException
      + FullyQualifiedErrorId : Microsoft.Azure.Commands.KeyVault.NewAzureKeyVault
    
    

DEBUG: AzureQoSEvent: CommandName - New-AzureRmKeyVault; IsSuccess - False; Duration - 00:00:01.0145895; Exception - System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services.Clien
t, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Microsoft.Azure.ActiveDirectory.GraphClient.ActiveDirectoryClient..ctor(Uri serviceRoot, Func1 accessTokenGetter, IEnumerable1 customTypeMappings)
at Microsoft.Azure.Commands.KeyVault.KeyVaultManagementCmdletBase.get_ActiveDirectoryClient()
at Microsoft.Azure.Commands.KeyVault.NewAzureKeyVault.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
;
DEBUG: Finish sending metric.
DEBUG: 2:56:59 PM - NewAzureKeyVault end processing.
DEBUG: 2:56:59 PM - NewAzureKeyVault end processing.

Script/Steps for Reproduction

Try to create a key vault using New-AzureRmKeyVault after updating AzureRM to 5.0.0

@markcowl

This comment has been minimized.

Member

markcowl commented Nov 10, 2017

@ash1625 Yes, thsi is a known issue and we are starting a hotfix for this issue. You can work around this for now pre-loading the modules:

Add-Type -Path <path-to-azure.storage-module>\Microsoft.Data.Service.Clients.dll

You may need to load the other microsoft.data clients in that directory similarly.

@markcowl

This comment has been minimized.

Member

markcowl commented Nov 10, 2017

@ash1625 The fix for this was just released. If you update your AzureRM or AzureRM.KeyVault modules form the gallery, you should get the fix

@markcowl markcowl closed this Nov 10, 2017

@sanathkumarshetty

This comment has been minimized.

sanathkumarshetty commented Jan 13, 2018

@markcowl i have AzureRM version 5.1.1 and still have the same issue and the work around mentioned also does not seem to work ,

@till0r

This comment has been minimized.

till0r commented Jan 15, 2018

@markcowl I'm experiencing the same issues as @sanathkumarshetty on version 5.1.1 when using Get-AzureRmKeyVault or New-AzureRmKeyVault.

@sanathkumarshetty

This comment has been minimized.

sanathkumarshetty commented Jan 15, 2018

@till0r @markcowl it seems like after updating to the latest version of AzureRM did not update the AzureRM.Storage module , so when i manually update the AzureRM.Storage as well it started working for me

@till0r

This comment has been minimized.

till0r commented Jan 16, 2018

Thank you, @sanathkumarshetty, you are right! Updating Azure.Storage and AzureRm.Storage fixed the issue

@Phydeauxman

This comment has been minimized.

Phydeauxman commented Jan 22, 2018

I am experiencing the same issue and updating those modules did not help.

@daviburg

This comment has been minimized.

Member

daviburg commented Mar 15, 2018

Had this issue. Upgraded to Azure RM 5.5 per https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-5.5.0
Issue is resolved after upgrade and restart PowerShell console.

@arvinder-dhar

This comment has been minimized.

arvinder-dhar commented Jul 8, 2018

Thanks @daviburg , it worked
I had updated my AzureRM module earlier, but didn't restarted the console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment