New-AzContainerAppSourceControl

Create the SourceControl for a Container App.

Syntax

New-AzContainerAppSourceControl
   -ContainerAppName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-AzureClientId <String>]
   [-AzureClientSecret <SecureString>]
   [-AzureKind <String>]
   [-AzureSubscriptionId <String>]
   [-AzureTenantId <String>]
   [-Branch <String>]
   [-GithubAccessToken <SecureString>]
   [-GithubConfigurationImage <String>]
   [-GithubContextPath <String>]
   [-GithubOS <String>]
   [-GithubPublishType <String>]
   [-GithubRuntimeStack <String>]
   [-GithubRuntimeVersion <String>]
   [-RegistryPassword <SecureString>]
   [-RegistryUrl <String>]
   [-RegistryUserName <String>]
   [-RepoUrl <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzContainerAppSourceControl
   -ContainerAppName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -JsonString <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzContainerAppSourceControl
   -ContainerAppName <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -JsonFilePath <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzContainerAppSourceControl
   -Name <String>
   -ContainerAppInputObject <IAppIdentity>
   [-AzureClientId <String>]
   [-AzureClientSecret <SecureString>]
   [-AzureKind <String>]
   [-AzureSubscriptionId <String>]
   [-AzureTenantId <String>]
   [-Branch <String>]
   [-GithubAccessToken <SecureString>]
   [-GithubConfigurationImage <String>]
   [-GithubContextPath <String>]
   [-GithubOS <String>]
   [-GithubPublishType <String>]
   [-GithubRuntimeStack <String>]
   [-GithubRuntimeVersion <String>]
   [-RegistryPassword <SecureString>]
   [-RegistryUrl <String>]
   [-RegistryUserName <String>]
   [-RepoUrl <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzContainerAppSourceControl
   -InputObject <IAppIdentity>
   [-AzureClientId <String>]
   [-AzureClientSecret <SecureString>]
   [-AzureKind <String>]
   [-AzureSubscriptionId <String>]
   [-AzureTenantId <String>]
   [-Branch <String>]
   [-GithubAccessToken <SecureString>]
   [-GithubConfigurationImage <String>]
   [-GithubContextPath <String>]
   [-GithubOS <String>]
   [-GithubPublishType <String>]
   [-GithubRuntimeStack <String>]
   [-GithubRuntimeVersion <String>]
   [-RegistryPassword <SecureString>]
   [-RegistryUrl <String>]
   [-RegistryUserName <String>]
   [-RepoUrl <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create the SourceControl for a Container App.

Examples

Example 1: Create the SourceControl for a Container App.

$AzureClientSecret = ConvertTo-SecureString -String "****" -AsPlainText -Force
$RegistryPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
$GithubAccessToken = ConvertTo-SecureString -String "****" -AsPlainText -Force

New-AzContainerAppSourceControl -ContainerAppName azps-containerapp-1 -ResourceGroupName azps_test_group_app -Name current -AzureClientId "UserObjectId" -AzureClientSecret $AzureClientSecret -AzureKind "feaderated" -AzureTenantId "UserDirectoryID" -Branch "main" -GithubContextPath "./" -GithubAccessToken $GithubAccessToken -GithubConfigurationImage "azps-containerapp-1" -RegistryPassword $RegistryPassword -RegistryUrl "azpscontainerregistry.azurecr.io" -RegistryUserName "azpscontainerregistry" -RepoUrl "https://github.com/lijinpei2008/ghatest"

Branch Name    RepoUrl                                 RegistryInfoRegistryUserName ResourceGroupName
------ ----    -------                                 ---------------------------- -----------------
main   current https://github.com/lijinpei2008/ghatest azpscontainerregistry        azps_test_group_app

Create the SourceControl for a Container App. User need to create a base resource of resource type "ContainerRegistry" and set AccessKeys to Enabled. User needs to provide the ObjectId(AzureCredentialsClientId) and password of the current account. User needs to provide the DirectoryID(AzureCredentialsTenantId) of the current account.

Parameters

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureClientId

Client Id.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureClientSecret

Client Secret.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureKind

Kind of auth github does for deploying the template

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureSubscriptionId

Subscription Id.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureTenantId

Tenant Id.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Branch

The branch which will trigger the auto deployment

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ContainerAppInputObject

Identity Parameter

Type:IAppIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ContainerAppName

Name of the Container App.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubAccessToken

One time Github PAT to configure github environment

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubConfigurationImage

Image name

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubContextPath

Context path

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubOS

Operation system

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubPublishType

Code or Image

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubRuntimeStack

Runtime stack

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GithubRuntimeVersion

Runtime version

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter

Type:IAppIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-JsonFilePath

Path of Json file supplied to the Create operation

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JsonString

Json string supplied to the Create operation

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the Container App SourceControl.

Type:String
Aliases:SourceControlName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RegistryPassword

registry secret.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RegistryUrl

registry server Url.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RegistryUserName

registry username.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RepoUrl

The repo url which will be integrated to ContainerApp.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IAppIdentity

Outputs

ISourceControl