StaticSite

class StaticSite : KotlinCustomResource

Static Site ARM resource. Uses Azure REST API version 2024-04-01. In version 2.x of the Azure Native provider, it used API version 2022-09-01. Other available API versions: 2019-08-01, 2020-06-01, 2020-09-01, 2020-10-01, 2020-12-01, 2021-01-01, 2021-01-15, 2021-02-01, 2021-03-01, 2022-03-01, 2022-09-01, 2023-01-01, 2023-12-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native web [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update a static site

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var staticSite = new AzureNative.Web.StaticSite("staticSite", new()
{
Branch = "master",
BuildProperties = new AzureNative.Web.Inputs.StaticSiteBuildPropertiesArgs
{
ApiLocation = "api",
AppArtifactLocation = "build",
AppLocation = "app",
},
Location = "West US 2",
Name = "testStaticSite0",
RepositoryToken = "repoToken123",
RepositoryUrl = "https://github.com/username/RepoName",
ResourceGroupName = "rg",
Sku = new AzureNative.Web.Inputs.SkuDescriptionArgs
{
Name = "Basic",
Tier = "Basic",
},
});
});
package main
import (
web "github.com/pulumi/pulumi-azure-native-sdk/web/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := web.NewStaticSite(ctx, "staticSite", &web.StaticSiteArgs{
Branch: pulumi.String("master"),
BuildProperties: &web.StaticSiteBuildPropertiesArgs{
ApiLocation: pulumi.String("api"),
AppArtifactLocation: pulumi.String("build"),
AppLocation: pulumi.String("app"),
},
Location: pulumi.String("West US 2"),
Name: pulumi.String("testStaticSite0"),
RepositoryToken: pulumi.String("repoToken123"),
RepositoryUrl: pulumi.String("https://github.com/username/RepoName"),
ResourceGroupName: pulumi.String("rg"),
Sku: &web.SkuDescriptionArgs{
Name: pulumi.String("Basic"),
Tier: pulumi.String("Basic"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.web.StaticSite;
import com.pulumi.azurenative.web.StaticSiteArgs;
import com.pulumi.azurenative.web.inputs.StaticSiteBuildPropertiesArgs;
import com.pulumi.azurenative.web.inputs.SkuDescriptionArgs;
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 staticSite = new StaticSite("staticSite", StaticSiteArgs.builder()
.branch("master")
.buildProperties(StaticSiteBuildPropertiesArgs.builder()
.apiLocation("api")
.appArtifactLocation("build")
.appLocation("app")
.build())
.location("West US 2")
.name("testStaticSite0")
.repositoryToken("repoToken123")
.repositoryUrl("https://github.com/username/RepoName")
.resourceGroupName("rg")
.sku(SkuDescriptionArgs.builder()
.name("Basic")
.tier("Basic")
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:web:StaticSite testStaticSite0 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}

Properties

Link copied to clipboard

false if config file is locked for this static web app; otherwise, true.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val branch: Output<String>?

The target branch in the repository.

Link copied to clipboard

Build properties to configure on the repository.

Link copied to clipboard

The content distribution endpoint for the static site.

Link copied to clipboard
val customDomains: Output<List<String>>

The custom domains associated with this static site.

Link copied to clipboard

Database connections for the static site

Link copied to clipboard
val defaultHostname: Output<String>

The default autogenerated hostname for the static site.

Link copied to clipboard

State indicating the status of the enterprise grade CDN serving traffic to the static web app.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Managed service identity.

Link copied to clipboard

Identity to use for Key Vault Reference authentication.

Link copied to clipboard
val kind: Output<String>?

Kind of resource. If the resource is an app, you can refer to https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference for details supported values for kind.

Link copied to clipboard

Backends linked to the static side

Link copied to clipboard
val location: Output<String>

Resource Location.

Link copied to clipboard
val name: Output<String>

Resource Name.

Link copied to clipboard
val provider: Output<String>?

The provider that submitted the last deployment to the primary environment of the static site.

Link copied to clipboard

State indicating whether public traffic are allowed or not for a static web app. Allowed Values: 'Enabled', 'Disabled' or an empty string.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repositoryToken: Output<String>?

A user's github repository token. This is used to setup the Github Actions workflow file and API secrets.

Link copied to clipboard
val repositoryUrl: Output<String>?

URL for the repository of the static site.

Link copied to clipboard

Description of a SKU for a scalable resource.

Link copied to clipboard

State indicating whether staging environments are allowed or not allowed for a static web app.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard

Template options for generating a new repository.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

User provided function apps registered with the static site