Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,19 @@ def __init__(self):
'../resources/GenerateRandomAppNames.json'))

PUBLIC_CLOUD = "AzureCloud"

LINUX_GITHUB_ACTIONS_WORKFLOW_TEMPLATE_PATH = {
'node': 'AppService/linux/nodejs-webapp-on-azure.yml',
'python': 'AppService/linux/python-webapp-on-azure.yml',
'dotnetcore': 'AppService/linux/aspnet-core-webapp-on-azure.yml',
'java': 'AppService/linux/java-jar-webapp-on-azure.yml',
'tomcat': 'AppService/linux/java-war-webapp-on-azure.yml'
}

WINDOWS_GITHUB_ACTIONS_WORKFLOW_TEMPLATE_PATH = {
'node': 'AppService/windows/nodejs-webapp-on-azure.yml',
'python': 'AppService/windows/python-webapp-on-azure.yml',
'dotnetcore': 'AppService/windows/aspnet-core-webapp-on-azure.yml',
'java': 'AppService/windows/java-jar-webapp-on-azure.yml',
'tomcat': 'AppService/windows/java-war-webapp-on-azure.yml'
}
29 changes: 29 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,35 @@
az webapp deployment user show
"""

helps['webapp deployment github-actions'] = """
type: group
short-summary: Configure GitHub Actions for a webapp
"""

helps['webapp deployment github-actions add'] = """
type: command
short-summary: Add a GitHub Actions workflow file to the specified repository. The workflow will build and deploy your app to the specified webapp.
examples:
- name: Add GitHub Actions to a specified repository, providing personal access token
text: >
az webapp deployment github-actions add --repo "githubUser/githubRepo" -g MyResourceGroup -n MyWebapp --token MyPersonalAccessToken
- name: Add GitHub Actions to a specified repository, using interactive method of retrieving personal access token
text: >
az webapp deployment github-actions add --repo "githubUser/githubRepo" -g MyResourceGroup -n MyWebapp --login-with-github
"""

helps['webapp deployment github-actions remove'] = """
type: command
short-summary: Remove and disconnect the GitHub Actions workflow file from the specified repository.
examples:
- name: Remove GitHub Actions from a specified repository, providing personal access token
text: >
az webapp deployment github-actions remove --repo "githubUser/githubRepo" -g MyResourceGroup -n MyWebapp --token MyPersonalAccessToken
- name: Remove GitHub Actions from a specified repository, using interactive method of retrieving personal access token
text: >
az webapp deployment github-actions remove --repo "githubUser/githubRepo" -g MyResourceGroup -n MyWebapp --login-with-github
"""

helps['webapp hybrid-connection'] = """
type: group
short-summary: methods that list, add and remove hybrid-connections from webapps
Expand Down
14 changes: 14 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,20 @@ def load_arguments(self, _):
c.argument('action',
help="swap types. use 'preview' to apply target slot's settings on the source slot first; use 'swap' to complete it; use 'reset' to reset the swap",
arg_type=get_enum_type(['swap', 'preview', 'reset']))

with self.argument_context('webapp deployment github-actions')as c:
c.argument('name', arg_type=webapp_name_arg_type)
c.argument('resource_group', arg_type=resource_group_name_type, options_list=['--resource-group', '-g'])
c.argument('repo', help='The GitHub repository to which the workflow file will be added. In the format: <owner>/<repository-name>')
c.argument('token', help='A Personal Access Token with write access to the specified repository. For more information: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line')
c.argument('slot', options_list=['--slot', '-s'], help='The name of the slot. Default to the production slot if not specified.')
c.argument('branch', options_list=['--branch', '-b'], help='The branch to which the workflow file will be added. Defaults to "master" if not specified.')
c.argument('login_with_github', help='Interactively log in with Github to retrieve the Personal Access Token', action='store_true')

with self.argument_context('webapp deployment github-actions add')as c:
c.argument('runtime', options_list=['--runtime', '-r'], help='Canonicalized web runtime in the format of Framework|Version, e.g. "PHP|5.6". Use "az webapp list-runtimes" for available list.')
c.argument('force', options_list=['--force', '-f'], help='When true, the command will overwrite any workflow file with a conflicting name.', action='store_true')

with self.argument_context('webapp log config') as c:
c.argument('application_logging', help='configure application logging',
arg_type=get_enum_type(['filesystem', 'azureblobstorage', 'off']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ def load_command_table(self, _):
g.custom_command('config', 'enable_cd')
g.custom_command('show-cd-url', 'show_container_cd_url')

with self.command_group('webapp deployment github-actions', is_preview=True) as g:
g.custom_command('add', 'add_github_actions')
g.custom_command('remove', 'remove_github_actions')

with self.command_group('webapp auth') as g:
g.custom_show_command('show', 'get_auth_settings')
g.custom_command('update', 'update_auth_settings')
Expand Down
Loading