1. Packages
  2. Azure Classic
  3. API Docs
  4. appservice
  5. getStaticWebApp

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
azure logo

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi

    Use this data source to access information about an existing Static Web App.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.appservice.getStaticWebApp({
        name: "existing",
        resourceGroupName: "existing",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.appservice.get_static_web_app(name="existing",
        resource_group_name="existing")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appservice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appservice.LookupStaticWebApp(ctx, &appservice.LookupStaticWebAppArgs{
    			Name:              "existing",
    			ResourceGroupName: "existing",
    		}, nil)
    		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 = Azure.AppService.GetStaticWebApp.Invoke(new()
        {
            Name = "existing",
            ResourceGroupName = "existing",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.appservice.AppserviceFunctions;
    import com.pulumi.azure.appservice.inputs.GetStaticWebAppArgs;
    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) {
            final var example = AppserviceFunctions.getStaticWebApp(GetStaticWebAppArgs.builder()
                .name("existing")
                .resourceGroupName("existing")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: azure:appservice:getStaticWebApp
          arguments:
            name: existing
            resourceGroupName: existing
    

    API Providers

    This data source uses the following Azure API Providers:

    • Microsoft.Web - 2023-01-01

    Using getStaticWebApp

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getStaticWebApp(args: GetStaticWebAppArgs, opts?: InvokeOptions): Promise<GetStaticWebAppResult>
    function getStaticWebAppOutput(args: GetStaticWebAppOutputArgs, opts?: InvokeOptions): Output<GetStaticWebAppResult>
    def get_static_web_app(name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetStaticWebAppResult
    def get_static_web_app_output(name: Optional[pulumi.Input[str]] = None,
                           resource_group_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetStaticWebAppResult]
    func LookupStaticWebApp(ctx *Context, args *LookupStaticWebAppArgs, opts ...InvokeOption) (*LookupStaticWebAppResult, error)
    func LookupStaticWebAppOutput(ctx *Context, args *LookupStaticWebAppOutputArgs, opts ...InvokeOption) LookupStaticWebAppResultOutput

    > Note: This function is named LookupStaticWebApp in the Go SDK.

    public static class GetStaticWebApp 
    {
        public static Task<GetStaticWebAppResult> InvokeAsync(GetStaticWebAppArgs args, InvokeOptions? opts = null)
        public static Output<GetStaticWebAppResult> Invoke(GetStaticWebAppInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStaticWebAppResult> getStaticWebApp(GetStaticWebAppArgs args, InvokeOptions options)
    public static Output<GetStaticWebAppResult> getStaticWebApp(GetStaticWebAppArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:appservice/getStaticWebApp:getStaticWebApp
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of this Static Web App.
    ResourceGroupName string
    The name of the Resource Group where the Static Web App exists.
    Name string
    The name of this Static Web App.
    ResourceGroupName string
    The name of the Resource Group where the Static Web App exists.
    name String
    The name of this Static Web App.
    resourceGroupName String
    The name of the Resource Group where the Static Web App exists.
    name string
    The name of this Static Web App.
    resourceGroupName string
    The name of the Resource Group where the Static Web App exists.
    name str
    The name of this Static Web App.
    resource_group_name str
    The name of the Resource Group where the Static Web App exists.
    name String
    The name of this Static Web App.
    resourceGroupName String
    The name of the Resource Group where the Static Web App exists.

    getStaticWebApp Result

    The following output properties are available:

    ApiKey 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.
    AppSettings Dictionary<string, string>
    The map of key-value pairs of App Settings for the Static Web App.
    BasicAuths List<GetStaticWebAppBasicAuth>
    A basic_auth block as defined below.
    ConfigurationFileChangesEnabled bool
    Are changes to the configuration file permitted.
    DefaultHostName string
    The default host name of the Static Web App.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities List<GetStaticWebAppIdentity>
    An identity block as defined below.
    Location string
    The Azure region in which this Static Web App exists.
    Name string
    PreviewEnvironmentsEnabled bool
    Are Preview (Staging) environments enabled.
    PublicNetworkAccessEnabled bool
    Should public network access be enabled for the Static Web App.
    RepositoryBranch string
    Repository branch of the Static Web App.
    RepositoryUrl string
    Repository URL of the Static Web App.
    ResourceGroupName string
    SkuSize string
    The SKU size of the Static Web App.
    SkuTier string
    The SKU tier of the Static Web App.
    Tags Dictionary<string, string>
    The mapping of tags assigned to the resource.
    ApiKey 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.
    AppSettings map[string]string
    The map of key-value pairs of App Settings for the Static Web App.
    BasicAuths []GetStaticWebAppBasicAuth
    A basic_auth block as defined below.
    ConfigurationFileChangesEnabled bool
    Are changes to the configuration file permitted.
    DefaultHostName string
    The default host name of the Static Web App.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities []GetStaticWebAppIdentity
    An identity block as defined below.
    Location string
    The Azure region in which this Static Web App exists.
    Name string
    PreviewEnvironmentsEnabled bool
    Are Preview (Staging) environments enabled.
    PublicNetworkAccessEnabled bool
    Should public network access be enabled for the Static Web App.
    RepositoryBranch string
    Repository branch of the Static Web App.
    RepositoryUrl string
    Repository URL of the Static Web App.
    ResourceGroupName string
    SkuSize string
    The SKU size of the Static Web App.
    SkuTier string
    The SKU tier of the Static Web App.
    Tags map[string]string
    The mapping of tags assigned to the resource.
    apiKey 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.
    appSettings Map<String,String>
    The map of key-value pairs of App Settings for the Static Web App.
    basicAuths List<GetStaticWebAppBasicAuth>
    A basic_auth block as defined below.
    configurationFileChangesEnabled Boolean
    Are changes to the configuration file permitted.
    defaultHostName String
    The default host name of the Static Web App.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<GetStaticWebAppIdentity>
    An identity block as defined below.
    location String
    The Azure region in which this Static Web App exists.
    name String
    previewEnvironmentsEnabled Boolean
    Are Preview (Staging) environments enabled.
    publicNetworkAccessEnabled Boolean
    Should public network access be enabled for the Static Web App.
    repositoryBranch String
    Repository branch of the Static Web App.
    repositoryUrl String
    Repository URL of the Static Web App.
    resourceGroupName String
    skuSize String
    The SKU size of the Static Web App.
    skuTier String
    The SKU tier of the Static Web App.
    tags Map<String,String>
    The mapping of tags assigned to the resource.
    apiKey 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.
    appSettings {[key: string]: string}
    The map of key-value pairs of App Settings for the Static Web App.
    basicAuths GetStaticWebAppBasicAuth[]
    A basic_auth block as defined below.
    configurationFileChangesEnabled boolean
    Are changes to the configuration file permitted.
    defaultHostName string
    The default host name of the Static Web App.
    id string
    The provider-assigned unique ID for this managed resource.
    identities GetStaticWebAppIdentity[]
    An identity block as defined below.
    location string
    The Azure region in which this Static Web App exists.
    name string
    previewEnvironmentsEnabled boolean
    Are Preview (Staging) environments enabled.
    publicNetworkAccessEnabled boolean
    Should public network access be enabled for the Static Web App.
    repositoryBranch string
    Repository branch of the Static Web App.
    repositoryUrl string
    Repository URL of the Static Web App.
    resourceGroupName string
    skuSize string
    The SKU size of the Static Web App.
    skuTier string
    The SKU tier of the Static Web App.
    tags {[key: string]: string}
    The mapping of tags assigned 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]
    The map of key-value pairs of App Settings for the Static Web App.
    basic_auths Sequence[GetStaticWebAppBasicAuth]
    A basic_auth block as defined below.
    configuration_file_changes_enabled bool
    Are changes to the configuration file permitted.
    default_host_name str
    The default host name of the Static Web App.
    id str
    The provider-assigned unique ID for this managed resource.
    identities Sequence[GetStaticWebAppIdentity]
    An identity block as defined below.
    location str
    The Azure region in which this Static Web App exists.
    name str
    preview_environments_enabled bool
    Are Preview (Staging) environments enabled.
    public_network_access_enabled bool
    Should public network access be enabled for the Static Web App.
    repository_branch str
    Repository branch of the Static Web App.
    repository_url str
    Repository URL of the Static Web App.
    resource_group_name str
    sku_size str
    The SKU size of the Static Web App.
    sku_tier str
    The SKU tier of the Static Web App.
    tags Mapping[str, str]
    The mapping of tags assigned to the resource.
    apiKey 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.
    appSettings Map<String>
    The map of key-value pairs of App Settings for the Static Web App.
    basicAuths List<Property Map>
    A basic_auth block as defined below.
    configurationFileChangesEnabled Boolean
    Are changes to the configuration file permitted.
    defaultHostName String
    The default host name of the Static Web App.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<Property Map>
    An identity block as defined below.
    location String
    The Azure region in which this Static Web App exists.
    name String
    previewEnvironmentsEnabled Boolean
    Are Preview (Staging) environments enabled.
    publicNetworkAccessEnabled Boolean
    Should public network access be enabled for the Static Web App.
    repositoryBranch String
    Repository branch of the Static Web App.
    repositoryUrl String
    Repository URL of the Static Web App.
    resourceGroupName String
    skuSize String
    The SKU size of the Static Web App.
    skuTier String
    The SKU tier of the Static Web App.
    tags Map<String>
    The mapping of tags assigned to the resource.

    Supporting Types

    GetStaticWebAppBasicAuth

    Environments string
    The Environment types which are configured to use Basic Auth access.
    Environments string
    The Environment types which are configured to use Basic Auth access.
    environments String
    The Environment types which are configured to use Basic Auth access.
    environments string
    The Environment types which are configured to use Basic Auth access.
    environments str
    The Environment types which are configured to use Basic Auth access.
    environments String
    The Environment types which are configured to use Basic Auth access.

    GetStaticWebAppIdentity

    IdentityIds List<string>
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    PrincipalId string
    TenantId string
    Type string
    The Type of Managed Identity assigned to this Static Web App resource.
    IdentityIds []string
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    PrincipalId string
    TenantId string
    Type string
    The Type of Managed Identity assigned to this Static Web App resource.
    identityIds List<String>
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    principalId String
    tenantId String
    type String
    The Type of Managed Identity assigned to this Static Web App resource.
    identityIds string[]
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    principalId string
    tenantId string
    type string
    The Type of Managed Identity assigned to this Static Web App resource.
    identity_ids Sequence[str]
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    principal_id str
    tenant_id str
    type str
    The Type of Managed Identity assigned to this Static Web App resource.
    identityIds List<String>
    The list of Managed Identity IDs which are assigned to this Static Web App resource.
    principalId String
    tenantId String
    type String
    The Type of Managed Identity assigned to this Static Web App resource.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate