Can you set a name for Purview managed storage account and event hubs namespace using Bicep?

Brendan Yee 60 Reputation points
2023-07-25T17:23:07.97+00:00

Hello,

I'm looking to deploy a Purview account using Bicep, and I would like all associated resources to follow naming conventions. The name can be set for the Purview account and managed resource group within the Azure Portal (managed storage account and managed Event Hubs namespace are auto-generated).

We're planning on using this Bicep file (Quickstart from Microsoft) to deploy the Purview account. My understanding is that this file will deploy the Purview account and managed resource group, but not the managed storage account and managed Event Hubs namespace.

I have two questions that I'd like to clarify:

  1. Is it possible to deploy the managed storage account and managed Event Hubs namespace as part of the Bicep file, or will it always be auto-created after the Purview account is deployed?
  2. Is it possible to set a naming convention for the managed storage account and managed Event Hubs namespace, or will these resources always be auto-named (when they are auto-created within the managed resource group)?

Thanks,
Brendan

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,524 questions
{count} votes

Accepted answer
  1. Konstantinos Passadis 19,496 Reputation points MVP
    2023-07-25T18:15:22.0633333+00:00

    Hello @Brendan Yee !

    Welcome to Microsoft QnA!

    Azure Purview managed resources (such as the managed storage account) are automatically created when an Azure Purview account is provisioned. This is a built-in aspect of Azure Purview that simplifies management and operations for users. You cannot directly control this process or include these resources as part of your Bicep file.

    The names of Azure Purview managed resources are automatically generated by Azure and follow a specific naming convention. This is done to ensure uniqueness and avoid conflicts. Unfortunately, you cannot specify custom names for these resources.

    Here is a Sample File in BICEP from GitHub - Azure Quickstart Templates:

    @description('Specify a name for the Azure Purview account.')
    param purviewName string = 'azurePurview${uniqueString(resourceGroup().id)}'
    
    @description('Specify a region for resource deployment.')
    param location string = resourceGroup().location
    
    resource purview 'Microsoft.Purview/accounts@2021-12-01' = {
      name: purviewName
      location: location
      sku: {
        name: 'Standard'
        capacity: 1
      }
      identity: {
        type: 'SystemAssigned'
      }
      properties: {
        publicNetworkAccess: 'Enabled'
        managedResourceGroupName: 'managed-rg-${purviewName}'
      }
    }
    
    
    

    as we can see we cannot set anywhere the Managed resources names

    The same applies from Azure Portal , when you try to deploy a new Purview Account


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.