-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[functionapp] Added Azure Functions extension (#3926)
* initial commit. * Removed vendored sdks. Cleaned up extension. Added dependencies and tests. * Added azure-functions-devops-build dependency * Improved extension summary, added author details. * Fixed style issue. Added entry to service_name.json. * Fixed codeowners for extension.
- Loading branch information
Showing
18 changed files
with
1,955 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,4 +210,7 @@ | |
|
||
/src/purview/ @kairu-ms @jsntcy | ||
|
||
/src/functionapp/ @gzuber | ||
|
||
/src/elastic/ @kairu-ms @jsntcy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Microsoft Azure CLI 'functionapp' Extension | ||
========================================== | ||
|
||
This package is for the 'functionapp' extension. | ||
i.e. 'az functionapp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
from azext_functionapp._help import helps # pylint: disable=unused-import | ||
|
||
|
||
class FunctionappCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azure.cli.core.profiles import ResourceType | ||
functionapp_custom = CliCommandType( | ||
operations_tmpl='azext_functionapp.custom#{}') | ||
super().__init__(cli_ctx=cli_ctx, | ||
custom_command_type=functionapp_custom, | ||
resource_type=ResourceType.MGMT_APPSERVICE) | ||
|
||
def load_command_table(self, args): | ||
from azext_functionapp.commands import load_command_table | ||
load_command_table(self, args) | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_functionapp._params import load_arguments | ||
load_arguments(self, command) | ||
|
||
|
||
COMMAND_LOADER_CLS = FunctionappCommandsLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from knack.help_files import helps # pylint: disable=unused-import | ||
|
||
|
||
helps['functionapp devops-pipeline'] = """ | ||
type: group | ||
short-summary: Azure Function specific integration with Azure DevOps. Please visit https://aka.ms/functions-azure-devops for more information. | ||
""" | ||
|
||
helps['functionapp devops-pipeline create'] = """ | ||
type: command | ||
short-summary: Create an Azure DevOps pipeline for a function app. | ||
examples: | ||
- name: create an Azure Pipeline to a function app. | ||
text: > | ||
az functionapp devops-pipeline create --functionapp-name FunctionApp | ||
- name: create an Azure Pipeline from a Github function app repository. | ||
text: > | ||
az functionapp devops-pipeline create --github-repository GithubOrganization/GithubRepository --github-pat GithubPersonalAccessToken | ||
- name: create an Azure Pipeline with specific Azure DevOps organization and project | ||
text: > | ||
az functionapp devops-pipeline create --organization-name AzureDevOpsOrganization --project-name AzureDevOpsProject | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
# pylint: disable=line-too-long | ||
|
||
from azure.cli.core.local_context import LocalContextAttribute, LocalContextAction | ||
from azure.cli.core.commands.parameters import get_three_state_flag | ||
|
||
|
||
def load_arguments(self, _): | ||
# pylint: disable=line-too-long | ||
# PARAMETER REGISTRATION | ||
|
||
with self.argument_context('functionapp devops-pipeline') as c: | ||
c.argument('functionapp_name', help="Name of the Azure function app that you want to use", required=False, | ||
local_context_attribute=LocalContextAttribute(name='functionapp_name', | ||
actions=[LocalContextAction.GET])) | ||
c.argument('organization_name', help="Name of the Azure DevOps organization that you want to use", | ||
required=False) | ||
c.argument('project_name', help="Name of the Azure DevOps project that you want to use", required=False) | ||
c.argument('repository_name', help="Name of the Azure DevOps repository that you want to use", required=False) | ||
c.argument('overwrite_yaml', help="If you have an existing yaml, should it be overwritten?", | ||
arg_type=get_three_state_flag(return_label=True), required=False) | ||
c.argument('allow_force_push', | ||
help="If Azure DevOps repository is not clean, should it overwrite remote content?", | ||
arg_type=get_three_state_flag(return_label=True), required=False) | ||
c.argument('github_pat', help="Github personal access token for creating pipeline from Github repository", | ||
required=False) | ||
c.argument('github_repository', help="Fullname of your Github repository (e.g. Azure/azure-cli)", | ||
required=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"azext.minCliCoreVersion": "2.0.46", | ||
"azext.isPreview": true | ||
} |
Oops, something went wrong.