Skip to content

Commit

Permalink
fix: revert cli name for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jayzhang committed Oct 26, 2023
1 parent 04312ce commit 2daf7e9
Show file tree
Hide file tree
Showing 32 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion docs/cicd/azdo/cd.azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ steps:
# npm run test
# Login Azure by service principal
npx teamsapp auth login azure --service-principal --username $(AZURE_SERVICE_PRINCIPAL_NAME) --password $(AZURE_SERVICE_PRINCIPAL_PASSWORD) --tenant $(AZURE_TENANT_ID)
npx teamsfx account login azure --service-principal --username $(AZURE_SERVICE_PRINCIPAL_NAME) --password $(AZURE_SERVICE_PRINCIPAL_PASSWORD) --tenant $(AZURE_TENANT_ID)
# Deploy to hosting environment.
npx teamsfx deploy --env ${TEAMSFX_ENV_NAME}
2 changes: 1 addition & 1 deletion docs/cicd/azdo/provision.azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ steps:
npm install @microsoft/teamsfx-cli@${TEAMSFX_CLI_VERSION}
# Login Azure by service principal
npx teamsapp auth login azure --service-principal --username $(AZURE_SERVICE_PRINCIPAL_NAME) --password $(AZURE_SERVICE_PRINCIPAL_PASSWORD) --tenant $(AZURE_TENANT_ID)
npx teamsfx account login azure --service-principal --username $(AZURE_SERVICE_PRINCIPAL_NAME) --password $(AZURE_SERVICE_PRINCIPAL_PASSWORD) --tenant $(AZURE_TENANT_ID)

