We recommend using Azure Native.
azure.appservice.StaticSite
Explore with Pulumi AI
Manages an App Service Static Site.
NOTE: The
azure.appservice.StaticSite
resource is deprecated in favour ofazure.appservice.StaticWebApp
and will be removed in a future major release.
->NOTE: After the Static Site is provisioned, you’ll need to associate your target repository, which contains your web app, to the Static Site, by following the Azure Static Site document.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleStaticSite = new azure.appservice.StaticSite("example", {
name: "example",
resourceGroupName: example.name,
location: example.location,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_static_site = azure.appservice.StaticSite("example",
name="example",
resource_group_name=example.name,
location=example.location)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = appservice.NewStaticSite(ctx, "example", &appservice.StaticSiteArgs{
Name: pulumi.String("example"),
ResourceGroupName: example.Name,
Location: example.Location,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleStaticSite = new Azure.AppService.StaticSite("example", new()
{
Name = "example",
ResourceGroupName = example.Name,
Location = example.Location,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appservice.StaticSite;
import com.pulumi.azure.appservice.StaticSiteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleStaticSite = new StaticSite("exampleStaticSite", StaticSiteArgs.builder()
.name("example")
.resourceGroupName(example.name())
.location(example.location())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleStaticSite:
type: azure:appservice:StaticSite
name: example
properties:
name: example
resourceGroupName: ${example.name}
location: ${example.location}
Create StaticSite Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StaticSite(name: string, args: StaticSiteArgs, opts?: CustomResourceOptions);
@overload
def StaticSite(resource_name: str,
args: StaticSiteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def StaticSite(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
app_settings: Optional[Mapping[str, str]] = None,
identity: Optional[StaticSiteIdentityArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None,
sku_size: Optional[str] = None,
sku_tier: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewStaticSite(ctx *Context, name string, args StaticSiteArgs, opts ...ResourceOption) (*StaticSite, error)
public StaticSite(string name, StaticSiteArgs args, CustomResourceOptions? opts = null)
public StaticSite(String name, StaticSiteArgs args)
public StaticSite(String name, StaticSiteArgs args, CustomResourceOptions options)
type: azure:appservice:StaticSite
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args StaticSiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args StaticSiteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args StaticSiteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StaticSiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StaticSiteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var staticSiteResource = new Azure.AppService.StaticSite("staticSiteResource", new()
{
ResourceGroupName = "string",
AppSettings =
{
{ "string", "string" },
},
Identity = new Azure.AppService.Inputs.StaticSiteIdentityArgs
{
Type = "string",
IdentityIds = new[]
{
"string",
},
PrincipalId = "string",
TenantId = "string",
},
Location = "string",
Name = "string",
SkuSize = "string",
SkuTier = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := appservice.NewStaticSite(ctx, "staticSiteResource", &appservice.StaticSiteArgs{
ResourceGroupName: pulumi.String("string"),
AppSettings: pulumi.StringMap{
"string": pulumi.String("string"),
},
Identity: &appservice.StaticSiteIdentityArgs{
Type: pulumi.String("string"),
IdentityIds: pulumi.StringArray{
pulumi.String("string"),
},
PrincipalId: pulumi.String("string"),
TenantId: pulumi.String("string"),
},
Location: pulumi.String("string"),
Name: pulumi.String("string"),
SkuSize: pulumi.String("string"),
SkuTier: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var staticSiteResource = new StaticSite("staticSiteResource", StaticSiteArgs.builder()
.resourceGroupName("string")
.appSettings(Map.of("string", "string"))
.identity(StaticSiteIdentityArgs.builder()
.type("string")
.identityIds("string")
.principalId("string")
.tenantId("string")
.build())
.location("string")
.name("string")
.skuSize("string")
.skuTier("string")
.tags(Map.of("string", "string"))
.build());
static_site_resource = azure.appservice.StaticSite("staticSiteResource",
resource_group_name="string",
app_settings={
"string": "string",
},
identity=azure.appservice.StaticSiteIdentityArgs(
type="string",
identity_ids=["string"],
principal_id="string",
tenant_id="string",
),
location="string",
name="string",
sku_size="string",
sku_tier="string",
tags={
"string": "string",
})
const staticSiteResource = new azure.appservice.StaticSite("staticSiteResource", {
resourceGroupName: "string",
appSettings: {
string: "string",
},
identity: {
type: "string",
identityIds: ["string"],
principalId: "string",
tenantId: "string",
},
location: "string",
name: "string",
skuSize: "string",
skuTier: "string",
tags: {
string: "string",
},
});
type: azure:appservice:StaticSite
properties:
appSettings:
string: string
identity:
identityIds:
- string
principalId: string
tenantId: string
type: string
location: string
name: string
resourceGroupName: string
skuSize: string
skuTier: string
tags:
string: string
StaticSite Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The StaticSite resource accepts the following input properties:
- Resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- App
Settings Dictionary<string, string> - A key-value pair of App Settings.
- Identity
Static
Site Identity - An
identity
block as defined below. - Location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- Sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- App
Settings map[string]string - A key-value pair of App Settings.
- Identity
Static
Site Identity Args - An
identity
block as defined below. - Location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- Sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - map[string]string
- A mapping of tags to assign to the resource.
- resource
Group StringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- app
Settings Map<String,String> - A key-value pair of App Settings.
- identity
Static
Site Identity - An
identity
block as defined below. - location String
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name String
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- sku
Size String - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier String - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Map<String,String>
- A mapping of tags to assign to the resource.
- resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- app
Settings {[key: string]: string} - A key-value pair of App Settings.
- identity
Static
Site Identity - An
identity
block as defined below. - location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- resource_
group_ strname - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- app_
settings Mapping[str, str] - A key-value pair of App Settings.
- identity
Static
Site Identity Args - An
identity
block as defined below. - location str
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name str
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- sku_
size str - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku_
tier str - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- resource
Group StringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- app
Settings Map<String> - A key-value pair of App Settings.
- identity Property Map
- An
identity
block as defined below. - location String
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name String
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- sku
Size String - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier String - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Map<String>
- A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the StaticSite resource produces the following output properties:
- Api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- Default
Host stringName - The default host name of the Static Web App.
- Id string
- The provider-assigned unique ID for this managed resource.
- Api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- Default
Host stringName - The default host name of the Static Web App.
- Id string
- The provider-assigned unique ID for this managed resource.
- api
Key String - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- default
Host StringName - The default host name of the Static Web App.
- id String
- The provider-assigned unique ID for this managed resource.
- api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- default
Host stringName - The default host name of the Static Web App.
- id string
- The provider-assigned unique ID for this managed resource.
- api_
key str - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- default_
host_ strname - The default host name of the Static Web App.
- id str
- The provider-assigned unique ID for this managed resource.
- api
Key String - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- default
Host StringName - The default host name of the Static Web App.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing StaticSite Resource
Get an existing StaticSite resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: StaticSiteState, opts?: CustomResourceOptions): StaticSite
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_key: Optional[str] = None,
app_settings: Optional[Mapping[str, str]] = None,
default_host_name: Optional[str] = None,
identity: Optional[StaticSiteIdentityArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
sku_size: Optional[str] = None,
sku_tier: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> StaticSite
func GetStaticSite(ctx *Context, name string, id IDInput, state *StaticSiteState, opts ...ResourceOption) (*StaticSite, error)
public static StaticSite Get(string name, Input<string> id, StaticSiteState? state, CustomResourceOptions? opts = null)
public static StaticSite get(String name, Output<String> id, StaticSiteState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- App
Settings Dictionary<string, string> - A key-value pair of App Settings.
- Default
Host stringName - The default host name of the Static Web App.
- Identity
Static
Site Identity - An
identity
block as defined below. - Location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- Resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- App
Settings map[string]string - A key-value pair of App Settings.
- Default
Host stringName - The default host name of the Static Web App.
- Identity
Static
Site Identity Args - An
identity
block as defined below. - Location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- Resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- Sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - map[string]string
- A mapping of tags to assign to the resource.
- api
Key String - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- app
Settings Map<String,String> - A key-value pair of App Settings.
- default
Host StringName - The default host name of the Static Web App.
- identity
Static
Site Identity - An
identity
block as defined below. - location String
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name String
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- resource
Group StringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- sku
Size String - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier String - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Map<String,String>
- A mapping of tags to assign to the resource.
- api
Key string - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- app
Settings {[key: string]: string} - A key-value pair of App Settings.
- default
Host stringName - The default host name of the Static Web App.
- identity
Static
Site Identity - An
identity
block as defined below. - location string
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name string
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- resource
Group stringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- sku
Size string - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier string - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- api_
key str - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- app_
settings Mapping[str, str] - A key-value pair of App Settings.
- default_
host_ strname - The default host name of the Static Web App.
- identity
Static
Site Identity Args - An
identity
block as defined below. - location str
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name str
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- resource_
group_ strname - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- sku_
size str - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku_
tier str - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- api
Key String - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action.
- app
Settings Map<String> - A key-value pair of App Settings.
- default
Host StringName - The default host name of the Static Web App.
- identity Property Map
- An
identity
block as defined below. - location String
- The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- name String
- The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created.
- resource
Group StringName - The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created.
- sku
Size String - Specifies the SKU size of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - sku
Tier String - Specifies the SKU tier of the Static Web App. Possible values are
Free
orStandard
. Defaults toFree
. - Map<String>
- A mapping of tags to assign to the resource.
Supporting Types
StaticSiteIdentity, StaticSiteIdentityArgs
- Type string
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - Identity
Ids List<string> - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- Principal
Id string - (Optional) The Principal ID associated with this Managed Service Identity.
- Tenant
Id string
- Type string
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - Identity
Ids []string - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- Principal
Id string - (Optional) The Principal ID associated with this Managed Service Identity.
- Tenant
Id string
- type String
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - identity
Ids List<String> - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- principal
Id String - (Optional) The Principal ID associated with this Managed Service Identity.
- tenant
Id String
- type string
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - identity
Ids string[] - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- principal
Id string - (Optional) The Principal ID associated with this Managed Service Identity.
- tenant
Id string
- type str
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - identity_
ids Sequence[str] - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- principal_
id str - (Optional) The Principal ID associated with this Managed Service Identity.
- tenant_
id str
- type String
- The Type of Managed Identity assigned to this Static Site resource. Possible values are
SystemAssigned
,UserAssigned
andSystemAssigned, UserAssigned
. - identity
Ids List<String> - A list of Managed Identity IDs which should be assigned to this Static Site resource.
- principal
Id String - (Optional) The Principal ID associated with this Managed Service Identity.
- tenant
Id String
Import
Static Web Apps can be imported using the resource id
, e.g.
$ pulumi import azure:appservice/staticSite:StaticSite example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.