Background
Our applications are in .Net core. We use Service Fabric for cluster management. We have multiple VM scale sets. We use MSI during Application startup. The code has been working for more than 6 months. We are using code as outlines in this link to get the access token.
Issue:
Recently we added Azure KVVM extension to our VM scale sets. This was done to get auto renewed cluster certificates from the KeyVault. After we made this change our applications are unable to get Access token.
We added KVVM extension in our service fabric ARM deployment template as suggested by Service Fabric team. The deployment went Through and we saw that our VMSS were in good state.
KVVm settings in the VMSS looks like this - Version 0.2
{
"secretsManagementSettings": {
"pollingIntervalInS": "86400",
"observedCertificates": [
"https://azsc-eu-padev1.vault.azure.net/secrets/clusterCertificate"
],
"requireInitialSync": true
}
}
The errors that we are getting for getting access Token on service start up is this -
Failed to get configuration key vault access token. Request to http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&client_id=2eabacbd-4fb2-4d7c-b3ab-b4e3fc7a53e7&resource=https://vault.azure.net failed with BadRequest: StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnection+HttpConnectionResponseContent, Headers:
{
Server: Microsoft-IIS/10.0
Date: Thu, 31 Jan 2019 01:24:03 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 68
}
The VMSS is showing error
Provisioning of VM extension 'KVVMExtension' has timed out. Extension installation may be taking too long, or extension status could not be obtained.
Any help on how to get KVVM extension and MSI work properly will be great.
Thanks a bunch.