# We suggest to do the `teamsfx provision` step manually or in a separate workflow. The following steps are for your reference.
# After provisioning, you should commit necessary files under teamsfx into the repository.
Expand Down
2 changes: 1 addition & 1 deletion docs/cicd/jenkins/Jenkinsfile.azure.cd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pipeline {
TENANT_ID = credentials('AZURE_TENANT_ID')
}
steps {
sh 'npx teamsapp auth login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
sh 'npx teamsfx account login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/cicd/jenkins/Jenkinsfile.azure.provision
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
TENANT_ID = credentials('AZURE_TENANT_ID')
}
steps {
sh 'npx teamsapp auth login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
sh 'npx teamsfx account login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/cicd/others/cd.azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ npm install @microsoft/teamsfx-cli@${TEAMSFX_CLI_VERSION}
# npm run test

# Login Azure by service principal
npx teamsapp auth login azure --service-principal --username ${AZURE_SERVICE_PRINCIPAL_NAME} --password ${AZURE_SERVICE_PRINCIPAL_PASSWORD} --tenant ${AZURE_TENANT_ID}
npx teamsfx account login azure --service-principal --username ${AZURE_SERVICE_PRINCIPAL_NAME} --password ${AZURE_SERVICE_PRINCIPAL_PASSWORD} --tenant ${AZURE_TENANT_ID}

# Deploy to hosting environment.
npx teamsfx deploy --env ${TEAMSFX_ENV_NAME}
2 changes: 1 addition & 1 deletion docs/cicd/others/provision.azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cd {FolderName}
npm install @microsoft/teamsfx-cli@${TEAMSFX_CLI_VERSION}

# Login Azure by service principal
npx teamsapp auth login azure --service-principal --username ${AZURE_SERVICE_PRINCIPAL_NAME} --password ${AZURE_SERVICE_PRINCIPAL_PASSWORD} --tenant ${AZURE_TENANT_ID}
npx teamsfx account login azure --service-principal --username ${AZURE_SERVICE_PRINCIPAL_NAME} --password ${AZURE_SERVICE_PRINCIPAL_PASSWORD} --tenant ${AZURE_TENANT_ID}

# We suggest to do the `teamsfx provision` step manually or in a separate workflow. The following steps are for your reference.
# After provisioning, you should commit necessary files into the repository.
Expand Down
2 changes: 1 addition & 1 deletion docs/cicd_insider/jenkins-cd-template.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pipeline {
TENANT_ID = credentials('AZURE_TENANT_ID')
}
steps {
sh 'npx teamsapp auth login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
sh 'npx teamsfx account login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}'
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/cicd_insider/others-script-cd-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cd tabs && npm run test && cd -
npx teamsfx config set -g interactive false

# Login Azure by service principal
npx teamsapp auth login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}
npx teamsfx account login azure --service-principal --username ${SP_NAME} --password ${SP_PASSWORD} --tenant ${TENANT_ID}

# We suggest to do the provision steps by case manually or in a separated workflow, so just comment the following steps for references.
# After provisioning, you should commit necessary files under .fx into the repository.
Expand Down
58 changes: 29 additions & 29 deletions docs/cli/user-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Let's start by installing `teamsfx-cli` from `npm` and run `teamsfx -h` to check
| `teamsfx` Commands | Descriptions |
|:---------------- |:-------------|
| `teamsfx new` | Create a new Teams application. |
| `teamsapp auth` | Manage cloud service accounts. The supported cloud services are 'Azure' and 'Microsoft 365'. |
| `teamsfx account` | Manage cloud service accounts. The supported cloud services are 'Azure' and 'Microsoft 365'. |
| `teamsfx env` | Manage the environments. |
| `teamsfx capability`| Add new capabilities to the current application. |
| `teamsfx resource` | Manage the resources in the current application. |
Expand All @@ -30,7 +30,7 @@ Let's start by installing `teamsfx-cli` from `npm` and run `teamsfx -h` to check
| `teamsfx publish` | Publish the app to Teams. |
| `teamsfx preview` | Preview the current application. |
| `teamsfx config` | Manage the configuration data. |
| `teamsapp collaborator`| Collaborate with other developers in same project.|
| `teamsfx permission`| Collaborate with other developers in same project.|

## `teamsfx new`

Expand Down Expand Up @@ -77,16 +77,16 @@ teamsfx new --interactive false --app-name newtabbotapp --capability tab bot --p
teamsfx new --interactive false app-name newapp --azure-resources sql function --programming-language typescript
```

## `teamsapp auth`
## `teamsfx account`

Manage cloud service accounts. The supported cloud services are `Azure` and `Microsoft 365`.

| `teamsapp auth` Commands | Descriptions |
| `teamsfx account` Commands | Descriptions |
|:---------------- |:-------------|
| `teamsapp auth show` | Display all connected cloud accounts information. |
| `teamsapp auth login <service>` | Log in to the selected cloud service. |
| `teamsapp auth logout <service>` | log out of selected cloud service. |
| `teamsapp auth set --subscription` | Update account settings to set a subscription ID. |
| `teamsfx account show` | Display all connected cloud accounts information. |
| `teamsfx account login <service>` | Log in to the selected cloud service. |
| `teamsfx account logout <service>` | log out of selected cloud service. |
| `teamsfx account set --subscription` | Update account settings to set a subscription ID. |

## `teamsfx env`

Expand Down Expand Up @@ -313,57 +313,57 @@ teamsfx config get --env dev
teamsfx config set fx-resource-aad-app-for-teams.clientSecret xxx --env dev
```

## `teamsapp collaborator`
## `teamsfx permission`

TeamsFx CLI provides `teamsapp collaborator` Commands for collaboration scenario.
TeamsFx CLI provides `teamsfx permission` Commands for collaboration scenario.

| `teamsapp collaborator` Commands | Descriptions |
| `teamsfx permission` Commands | Descriptions |
|:------------------------------|-------------|
| `teamsapp collaborator grant --env --email` | Grant permission for collaborator's Microsoft 365 account for the project of a specified environment. |
| `teamsapp collaborator status` | Show permission status for the project |
| `teamsfx permission grant --env --email` | Grant permission for collaborator's Microsoft 365 account for the project of a specified environment. |
| `teamsfx permission status` | Show permission status for the project |

### Parameters for `teamsapp collaborator grant`
### Parameters for `teamsfx permission grant`

| Parameters | Required | Descriptions |
|:---------------- |:-------------|:-------------|
|`--env`| Yes | Provide env name. |
|`--email`| Yes | Provide collaborator's Microsoft 365 email address. Note that the collaborator's account should be in the same tenant with creator. |

### Parameters for `teamsapp collaborator status`
### Parameters for `teamsfx permission status`

| Parameters | Required | Descriptions |
|:---------------- |:-------------|:-------------|
|`--env`| Yes | Provide env name. |
|`--list-all-collaborators` | No | With this flag, Teams Toolkit CLI will print out all collaborators for this project. |

### Scenarios for `teamsapp collaborator`
### Scenarios for `teamsfx permission`

Here are some examples, for better handling permission for `TeamsFx` projects.

#### Grant Permission

Project creator and collaborators can use `teamsapp collaborator grant` command to add a new collaborator to the project:
Project creator and collaborators can use `teamsfx permission grant` command to add a new collaborator to the project:

```bash
teamsapp collaborator grant --env dev --email [email protected]
teamsfx permission grant --env dev --email [email protected]
```

After successfully granted permission, project creator and collaborators can share the project with the new collaborator by Github, and the new collaborator will have all permission for Microsoft 365 account.

#### Show Permission Status

Project creator and collaborators can use `teamsapp collaborator status` command to view his Microsoft 365 account permission for specific env:
Project creator and collaborators can use `teamsfx permission status` command to view his Microsoft 365 account permission for specific env:

```bash
teamsapp collaborator status --env dev
teamsfx permission status --env dev
```

#### List All Collaborators

Project creator and collaborators can use `teamsapp collaborator status` command to view all collaborators for specific env:
Project creator and collaborators can use `teamsfx permission status` command to view all collaborators for specific env:

```bash
teamsapp collaborator status --env dev --list-all-collaborators
teamsfx permission status --env dev --list-all-collaborators
```

#### E2E Collaboration work flow in CLI
Expand All @@ -379,8 +379,8 @@ As a project creator:
- Login Microsoft 365 account and Azure account.

```bash
teamsapp auth login azure
teamsapp auth login Microsoft 365
teamsfx account login azure
teamsfx account login Microsoft 365
```

- Provision your project.
Expand All @@ -392,14 +392,14 @@ As a project creator:
- View collaborators. You should see yourself here.

```bash
teamsapp collaborator status --env dev --list-all-collaborators
teamsfx permission status --env dev --list-all-collaborators
```

![list-all-collaborators](./images/permission-status-all.png)
- Add another account as collaborator. Note that the added account must under the same tenant:

```bash
teamsapp collaborator grant --env dev --email [email protected]
teamsfx permission grant --env dev --email [email protected]
```

![add-new-collaborator](./images/permission-grant.png)
Expand All @@ -411,19 +411,19 @@ As a Project Collaborator:
- Login Microsoft 365 account. Note that the Microsoft 365 account should be the same as added above:

```bash
teamsapp auth login Microsoft 365
teamsfx account login Microsoft 365
```

- Login Azure account which has contributor permission for all the Azure resources.

```bash
teamsapp auth login azure
teamsfx account login azure
```

- Check permission status. You should find yourself have the owner permission of the project:

```bash
teamsapp collaborator status --env dev
teamsfx permission status --env dev
```

![permission status](./images/permission-status.png)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/models/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { accountLogoutCommand } from "./accountLogout";
import { accountShowCommand } from "./accountShow";

export const accountCommand: CLICommand = {
name: "auth",
aliases: ["account"],
name: "account",
aliases: ["auth"],
description: "Manage Microsoft 365 and Azure accounts.",
commands: [accountShowCommand, accountLoginCommand, accountLogoutCommand],
};
4 changes: 2 additions & 2 deletions packages/cli/src/commands/models/m365Sideloading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const sideloadingServiceEndpoint =
process.env.SIDELOADING_SERVICE_ENDPOINT ?? serviceEndpoint;

export const m365SideloadingCommand: CLICommand = {
name: "install",
aliases: ["sideloading"],
name: "sideloading",
aliases: ["install"],
description:
"Sideloading an M365 App with corresponding information specified in the given manifest package.",
options: [
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/models/m365Unacquire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { TelemetryEvent } from "../../telemetry/cliTelemetryEvents";
import { sideloadingServiceEndpoint } from "./m365Sideloading";

export const m365UnacquireCommand: CLICommand = {
name: "uninstall",
aliases: ["unacquire"],
name: "unacquire",
aliases: ["uninstall"],
description: "Remove an acquired M365 App.",
options: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/models/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { permissionGrantCommand } from "./permissionGrant";
import { permissionStatusCommand } from "./permissionStatus";

export const permissionCommand: CLICommand = {
name: "collaborator",
aliases: ["permission"],
name: "permission",
aliases: ["collaborator"],
description:
"Check, grant and list permissions for who can access and manage Microsoft Teams application and Azure Active Directory application.",
commands: [permissionStatusCommand, permissionGrantCommand],
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commonlib/common/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const m365LoginMessage =
"Log in to your Microsoft 365 account - opening default web browser at ";

export const changeLoginTenantMessage =
"The following tenants require Multi-Factor Authentication (MFA). Use 'teamsapp auth login azure --tenant TENANT_ID' to explicitly login to a tenant.";
"The following tenants require Multi-Factor Authentication (MFA). Use 'teamsfx account login azure --tenant TENANT_ID' to explicitly login to a tenant.";
export const MFACode = "AADSTS50076";

export const noSubscriptionFound = "NoSubscriptionFound";
Expand All @@ -50,7 +50,7 @@ export const envDefaultJsonFile = "env.default.json";
export const sendFileTimeout = "Send success page timeout.";
export const usageError = "UsageError";
export const servicePrincipalLoginFormat =
"teamsapp auth login azure --service-principal --username NAME --password SECRET --tenant TENANT";
export const codeFlowLoginFormat = "teamsapp auth login azure";
"teamsfx account login azure --service-principal --username NAME --password SECRET --tenant TENANT";
export const codeFlowLoginFormat = "teamsfx account login azure";

export const m365CacheName = "appStudio";
Loading

0 comments on commit 2daf7e9

Please sign in to comment.