In my current ASP.NET Core project I'm using Azure Active Directory authentication with X509Certificate to access Key Vault. Certificate needs to be installed on a machine to allow application to access it and finally read values from Key Vault. Right now I'm working on migrating this application to Azure Service Fabric. I've uploaded the certificate to Key Vault, modified ARM template by adding:
"osProfile": {
"secrets": [
{
"sourceVault": {
"id": "{KeyVaultIdHere}"
},
"vaultCertificates": [
{
"certificateUrl": "{CertificateUrlHere}",
"certificateStore": "My"
}
]
}
]
},
But when I deploy my application to Azure Service Fabric it seems like it doesn't have access to the certificate. Do I understand correctly that when I create cluster with such ARM template, certificate is being installed in LocalMachine\My
Store? If yes, is it possible, that os user under which application is running doesn't have access to the private key of the ceritficate? When I was running cluster on my local computer I had to give special permission to ASF local cluster user to read private key. Maybe the same needs to be done for ASF on Azure? How can do it? Thanks in advance.
NETWORK_SERVICE
should already be done automatically when provisioning certs. What's your code like for accessing KeyVault? Perhaps your methods are defaulting to look incert:\currentuser\my
, which of course is not correct for SF! – Mardoxxlocalmachine/my
store for sure. It works fine when I run ASF local cluster. Interesting is, what you mentioned, that NETWORK_SERVICE should have access to private key for such certificate installed using ARM template. Apparently, it doesn't. OnlySystem
has full access to it. There is alsoAdministrators
group mentioned, but onlyRead
permission is there. – Adam Sobaniec