Bicep resource definition
The staticSites resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Web/staticSites resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Web/staticSites@2020-12-01' = {
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
kind: 'string'
location: 'string'
name: 'string'
properties: {
allowConfigFileUpdates: bool
branch: 'string'
buildProperties: {
apiBuildCommand: 'string'
apiLocation: 'string'
appArtifactLocation: 'string'
appBuildCommand: 'string'
appLocation: 'string'
githubActionSecretNameOverride: 'string'
outputLocation: 'string'
skipGithubActionWorkflowGeneration: bool
}
repositoryToken: 'string'
repositoryUrl: 'string'
stagingEnvironmentPolicy: 'string'
templateProperties: {
description: 'string'
isPrivate: bool
owner: 'string'
repositoryName: 'string'
templateRepositoryUrl: 'string'
}
}
sku: {
capabilities: [
{
name: 'string'
reason: 'string'
value: 'string'
}
]
capacity: int
family: 'string'
locations: [
'string'
]
name: 'string'
size: 'string'
skuCapacity: {
default: int
elasticMaximum: int
maximum: int
minimum: int
scaleType: 'string'
}
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.Web/staticSites
| Name |
Description |
Value |
| identity |
Managed service identity. |
ManagedServiceIdentity |
| kind |
Kind of resource. |
string |
| location |
Resource Location. |
string (required) |
| name |
The resource name |
string (required) |
| properties |
Core resource properties |
StaticSite |
| sku |
Description of a SKU for a scalable resource. |
SkuDescription |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
Capability
| Name |
Description |
Value |
| name |
Name of the SKU capability. |
string |
| reason |
Reason of the SKU capability. |
string |
| value |
Value of the SKU capability. |
string |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
Type of managed service identity. |
'None' 'SystemAssigned' 'SystemAssigned, UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SkuCapacity
| Name |
Description |
Value |
| default |
Default number of workers for this App Service plan SKU. |
int |
| elasticMaximum |
Maximum number of Elastic workers for this App Service plan SKU. |
int |
| maximum |
Maximum number of workers for this App Service plan SKU. |
int |
| minimum |
Minimum number of workers for this App Service plan SKU. |
int |
| scaleType |
Available scale configurations for an App Service plan. |
string |
SkuDescription
| Name |
Description |
Value |
| capabilities |
Capabilities of the SKU, e.g., is traffic manager enabled? |
Capability[] |
| capacity |
Current number of instances assigned to the resource. |
int |
| family |
Family code of the resource SKU. |
string |
| locations |
Locations of the SKU. |
string[] |
| name |
Name of the resource SKU. |
string |
| size |
Size specifier of the resource SKU. |
string |
| skuCapacity |
Min, max, and default scale values of the SKU. |
SkuCapacity |
| tier |
Service tier of the resource SKU. |
string |
StaticSite
| Name |
Description |
Value |
| allowConfigFileUpdates |
<code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. |
bool |
| branch |
The target branch in the repository. |
string |
| buildProperties |
Build properties to configure on the repository. |
StaticSiteBuildProperties |
| repositoryToken |
A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. |
string |
| repositoryUrl |
URL for the repository of the static site. |
string |
| stagingEnvironmentPolicy |
State indicating whether staging environments are allowed or not allowed for a static web app. |
'Disabled' 'Enabled' |
| templateProperties |
Template options for generating a new repository. |
StaticSiteTemplateOptions |
StaticSiteBuildProperties
| Name |
Description |
Value |
| apiBuildCommand |
A custom command to run during deployment of the Azure Functions API application. |
string |
| apiLocation |
The path to the api code within the repository. |
string |
| appArtifactLocation |
Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) |
string |
| appBuildCommand |
A custom command to run during deployment of the static content application. |
string |
| appLocation |
The path to the app code within the repository. |
string |
| githubActionSecretNameOverride |
Github Action secret name override. |
string |
| outputLocation |
The output path of the app after building. |
string |
| skipGithubActionWorkflowGeneration |
Skip Github Action workflow generation. |
bool |
StaticSiteTemplateOptions
| Name |
Description |
Value |
| description |
Description of the newly generated repository. |
string |
| isPrivate |
Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). |
bool |
| owner |
Owner of the newly generated repository. |
string |
| repositoryName |
Name of the newly generated repository. |
string |
| templateRepositoryUrl |
URL of the template repository. The newly generated repository will be based on this one. |
string |
Usage Examples
Bicep Samples
A basic example of deploying Static Web App.
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource staticSite 'Microsoft.Web/staticSites@2021-02-01' = {
name: resourceName
location: location
sku: {
name: 'Free'
tier: 'Free'
}
properties: {}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module |
Description |
| Static Web App |
AVM Resource Module for Static Web App |
ARM template resource definition
The staticSites resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Web/staticSites resource, add the following JSON to your template.
{
"type": "Microsoft.Web/staticSites",
"apiVersion": "2020-12-01",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"kind": "string",
"location": "string",
"properties": {
"allowConfigFileUpdates": "bool",
"branch": "string",
"buildProperties": {
"apiBuildCommand": "string",
"apiLocation": "string",
"appArtifactLocation": "string",
"appBuildCommand": "string",
"appLocation": "string",
"githubActionSecretNameOverride": "string",
"outputLocation": "string",
"skipGithubActionWorkflowGeneration": "bool"
},
"repositoryToken": "string",
"repositoryUrl": "string",
"stagingEnvironmentPolicy": "string",
"templateProperties": {
"description": "string",
"isPrivate": "bool",
"owner": "string",
"repositoryName": "string",
"templateRepositoryUrl": "string"
}
},
"sku": {
"capabilities": [
{
"name": "string",
"reason": "string",
"value": "string"
}
],
"capacity": "int",
"family": "string",
"locations": [ "string" ],
"name": "string",
"size": "string",
"skuCapacity": {
"default": "int",
"elasticMaximum": "int",
"maximum": "int",
"minimum": "int",
"scaleType": "string"
},
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.Web/staticSites
| Name |
Description |
Value |
| apiVersion |
The api version |
'2020-12-01' |
| identity |
Managed service identity. |
ManagedServiceIdentity |
| kind |
Kind of resource. |
string |
| location |
Resource Location. |
string (required) |
| name |
The resource name |
string (required) |
| properties |
Core resource properties |
StaticSite |
| sku |
Description of a SKU for a scalable resource. |
SkuDescription |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
| type |
The resource type |
'Microsoft.Web/staticSites' |
Capability
| Name |
Description |
Value |
| name |
Name of the SKU capability. |
string |
| reason |
Reason of the SKU capability. |
string |
| value |
Value of the SKU capability. |
string |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
Type of managed service identity. |
'None' 'SystemAssigned' 'SystemAssigned, UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SkuCapacity
| Name |
Description |
Value |
| default |
Default number of workers for this App Service plan SKU. |
int |
| elasticMaximum |
Maximum number of Elastic workers for this App Service plan SKU. |
int |
| maximum |
Maximum number of workers for this App Service plan SKU. |
int |
| minimum |
Minimum number of workers for this App Service plan SKU. |
int |
| scaleType |
Available scale configurations for an App Service plan. |
string |
SkuDescription
| Name |
Description |
Value |
| capabilities |
Capabilities of the SKU, e.g., is traffic manager enabled? |
Capability[] |
| capacity |
Current number of instances assigned to the resource. |
int |
| family |
Family code of the resource SKU. |
string |
| locations |
Locations of the SKU. |
string[] |
| name |
Name of the resource SKU. |
string |
| size |
Size specifier of the resource SKU. |
string |
| skuCapacity |
Min, max, and default scale values of the SKU. |
SkuCapacity |
| tier |
Service tier of the resource SKU. |
string |
StaticSite
| Name |
Description |
Value |
| allowConfigFileUpdates |
<code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. |
bool |
| branch |
The target branch in the repository. |
string |
| buildProperties |
Build properties to configure on the repository. |
StaticSiteBuildProperties |
| repositoryToken |
A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. |
string |
| repositoryUrl |
URL for the repository of the static site. |
string |
| stagingEnvironmentPolicy |
State indicating whether staging environments are allowed or not allowed for a static web app. |
'Disabled' 'Enabled' |
| templateProperties |
Template options for generating a new repository. |
StaticSiteTemplateOptions |
StaticSiteBuildProperties
| Name |
Description |
Value |
| apiBuildCommand |
A custom command to run during deployment of the Azure Functions API application. |
string |
| apiLocation |
The path to the api code within the repository. |
string |
| appArtifactLocation |
Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) |
string |
| appBuildCommand |
A custom command to run during deployment of the static content application. |
string |
| appLocation |
The path to the app code within the repository. |
string |
| githubActionSecretNameOverride |
Github Action secret name override. |
string |
| outputLocation |
The output path of the app after building. |
string |
| skipGithubActionWorkflowGeneration |
Skip Github Action workflow generation. |
bool |
StaticSiteTemplateOptions
| Name |
Description |
Value |
| description |
Description of the newly generated repository. |
string |
| isPrivate |
Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). |
bool |
| owner |
Owner of the newly generated repository. |
string |
| repositoryName |
Name of the newly generated repository. |
string |
| templateRepositoryUrl |
URL of the template repository. The newly generated repository will be based on this one. |
string |
Usage Examples
The staticSites resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Web/staticSites resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Web/staticSites@2020-12-01"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
kind = "string"
properties = {
allowConfigFileUpdates = bool
branch = "string"
buildProperties = {
apiBuildCommand = "string"
apiLocation = "string"
appArtifactLocation = "string"
appBuildCommand = "string"
appLocation = "string"
githubActionSecretNameOverride = "string"
outputLocation = "string"
skipGithubActionWorkflowGeneration = bool
}
repositoryToken = "string"
repositoryUrl = "string"
stagingEnvironmentPolicy = "string"
templateProperties = {
description = "string"
isPrivate = bool
owner = "string"
repositoryName = "string"
templateRepositoryUrl = "string"
}
}
sku = {
capabilities = [
{
name = "string"
reason = "string"
value = "string"
}
]
capacity = int
family = "string"
locations = [
"string"
]
name = "string"
size = "string"
skuCapacity = {
default = int
elasticMaximum = int
maximum = int
minimum = int
scaleType = "string"
}
tier = "string"
}
}
}
Property Values
Microsoft.Web/staticSites
| Name |
Description |
Value |
| identity |
Managed service identity. |
ManagedServiceIdentity |
| kind |
Kind of resource. |
string |
| location |
Resource Location. |
string (required) |
| name |
The resource name |
string (required) |
| properties |
Core resource properties |
StaticSite |
| sku |
Description of a SKU for a scalable resource. |
SkuDescription |
| tags |
Resource tags |
Dictionary of tag names and values. |
| type |
The resource type |
"Microsoft.Web/staticSites@2020-12-01" |
Capability
| Name |
Description |
Value |
| name |
Name of the SKU capability. |
string |
| reason |
Reason of the SKU capability. |
string |
| value |
Value of the SKU capability. |
string |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
ManagedServiceIdentity
| Name |
Description |
Value |
| type |
Type of managed service identity. |
'None' 'SystemAssigned' 'SystemAssigned, UserAssigned' 'UserAssigned' |
| userAssignedIdentities |
The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SkuCapacity
| Name |
Description |
Value |
| default |
Default number of workers for this App Service plan SKU. |
int |
| elasticMaximum |
Maximum number of Elastic workers for this App Service plan SKU. |
int |
| maximum |
Maximum number of workers for this App Service plan SKU. |
int |
| minimum |
Minimum number of workers for this App Service plan SKU. |
int |
| scaleType |
Available scale configurations for an App Service plan. |
string |
SkuDescription
| Name |
Description |
Value |
| capabilities |
Capabilities of the SKU, e.g., is traffic manager enabled? |
Capability[] |
| capacity |
Current number of instances assigned to the resource. |
int |
| family |
Family code of the resource SKU. |
string |
| locations |
Locations of the SKU. |
string[] |
| name |
Name of the resource SKU. |
string |
| size |
Size specifier of the resource SKU. |
string |
| skuCapacity |
Min, max, and default scale values of the SKU. |
SkuCapacity |
| tier |
Service tier of the resource SKU. |
string |
StaticSite
| Name |
Description |
Value |
| allowConfigFileUpdates |
<code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. |
bool |
| branch |
The target branch in the repository. |
string |
| buildProperties |
Build properties to configure on the repository. |
StaticSiteBuildProperties |
| repositoryToken |
A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. |
string |
| repositoryUrl |
URL for the repository of the static site. |
string |
| stagingEnvironmentPolicy |
State indicating whether staging environments are allowed or not allowed for a static web app. |
'Disabled' 'Enabled' |
| templateProperties |
Template options for generating a new repository. |
StaticSiteTemplateOptions |
StaticSiteBuildProperties
| Name |
Description |
Value |
| apiBuildCommand |
A custom command to run during deployment of the Azure Functions API application. |
string |
| apiLocation |
The path to the api code within the repository. |
string |
| appArtifactLocation |
Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) |
string |
| appBuildCommand |
A custom command to run during deployment of the static content application. |
string |
| appLocation |
The path to the app code within the repository. |
string |
| githubActionSecretNameOverride |
Github Action secret name override. |
string |
| outputLocation |
The output path of the app after building. |
string |
| skipGithubActionWorkflowGeneration |
Skip Github Action workflow generation. |
bool |
StaticSiteTemplateOptions
| Name |
Description |
Value |
| description |
Description of the newly generated repository. |
string |
| isPrivate |
Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). |
bool |
| owner |
Owner of the newly generated repository. |
string |
| repositoryName |
Name of the newly generated repository. |
string |
| templateRepositoryUrl |
URL of the template repository. The newly generated repository will be based on this one. |
string |
Usage Examples
A basic example of deploying Static Web App.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "staticSite" {
type = "Microsoft.Web/staticSites@2021-02-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
}
sku = {
name = "Free"
tier = "Free"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module |
Description |
| Static Web App |
AVM Resource Module for Static Web App |