refactor: azure terminal compatibility

Former-commit-id: 0f723505f0d9e39c560e7f532f7f06cac16aae55
This commit is contained in:
Renan Vilas Novas 2021-07-19 09:49:32 -03:00
Родитель 52e49e6f44
Коммит 27fbf01768
7 изменённых файлов: 94 добавлений и 43 удалений

Просмотреть файл

@ -25,7 +25,7 @@
4. Make sure the Organization where the project is created in the Azure DevOps is [connected with the Azure Active Directory](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/connect-organization-to-azure-ad?view=azure-devops
) of the Azure Subscription that will be used in the lab.
## PowerShell
### PowerShell
1. The lab requires **PowerShell 7.1** with [PowerShell Core](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/?view=powershell-7.1) module, which can be installed either on Windows or Linux.
@ -36,12 +36,17 @@
2. Install the [Azure Az PowerShell module](https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-6.2.0).
## Azure CLI
### Azure CLI
1. Install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).
2. Install the [Azure DevOps CLI](https://docs.microsoft.com/en-us/azure/devops/cli/?view=azure-devops).
## Other Tools
### Other Tools
1. Install the [Databricks CLI](https://docs.microsoft.com/en-us/azure/databricks/dev-tools/cli/#install-the-cli).
1. Install the [Databricks CLI](https://docs.microsoft.com/en-us/azure/databricks/dev-tools/cli/#install-the-cli).
## Next Step
* [Create the a setup file](./1a-create-hol-setup-file-basic.md)

Просмотреть файл

@ -1,23 +0,0 @@
# Setup the Configuration File
1. Open the terminal and create a new config file based on an existing template:
```bash
cd hol
./quickstart/scripts/cloud-setup/Replace-TemplateArgs.ps1 -projectName "<myProjectName>" -projectAlias "<myProjectAlias>" -orgName "<myOrgName>" -subscriptionId "<mySubscriptionId>"
```
- *Observation: Be sure to execute command above under the `./hol` directory*
2. Open the file `quickstart/configs/cloud-setup/hol.json` using your favorite editor and replace the following values:
|Value|Description|Example|
|-----|-----------|-------|
|<_projectName_>|Name of the existing project inside Azure DevOps that will be used in the lab|_MyDataOpsHOL_|
|<_projectAlias_>|A string of 8 characteres that will be used as part of the name of for the Resource Groups|_dataops_|
|<_orgName_>|Azure DevOps organization name|_MyOrg_|
|<_subscriptionId_>|Azure Subscription ID where the resources will be deployed|_f7e5bb9e-0f98-4c5d-a5c1-a9154bf3cd61_|
## Next Step
* [Create the pre-required Azure resources](./2-create-prereqs-azure.md)

Просмотреть файл

@ -0,0 +1,29 @@
# Setup the Configuration File
1. Open the terminal, clone the source code of the lab and go to the `hol` directory.
```bash
git clone https://holsetup:2je7narfoc2rusvewdjpfnlcn3pyponyrpsko3w5b6z26zj4wpoa@dev.azure.com/csu-devsquad/advworks-dataops/_git/ho
cd hol
```
2. Execute the following command to create a new config file based on an existing template. Provide arguments to this setup based on the table below:
```bash
# Be sure to execute this script under the hol directory
./quickstart/scripts/cloud-setup/Replace-TemplateArgs.ps1
```
|Argument|Description|Example|
|-----|-----------|-------|
|<_orgName_>|Azure DevOps organization name where you will execute the Hands-On Lab|_MyOrg_|
|<_projectName_>|Name of the existing project inside Azure DevOps where you will execute the Hands-On Lab|_MyDataOpsHOL_|
|<_projectAlias_>|An unique string with less than 8 characteres that will be used as part of your resource group names|_dataops_|
|<_subscriptionId_>|Azure Subscription ID where the resources will be deployed|_f7e5bb9e-0f98-4c5d-a5c1-a9154bf3cd61_|
- (_OPTIONAL_) If you are using this project as a Hands-On Lab, feel free to proceed to the next step of the quickstart. If you are using this project as a template for dataops, check [this additional documentation](./1b-create-prereqs-azure-advanced.md) that explains how you can do advanced configurations.
## Next Step
* [Create the pre-required Azure resources](./2-create-prereqs-azure.md)

Просмотреть файл

@ -0,0 +1,30 @@
# Setup the Configuration File
1. Open the terminal, clone the source code of the lab and go to the `hol` directory.
```bash
# URL Pattern: https://<anything>:<PAT>@dev.azure.com/<yourOrgName>/<yourProjectName>/_git/<yourRepoName>
git clone https://holsetup:2je7narfoc2rusvewdjpfnlcn3pyponyrpsko3w5b6z26zj4wpoa@dev.azure.com/csu-devsquad/advworks-dataops/_git/ho
cd hol
```
2. Create a new config file based on an existing template:
```bash
cp quickstart/configs/cloud-setup/template.json quickstart/configs/cloud-setup/hol.json
```
3. Open the file `quickstart/configs/cloud-setup/hol.json` using your favorite editor and replace the following values:
|Argument|Description|Example|
|-----|-----------|-------|
|<_orgName_>|Azure DevOps organization name where you will execute the Hands-On Lab|_MyOrg_|
|<_projectName_>|Name of the existing project inside Azure DevOps where you will execute the Hands-On Lab|_MyDataOpsHOL_|
|<_projectAlias_>|An unique string with less than 8 characteres that will be used as part of your resource group names|_dataops_|
|<_subscriptionId_>|Azure Subscription ID where the resources will be deployed|_f7e5bb9e-0f98-4c5d-a5c1-a9154bf3cd61_|
3. You can also edit the subscriptions and service principals used by each one of the three environments: `dev`, `qa` and `prod`.
## Next Step
* [Create the pre-required Azure resources](./2-create-prereqs-azure.md)

Просмотреть файл

@ -7,7 +7,7 @@ An environment variable called `AZURE_DEVOPS_EXT_PAT` that stores a [PAT (Person
To do so, create the PAT on your new Azure DevOps project then run the following command:
```
```powershell
$env:AZURE_DEVOPS_EXT_PAT="<my pat goes here>"
```
@ -17,13 +17,13 @@ A PowerShell command execution is required to connect to Azure with your authent
If you are running PowerShell on **Windows**, simply run:
```
```powershell
Connect-AzAccount
```
Otherwise, run the same command with the `-UseDeviceAuthentication` flag enabled:
```
```powershell
Connect-AzAccount -UseDeviceAuthentication
```
@ -31,7 +31,7 @@ Connect-AzAccount -UseDeviceAuthentication
Using [PowerShell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.1), run the following script to deploy the pre-required Azure resources:
```
```powershell
./quickstart/scripts/cloud-setup/Deploy-AzurePreReqs.ps1 -ConfigurationFile "quickstart/configs/cloud-setup/hol.json"
```
@ -43,4 +43,4 @@ The diagram below shows what Azure resources will be created after the execution
## Next Step
* [Prepare your Azure DevOps project](./3-azdo-setup.md)
* [Prepare your Azure DevOps project](./3a-azdo-setup-basic.md)

Просмотреть файл

@ -7,26 +7,27 @@ On your Azure DevOps project, go to the `Artifacts` section -> `Create Feed`, th
![Artifact feed](./images/artifact-feed.png)
## Create the environment variables
An environment variable called `AZURE_DEVOPS_EXT_PAT_TEMPLATE` that stores a [PAT (Personal Access Token)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page) with **Code (read)** [scope](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes) is required to allow you to clone this repository to your new Azure DevOps project that will be used for this lab.
To do so, create a PAT on the `advworks-dataops` project (not on your new Azure DevOps project) then run the following command:
```
$env:AZURE_DEVOPS_EXT_PAT_TEMPLATE="<my pat goes here>"
```
## Project setup
Initial setup of git configuration and environment variables:
```powershell
# You don't need to change any of the following values below
git config --global user.email "hol@microsoft.com"
git config --global user.name "HOL Setup User"
$env:AZURE_DEVOPS_EXT_PAT_TEMPLATE="2je7narfoc2rusvewdjpfnlcn3pyponyrpsko3w5b6z26zj4wpoa"
```
Run the following script to clone the `hol` repo, create the pipelines and service connections inside your new Azure DevOps.
> Note the file name is the one inside the output directory and the name is the same name of the _projectName_ that was replaced in the first config file.
```
```powershell
./quickstart/scripts/dataops/Deploy-AzureDevOps.ps1 -ConfigurationFile "./quickstart/outputs/hol.json" -UsePAT $true
```
- (Optional) If you are using this project as a Hands-On Lab, feel free to proceed to the next step of the quickstart.If you are using this project as a template for dataops, check [this documentation](./3b-azdo-setup-advanced.md) for understanding more details about the `AZURE_DEVOPS_EXT_PAT_TEMPLATE` environment variable.
## Next Step
* [Create Azure Databricks secrets scope for all environments](./4-create-databricks-secrets-scope.md)

Просмотреть файл

@ -0,0 +1,9 @@
## (Optional) Create the environment variables
An environment variable called `AZURE_DEVOPS_EXT_PAT_TEMPLATE` that stores a [PAT (Personal Access Token)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page) with **Code (read)** [scope](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes) is required to allow you to clone this repository to your new Azure DevOps project that will be used for this lab.
To do so, create a PAT on the `advworks-dataops` project (not on your new Azure DevOps project) then run the following command:
``` powershell
$env:AZURE_DEVOPS_EXT_PAT_TEMPLATE="<my pat goes here>
```