зеркало из
1
0
Форкнуть 0
This commit is contained in:
Xintia Gyenge 2021-05-07 10:13:53 +02:00 коммит произвёл GitHub
Родитель ae8b1410f5
Коммит 85808a94df
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 68 добавлений и 70 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -340,3 +340,6 @@ ASALocalRun/
healthchecksdb
.vscode/settings.json
secrets.ps1
#General
.DS_Store

135
README.md
Просмотреть файл

@ -14,9 +14,7 @@ By default, all the services which come under Data Landing Zone are enabled, and
> **Note:** Before deploying the resources, we recommend to check registration status of the required resource providers in your subscription. For more information, see [Resource providers for Azure services](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-providers-and-types).
<p align="center">
<img src="./docs/images/DataNode.png" alt="Data Landing Zone" width="500"/>
</p>
![Data Management Zone](./docs/images/DataNode.png)
For each data landing zone, the following services are created:
@ -53,20 +51,21 @@ The following prerequisites are required to make this repository work:
- [User Access Administrator](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#user-access-administrator) or [Owner](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#owner) access to the subscription to be able to create a service principal and role assignments for it.
- For deployment, please choose one of the below **Supported Regions** list.
#### **Supported Regions:**
- Asia Southeast
- Europe North
- Europe West
- France Central
- Japan East
- South Africa North
- UK South
- US Central
- US East
- US East 2
- US West 2
### **Supported Regions:**
If you dont have an Azure subscription, [create your Azure free account today](https://azure.microsoft.com/free/).
- Asia Southeast
- Europe North
- Europe West
- France Central
- Japan East
- South Africa North
- UK South
- US Central
- US East
- US East 2
- US West 2
If you don't have an Azure subscription, [create your Azure free account today](https://azure.microsoft.com/free/).
## Option 1: Deploy to Azure - Quickstart (Coming soon ...)
@ -81,13 +80,13 @@ If you dont have an Azure subscription, [create your Azure free account today
1. On GitHub, navigate to the main page of this repository.
1. Above the file list, click **Use this template**
<p align="center">
<img src="docs/images/UseThisTemplateGH.png" alt="GitHub Template repository" width="600"/>
</p>
![GitHub Template repository](docs/images/UseThisTemplateGH.png)
1. Use the **Owner** drop-down menu and select the account you want to own the repository.
<p align="center">
<img src="docs/images/CreateRepoGH.png" alt="Create Repository from Template" width="600"/>
</p>
![Create Repository from Template](docs/images/CreateRepoGH.png)
1. Type a name for your repository and an optional description.
1. Choose a repository visibility. For more information, see "[About repository visibility](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility)."
1. Optionally, to include the directory structure and files from all branches in the template and not just the default branch, select **Include all branches**.
@ -99,8 +98,8 @@ A service principal with *Contributor* role needs to be generated for authentica
#### Azure CLI
```Sh
# Replace {service-principal-name} and {subscription-id} with your
```sh
# Replace {service-principal-name} and {subscription-id} with your
# Azure subscription id and any name for your service principal.
az ad sp create-for-rbac \
--name "{service-principal-name}" \
@ -111,7 +110,7 @@ az ad sp create-for-rbac \
This will generate the following JSON output:
```JSON
```json
{
"clientId": "<GUID>",
"clientSecret": "<GUID>",
@ -121,7 +120,7 @@ This will generate the following JSON output:
}
```
>**Note:** Take note of the output. It will be required for the next steps.
> **Note:** Take note of the output. It will be required for the next steps.
For automation purposes, a few more role assignments are required for this service principal.
@ -179,8 +178,7 @@ New-AzRoleAssignment `
### 3. Resource Deployment
Now that you have set up the Service Principal, you need to choose how would you like to deploy the resources.
Deployment options:
Now that you have set up the Service Principal, you need to choose how would you like to deploy the resources. Deployment options:
1. [GitHub Actions](#github-actions)
1. [Azure DevOps](#azure-devops)
@ -188,9 +186,8 @@ Deployment options:
#### GitHub Actions
If you want to use GitHub Actions for deploying the resources, add the previous JSON output as a [repository secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `AZURE_CREDENTIALS` in your GitHub repository:
<p align="center">
<img src="docs/images/AzureCredentialsGH.png" alt="GitHub Secrets" width="600"/>
</p>
![GitHub Secrets](docs/images/AzureCredentialsGH.png)
To do so, execute the following steps:
@ -210,9 +207,8 @@ If you want to use Azure DevOps Pipelines for deploying the resources, you need
1. In Azure DevOps, open the **Project settings**.
1. Now, select the **Service connections** page from the project settings page.
1. Choose **New service connection** and select **Azure Resource Manager**.
<p align="center">
<img src="docs/images/ARMConnectionDevOps.png" alt="ARM Connection" width="600"/>
</p>
![ARM Connection](docs/images/ARMConnectionDevOps.png)
1. On the next page select **Service principal (manual)**.
1. Select the appropriate environment to which you would like to deploy the templates. Only the default option **Azure Cloud** is currently supported.
@ -221,24 +217,27 @@ If you want to use Azure DevOps Pipelines for deploying the resources, you need
1. Enter a user-friendly **Connection name** to use when referring to this service connection. Take note of the name because this will be required in the parameter update process.
1. Optionally, enter a **Description**.
1. Click on **Verify and save**.
<p align="center">
<img src="docs/images/ConnectionDevOps.png" alt="Connection DevOps" width="300"/>
</p>
![Connection DevOps](docs/images/ConnectionDevOps.png)
More information can be found [here](https://docs.microsoft.com/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-with-an-existing-service-principal).
### 4. Parameter Update Process
In order to deploy the ARM templates in this repository to the desired Azure subscription, you will need to modify some parameters in the forked repository. As updating each parameter file manually is a time-consuming and potentially error-prone process, we have simplified the task with a GitHub Action workflow. You can update your deployment parameters by completing three steps:
> **Note:** This section applies for both **Azure DevOps** and **GitHub** Deployment
In order to deploy the ARM templates in this repository to the desired Azure subscription, you will need to modify some parameters in the forked repository, which will be used for updating the files which will be used during the deployment. Therefor, **this step should not be skipped for neither Azure DevOps/GitHub options**. As updating each parameter file manually is a time-consuming and potentially error-prone process, we have simplified the task with a GitHub Action workflow. You can update your deployment parameters by completing three steps:
1. Configure the `updateParameters` workflow
1. Execute the `updateParameters` workflow
1. Configure the deployment pipeline
1. Merge these changes back to the `main` branch of your repo
#### Configure the `updateParameters` workflow
To begin, please open the [.github/workflows/updateParameters.yml](/.github/workflows/updateParameters.yml). In this file you need to update the environment variables. Just click on [.github/workflows/updateParameters.yml](/.github/workflows/updateParameters.yml) and edit the following section:
```YAML
> **Note:** There is only one 'updateParameters.yml', which can be found under the '.github' folder and this one will be used also for setting up the Azure DevOps Deployment
To begin, please open the [.github/workflows/updateParameters.yml](/.github/workflows/updateParameters.yml). In this file you need to update the environment variables. Just click on [.github/workflows/updateParameters.yml](/.github/workflows/updateParameters.yml) and edit the following section:
```yaml
env:
GLOBAL_DNS_RESOURCE_GROUP_ID: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
DATA_LANDING_ZONE_SUBSCRIPTION_ID: '{dataLandingZoneSubscriptionId}'
@ -254,7 +253,7 @@ The following table explains each of the parameters:
| Parameter | Description | Sample value |
|:-----------------------------------------|:-------------|:-------------|
| **GLOBAL_DNS_RESOURCE_GROUP_ID** | Specifies the global DNS resource group resource ID which gets deployed with the [Data Management Landing Zone](https://github.com/Azure/data-management-zone) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | `/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group` |
| **DATA_LANDING_ZONE_SUBSCRIPTION_ID** | Specifies the subscription ID of the Data Landing Zone where all the resources will be deployed | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
| **DATA_LANDING_ZONE_SUBSCRIPTION_ID** | Specifies the subscription ID of the Data Landing Zone where all the resources will be deployed | <div style="width: 36ch">`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`</div> |
| **DATA_LANDING_ZONE_NAME** | Specifies the name of your Data Landing Zone. The value should consist of alphanumeric characters (A-Z, a-z, 0-9) and should not contain any special characters like `-`, `_`, `.`, etc. Special characters will be removed in the renaming process. | `mynode01` |
| **LOCATION** | Specifies the region where you want the resources to be deployed. Please check [Supported Regions](#supported-regions) | `northeurope` |
| **AZURE_RESOURCE_MANAGER_CONNECTION_NAME** | Specifies the resource manager connection name in Azure DevOps. You can leave the default value if you want to use GitHub Actions for your deployment. More details on how to create the resource manager connection in Azure DevOps can be found in step 4. b) or [here](https://docs.microsoft.com/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-with-an-existing-service-principal). | `my-connection-name` |
@ -264,16 +263,19 @@ The following table explains each of the parameters:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#### Execute the `updateParameters` workflow
After updating the values, please commit the updated version to the `main` branch of your repository. This will kick off a GitHub Action workflow, which will appear under the **Actions** tab of the main page of the repository. The `Update Parameter Files` workflow will update all parameters in your repository according to a pre-defined naming convention.
#### Configure the deployment pipeline
The workflow above will make changes to all of the ARM config files. These changes will be stored in a new branch. Once the process has finished, it will open a new pull request in your repository where you can review the changes made by the workflow. The pull request will also provide the values you need to use to configure the deployment pipeline. Please follow the instructions in the pull request to complete the parameter update process.
If you are using GitHub Actions for your deployment, you will need to modify the `.github/workflows/dataNodeDeployment.yml` file. If you are using Azure Pipelines, you only need to modify the `.ado/workflows/dataNodeDeployment.yml` file. **You only need to modify one of these files. You do not need to modify both of them.**
The workflow above will make changes to all of the ARM config files. These changes will be stored in a new branch. Once the process has finished, it will open a new pull request in your repository where you can review the changes made by the workflow. The pull request will also provide the values you need to use to configure the deployment pipeline. Please follow the instructions in the pull request to complete the parameter update process.
>**Note:** We are not renaming the environment variables in the workflow files because this could lead to an infinite loop of workflow runs being started.
If you are using GitHub Actions for your deployment, you will need to modify the `.github/workflows/dataHubDeployment.yml` file. If you are using Azure Pipelines, you only need to modify the `.ado/workflows/dataHubDeployment.yml` file. **You only need to modify one of these files. You do not need to modify both of them.**
> **Note:** We are not renaming the environment variables in the workflow files because this could lead to an infinite loop of workflow runs being started.
#### Merge these changes back to the `main` branch of your repo
After following the instructions in the pull request, you can merge the pull request back into the `main` branch of your repository by clicking on **Merge pull request**. Finally, you can click on **Delete branch** to clean up your repository.
### 5. (not applicable for GH Actions) Reference pipeline from GitHub repository in Azure DevOps Pipelines
@ -283,14 +285,14 @@ After following the instructions in the pull request, you can merge the pull req
First you need to add and install the Azure Pipelines GitHub App to your GitHub account. To do so, execute the following steps:
1. Click on **Marketplace** in the top navigation bar on GitHub.
1. In the Marketplace, search for **Azure Pipelines**. The Azure Pipelines offering is free for anyone to use for public repositories and free for a single build queue if youre using a private repository.
<p align="center">
<img src="docs/images/AzurePipelinesGH.png" alt="Install Azure Pipelines on GitHub" width="600"/>
</p>
1. In the Marketplace, search for **Azure Pipelines**. The Azure Pipelines offering is free for anyone to use for public repositories and free for a single build queue if you're using a private repository.
![Install Azure Pipelines on GitHub](docs/images/AzurePipelinesGH.png)
1. Select it and click on **Install it for free**.
<p align="center">
<img src="docs/images/InstallButtonGH.png" alt="GitHub Template repository" width="600"/>
</p>
![GitHub Template repository](docs/images/InstallButtonGH.png)
1. If you are part of multiple **GitHub** organizations, you may need to use the **Switch billing account** dropdown to select the one into which you forked this repository.
1. You may be prompted to confirm your GitHub password to continue.
1. You may be prompted to log in to your Microsoft account. Make sure you log in with the one that is associated with your Azure DevOps account.
@ -301,19 +303,19 @@ As a last step, you need to create an Azure DevOps pipeline in your project base
1. Select the Azure DevOps project where you have setup your `Resource Manager Connection`.
1. Select **Pipelines** and then **New Pipeline** in order to create a new pipeline.
<p align="center">
<img src="docs/images/CreatePipelineDevOps.png" alt="Create Pipeline in DevOps" width="600"/>
</p>
![Create Pipeline in DevOps](docs/images/CreatePipelineDevOps.png)
1. Choose **GitHub YAML** and search for your repository (e.g. "`GitHubUserName/RepositoryName`").
<p align="center">
<img src="docs/images/CodeDevOps.png" alt="Choose code source in DevOps Pipeline" width="600"/>
</p>
![Choose code source in DevOps Pipeline](docs/images/CodeDevOps.png)
1. Select your repository.
1. Click on **Existing Azure Pipelines in YAML file**
1. Select `main` as branch and `/.ado/workflows/dataNodeDeployment.yml` as path.
<p align="center">
<img src="docs/images/ConfigurePipelineDevOps.png" alt="Configure Pipeline in DevOps" width="600"/>
</p>
![Configure Pipeline in DevOps](docs/images/ConfigurePipelineDevOps.png)
1. Click on **Continue** and then on **Run**.
### 6. Follow the workflow deployment
@ -367,7 +369,6 @@ ERROR: Deployment failed. Correlation ID: ***
"code": "MissingSubscriptionRegistration",
"target": "Microsoft.DocumentDB",
"message": "The subscription is not registered to use namespace 'Microsoft.DocumentDB'. See https://aka.ms/rps-not-found for how to register subscriptions."
```
**Solution:**
@ -376,14 +377,8 @@ This error message appears, in case during the deployment it tries to create a t
## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repositories using our CLA.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

Двоичные данные
docs/images/ARMConnectionDevOps.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 312 KiB

После

Ширина:  |  Высота:  |  Размер: 61 KiB

Двоичные данные
docs/images/AzureCredentialsGH.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 210 KiB

После

Ширина:  |  Высота:  |  Размер: 64 KiB

Двоичные данные
docs/images/AzurePipelinesGH.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 385 KiB

После

Ширина:  |  Высота:  |  Размер: 69 KiB

Двоичные данные
docs/images/CodeDevOps.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 197 KiB

После

Ширина:  |  Высота:  |  Размер: 61 KiB

Двоичные данные
docs/images/ConfigurePipelineDevOps.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 326 KiB

После

Ширина:  |  Высота:  |  Размер: 67 KiB

Двоичные данные
docs/images/ConnectionDevOps.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 143 KiB

После

Ширина:  |  Высота:  |  Размер: 80 KiB

Двоичные данные
docs/images/CreateRepoGH.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 270 KiB

После

Ширина:  |  Высота:  |  Размер: 66 KiB

Двоичные данные
docs/images/InstallButtonGH.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 242 KiB

После

Ширина:  |  Высота:  |  Размер: 43 KiB

Двоичные данные
docs/images/UseThisTemplateGH.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 40 KiB

После

Ширина:  |  Высота:  |  Размер: 28 KiB