New-AzStaticWebApp
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Syntax
New-AzStaticWebApp
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-Location <String>
[-AllowConfigFileUpdate]
[-ApiBuildCommand <String>]
[-ApiLocation <String>]
[-AppArtifactLocation <String>]
[-AppBuildCommand <String>]
[-AppLocation <String>]
[-Branch <String>]
[-Capacity <Int32>]
[-GithubActionSecretNameOverride <String>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityUserAssignedIdentity <Hashtable>]
[-Kind <String>]
[-OutputLocation <String>]
[-RepositoryToken <String>]
[-RepositoryUrl <String>]
[-SkipGithubActionWorkflowGeneration]
[-SkuName <String>]
[-StagingEnvironmentPolicy <StagingEnvironmentPolicy>]
[-Tag <Hashtable>]
[-ForkRepositoryDescription <String>]
[-ForkRepositoryIsPrivate]
[-ForkRepositoryOwner <String>]
[-ForkRepositoryName <String>]
[-TemplateRepositoryUrl <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Examples
Example 1: Create a new static site in an existing resource group, or updates an existing static site
New-AzStaticWebApp -ResourceGroupName 'azure-rg-test' -Name 'staticweb-45asde' -Location 'Central US' -RepositoryUrl 'https://github.com/LucasYao93/blazor-starter' -RepositoryToken 'githubAccessToken' -Branch 'branch02' -AppLocation 'Client' -ApiLocation 'Api' -OutputLocation 'wwwroot' -SkuName 'Standard'
Kind Location Name Type
---- -------- ---- ----
Central US staticweb-45asde Microsoft.Web/staticSites
This command creates a new static site in an existing resource group, or updates an existing static site.
Example 2: Create a new static site in an existing resource group through specified template repository
New-AzStaticWebApp -ResourceGroupName 'azure-rg-test' -Name staticweb-pwsh01 -Location "Central US" -RepositoryToken 'xxxxxxxxxxxxxxxxx' -TemplateRepositoryUrl 'https://github.com/staticwebdev/blazor-starter' -ForkRepositoryDescription "Test template repository function of the azure static web." -ForkRepositoryName "test-blazor-starter" -ForkRepositoryOwner 'LucasYao93' -Branch 'main' -AppLocation 'Client' -ApiLocation 'Api' -OutputLocation 'wwwroot' -SkuName 'Standard'
Kind Location Name Type
---- -------- ---- ----
Central US staticweb-pwsh01 Microsoft.Web/staticSites
This command creates a new static site in an existing resource group, or updates an existing static site through specified template repository.
Parameters
<code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
A custom command to run during deployment of the Azure Functions API application.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The path to the api code within the repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation)
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
A custom command to run during deployment of the static content application.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The path to the app code within the repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Run the command as a job
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The target branch in the repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Current number of instances assigned to the resource.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | PSObject |
Aliases: | AzureRMContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Description of the newly generated repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public).
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Name of the newly generated repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Owner of the newly generated repository.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Github Action secret name override.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Type of managed service identity.
Type: | ManagedServiceIdentityType |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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}
Type: | Hashtable |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Kind of resource.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Resource Location.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Name of the static site to create or update.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Run the command asynchronously
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The output path of the app after building.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
A user's github repository token. This is used to setup the Github Actions workflow file and API secrets.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
URL for the repository of the static site.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Name of the resource group to which the resource belongs.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Skip Github Action workflow generation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Name of the resource SKU.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
State indicating whether staging environments are allowed or not allowed for a static web app.
Type: | StagingEnvironmentPolicy |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
Type: | String |
Position: | Named |
Default value: | (Get-AzContext).Subscription.Id |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Resource tags.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
URL of the template repository. The newly generated repository will be based on this one.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
Notes
ALIASES
Comentarios
Enviar y ver comentarios de