-
Notifications
You must be signed in to change notification settings - Fork 815
Open
Labels
Needs: UpvoteThis issue requires more votes to be consideredThis issue requires more votes to be consideredenhancementNew feature or requestNew feature or request
Milestone
Description
Make it easy to select a section of code in a bicep file and move that code into a module and replace the selected code with the instantiation of that now module.
For example, if I have a bicep file like the below:
param namePrefix string
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: '${namePrefix}${uniqueString(resourceGroup().id)}'
location: resourceGroup().location
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
}If I highlight the storage account resource and execute an "extract to module" command, I should get something like the following:
main.bicep
param namePrefix string
module storageDeploy 'storage.bicep' = {
params: {
namePrefix: namePrefix
}
}storage.bicep (the command should ask me for this filename)
param namePrefix string
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: '${namePrefix}${uniqueString(resourceGroup().id)}'
location: resourceGroup().location
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
}Note the command would have needed to notice that the namePrefix param was used in the resource declaration, and replicate that over to the module accordingly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: UpvoteThis issue requires more votes to be consideredThis issue requires more votes to be consideredenhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo