Hello Mani,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you have tried to add secrets to the key vault from azure portal but facing error as stated and both windows VM and Azure Key Vault are in the same virtual network and same subnet.
Since your Azure Key Vault is in a private network, definitely it will happen with issues accessing it directly from the Azure portal. To resolve this error use alternative options to add secrets to your Key Vault like Azure CLI or PowerShell to add a secret. For example:
az keyvault secret set --vault-name <YourKeyVaultName> --name <SecretName> --value <SecretValue>
Set-AzKeyVaultSecret -VaultName "<YourKeyVaultName>" -Name "<SecretName>" -SecretValue "<SecretValue>"
Kindly use the additional resources by the right side of this page for more information and use this link https://learn.microsoft.com/en-us/azure/key-vault/general/private-link-service to learn more on how to Integrate Key Vault with Azure Private Link.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam