Reference secrets with dynamic ID

Category: azure key vault

Question

Avirat on Thu, 19 Dec 2019 04:39:05


HI

As per the link https://docs.microsoft.com/en-us/Azure/azure-resource-manager/resource-manager-keyvault-parameter#reference-a-secret-with-dynamic-id

I am trying to deploy a Linux VM by using admin password form Keyvault as Dynamic id into JSON parameter file.

However getting error as follows:

New-AzResourceGroupDeployment : 2:35:41 PM - Resource Microsoft.Compute/virtualMachines/extensions 'csivm1/LinuxDiagnostic' failed with message '{
  "error": {
    "code": "ParentResourceNotFound",
    "message": "Can not perform requested operation on nested resource. Parent resource 'csivm1' not found."
  }
}'
At C:\source\Test1\LinuxVM\DeployLinuxJumphost.ps1:69 char:1
+ New-AzResourceGroupDeployment `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
 

Replies

Frank Hu MSFT on Thu, 19 Dec 2019 18:33:41


Hey Avirat,

This is not an issue with keyvault but an issue with the JSON template deployment that you're trying to deploy, related to the CSIVM1 item, can you please provide the actual JSON file that you're trying to deploy? There is probably a reference to a CSIVM1 that hasn't been deployed. 

Can you also check if there are any pre-requisites to deploy this JSON template? 

Are you following some sort of guide/doc to deploy your resource? And if so, can you please provide this information?

Thanks,

- Frank Hu

ShashiShailaj_MSFT on Mon, 23 Dec 2019 15:01:40


Helo Avirat

As requested by Frank , could you please check the JSON template ? If possible coudl you share the details . it seems that there is a reference to non-existent resource in the template file. Please share your findings in case you were able to solve the issue . It would help other community members with similar issue. In case you were able to find and fix , please do mark Frank's post as answer. If you still have the same issue , please do let us know with the Json details and we can continue the conversation. 

Thank you.