-1

How to run only Network security group module in an existing Azure Bicep file using Azure DevOps YAML pipeline?

greybeard
  • 2,249
  • 8
  • 30
  • 66
Satish B
  • 1
  • 1
  • Can you provide more information on the "module" and the bicep you're referencing it in. I'd answer with "Use an If condition on the module declaration, based on a parameter provided by your yaml pipelie" - but it's quite hard to guess what you are actually doing. – GordonBy May 29 '23 at 14:03
  • GordonBy :: if i want run a paticular module (like Network security Group) in existing azure bicep configuration file. its means remaining modulus to be skipped while running network security Group module using azure devops yaml pipe line – Satish B May 29 '23 at 14:43
  • 1
    Please don't comment comments asking for clarification or complementing information: Edit your question. – greybeard May 30 '23 at 13:17

1 Answers1

0

I'd suggest if you only need 1 resource, then you shouldn't be calling the main.bicep entry point to your infra deployment.

Instead, in Azure DevOps when you know that you only need NSG's call the nsg.bicep module directly with the correct parameters, not the main.bicep. This also stops you bloating up main.bicep with a lot of unnecessary conditionality (skipping) to cater for a subset-deployment scenario.

Modularisation in bicep helps create additional entry points for smaller deployments.

To read more about conditionality in Azure DevOps, had a look here: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml%2Cstages

GordonBy
  • 3,099
  • 6
  • 31
  • 53