Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions quickstarts/microsoft.resources/deployment-stack-storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: This template demonstrate how to use deployment stack to create and manage storage account it is just a sample test
page_type: sample
products:
- azure
- azure-resource-manager

`Tags: Microsoft.Resources/deploymentStacks`
languages:
- json
- bicep
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
param resourceGroupLocation string = resourceGroup().location
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
param vnetName string = 'vnet${uniqueString(resourceGroup().id)}'
param storageAccountName2 string = 'store${uniqueString(resourceGroup().id)}2'

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: storageAccountName
location: resourceGroupLocation
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
}
resource storageAccount2 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: storageAccountName2
location: resourceGroupLocation
kind: 'StorageV2'
sku: {
name: 'Standard_GRS'
}
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-11-01' = {
name: vnetName
location: resourceGroupLocation
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: 'Subnet-1'
properties: {
addressPrefix: '10.0.0.0/24'
}
}
{
name: 'Subnet-2'
properties: {
addressPrefix: '10.0.1.0/24'
}
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Use a deployment stack to create and manage storage account",
"description": "This template demonstrates how to use deployment stack to create and manage storage account",
"summary": "This template demonstrates how to use deployment stack to create and manage storage account",
"githubUsername": "ouldsid",
"dateUpdated": "2026-02-26",
"testResult": {
"deployments": [{
"templateFileName": "main.bicep",
"correlationId": "5e0247fd-9f5c-40a3-a741-f22d2d813f4a",
"deploymentName": "testquickstartwithprepres04102026"
},
{
"templateFileName": "prereqs/prereq.main.bicep",
"correlationId": "b12f4261-d8ab-4c0b-a8ca-4805f7465347",
"deploymentName": "testquickstartwithprepres04102026",
"templateHash": "3560143354315239734"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Create a TemplateSpec for Later Deployment

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.resources%2Ftemplatespec-create%2Fprereqs%2Fprereq.azuredeploy.json)
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.resources%2Ftemplatespec-create%2Fprereqs%2Fprereq.azuredeploy.json)
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.resources%2Ftemplatespec-create%2Fprereqs%2Fprereq.azuredeploy.json)

This is a prereq for the sample in the parent folder that creates a templateSpec and version that can be deployed later. The output of the deployment will be needed to deploy the templateSpec which will provide information for the resourceId of the templateSpec version.

See the [templateSpec documentation](https://docs.microsoft.com/azure/azure-resource-manager/templates/template-specs) for more information on how to use templateSpecs in Azure.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@description('Name of the templateSpec')
param templateSpecName string = 'ManagedDisk'

@description('Version for this instance of the templateSpec')
param templateSpecVersion string = '0.1'

@description('Location for all resources.')
param location string = resourceGroup().location

resource templateSpec 'Microsoft.Resources/templateSpecs@2019-06-01-preview' = {
name: templateSpecName
location: location
properties: {
description: 'A basic templateSpec - creates a managed disk.'
displayName: 'Managed Disk (Standard_LRS)'
}
}

resource templateSpecName_templateSpecVersion 'Microsoft.Resources/templateSpecs/versions@2019-06-01-preview' = {
parent: templateSpec
name: '${templateSpecVersion}'
location: location
properties: {
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
parameters: {
diskName: {
type: 'string'
}
location: {
type: 'string'
}
}
resources: [
{
type: 'Microsoft.Compute/disks'
name: '[parameters(\'diskName\')]'
apiVersion: '2020-05-01'
location: '[parameters(\'location\')]'
sku: {
name: 'Standard_LRS'
}
properties: {
creationData: {
createOption: 'Empty'
}
diskSizeGB: 64
}
}
]
}
}
}

output templateSpecName string = templateSpecName
output templateSpecVersion string = templateSpecVersion
output templateSpecResourceGroupName string = resourceGroup().name
output templateSpecSubscriptionId string = subscription().subscriptionId
Loading