Template to deploy the Data Management Zone of Cloud Scale Analytics (former Enterprise-Scale Analytics). The Data Management Zone provides data governance and management capabilities for the data platform of an organization.
Перейти к файлу
Marvin Buss 9bb498d354
Small Update of ES Portal Exp (#94)
2021-07-14 17:30:34 +02:00
.ado/workflows Bicep (#81) 2021-06-04 10:04:47 +02:00
.devcontainer Bicep (#81) 2021-06-04 10:04:47 +02:00
.github Fix GH Action Deployment Workflow (#93) 2021-07-14 16:32:16 +02:00
code Bicep (#81) 2021-06-04 10:04:47 +02:00
docs Small Update of ES Portal Exp (#94) 2021-07-14 17:30:34 +02:00
infra Updated Network Config (#92) 2021-07-14 17:08:06 +02:00
.gitattributes added gitignore 2020-09-09 22:21:26 +02:00
.gitignore Review feedback (#72) 2021-05-06 22:04:26 +02:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-08-07 06:20:54 -07:00
LICENSE Initial LICENSE commit 2020-08-07 06:20:55 -07:00
README.md New portal UI Updates (#90) 2021-06-28 16:45:03 +02:00
SECURITY.md Validation of readme (#43) 2021-02-23 13:49:33 +01:00

README.md

Enterprise Scale Analytics - Data Management

General disclaimer: Please be aware that this template is in private preview. Therefore, expect smaller bugs and issues when working with the solution. Please submit an Issue in GitHub if you come across any issues that you would like us to fix.

DO NOT COPY - UNDER DEVELOPMENT - MS INTERNAL ONLY - Please be aware that this template is in private preview without any SLA.

Description

The Data Management template is, as the name suggests, classified as a management function and is at the heart of the Enterprise Scale Analytics and AI solution pattern. It is responsible for the governance of the platform and enables communication to ingest data sources from Azure, third-party clouds and on-premises data sources.

What will be deployed?

By default, all the services which come under Data Management Zone are enabled, and you must explicitly disable services that you don't want to be deployed.

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.

Data Management Zone

For more details regarding the services that will be deployed, please read the Data Management guide in the Enterprise Scale Analytics documentation.

You have two options for deploying this reference architecture:

  1. Use the Deploy to Azure button for an immediate deployment
  2. Use GitHub Actions or Azure DevOps Pipelines for an automated, repeatable deployment

Prerequisites

The following prerequisites are required to make this repository work:

  • an Azure subscription
  • User Access Administrator or 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

If you don't have an Azure subscription, create your Azure free account today.

Option 1: Deploy to Azure - Quickstart (Coming soon ...)

Data Management Zone

Deploy to Azure

Option 2: GitHub Actions or Azure DevOps Pipelines

1. Create repository from a template

  1. On GitHub, navigate to the main page of this repository.

  2. Above the file list, click Use this template

    GitHub Template repository

  3. Use the Owner drop-down menu and select the account you want to own the repository.

    Create Repository from Template

  4. Type a name for your repository and an optional description.

  5. Choose a repository visibility. For more information, see "About repository visibility."

  6. Optionally, to include the directory structure and files from all branches in the template and not just the default branch, select Include all branches.

  7. Click Create repository from template.

2. Setting up the required Service Principal and access

A service principal with Contributor role needs to be generated for authentication and authorization from GitHub or Azure DevOps to your Azure subscription. This is required to deploy resources to your environment. Just go to the Azure Portal to find the ID of your subscription. Then start the Cloud Shell or Azure CLI, login to Azure, set the Azure context and execute the following commands to generate the required credentials:

Azure CLI

# 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}" \
  --role "Contributor" \
  --scopes "/subscriptions/{subscription-id}" \
  --sdk-auth

This will generate the following JSON output:

{
  "clientId": "<GUID>",
  "clientSecret": "<GUID>",
  "subscriptionId": "<GUID>",
  "tenantId": "<GUID>",
  (...)
}

Note: Take note of the output. It will be required for the next steps.

For automation purposes, one more role assignments is required for this service principal. Additional required role assignments include:

Role Name Description Scope
User Access Administrator Required to assign the managed identity of Purview to the Azure Key Vault.
(Resource Scope) /subscriptions/{{datalandingzone}subscriptionId}

To add these role assignments, you can use the Azure Portal or run the following commands using Azure CLI/Azure Powershell:

Azure CLI - Add role assignments

# Get Service Principal Object ID
az ad sp list --display-name "{servicePrincipalName}" --query "[].{objectId:objectId}" --output tsv

# Add role assignment
# Resource Scope level assignment
az role assignment create \
  --assignee "{servicePrincipalObjectId}" \
  --role "{roleName}" \
  --scopes "{scope}"

# Resource group scope level assignment
az role assignment create \
  --assignee "{servicePrincipalObjectId}" \
  --role "{roleName}" \
  --resource-group "{resourceGroupName}"

Azure Powershell - Add role assignments

# Get Service Principal Object ID
$spObjectId = (Get-AzADServicePrincipal -DisplayName "{servicePrincipalName}").id

# Add role assignment
# For Resource Scope level assignment
New-AzRoleAssignment `
  -ObjectId $spObjectId `
  -RoleDefinitionName "{roleName}" `
  -Scope "{scope}"

# For Resource group scope level assignment
New-AzRoleAssignment `
  -ObjectId $spObjectId `
  -RoleDefinitionName "{roleName}" `
  -ResourceGroupName "{resourceGroupName}"

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:

  1. GitHub Actions
  2. Azure DevOps

GitHub Actions

If you want to use GitHub Actions for deploying the resources, add the previous JSON output as a repository secret with the name AZURE_CREDENTIALS in your GitHub repository:

GitHub Secrets

To do so, execute the following steps:

  1. On GitHub, navigate to the main page of the repository.
  2. Under your repository name, click on the Settings tab.
  3. In the left sidebar, click Secrets.
  4. Click New repository secret.
  5. Type the name AZURE_CREDENTIALS for your secret in the Name input box.
  6. Enter the JSON output from above as value for your secret.
  7. Click Add secret.

Azure DevOps

If you want to use Azure DevOps Pipelines for deploying the resources, you need to create an Azure Resource Manager service connection. To do so, execute the following steps:

  1. First, you need to create an Azure DevOps Project. Instructions can be found here.

  2. In Azure DevOps, open the Project settings.

  3. Now, select the Service connections page from the project settings page.

  4. Choose New service connection and select Azure Resource Manager.

    ARM Connection

  5. On the next page select Service principal (manual).

  6. Select the appropriate environment to which you would like to deploy the templates. Only the default option Azure Cloud is currently supported.

  7. For the Scope Level, select Subscription and enter your subscription Id and name.

  8. Enter the details of the service principal that we have generated in step 3. (Service Principal Id = clientId, Service Principal Key = clientSecret, Tenant ID = tenantId) and click on Verify to make sure that the connection works.

  9. 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.

  10. Optionally, enter a Description.

  11. Click on Verify and save.

    Connection DevOps

More information can be found here.

4. Parameter Updates

Note: This section applies for both Azure DevOps and GitHub Deployment

In order to deploy the Infrastructure as Code (IaC) templates to the desired Azure subscription, you will need to modify some parameters in the forked repository. Therefore, this step should not be skipped for neither Azure DevOps/GitHub options. There are two files that require updates:

  • .github/workflows/dataManagementZoneDeployment.yml for GitHub Actions,
  • .ado/workflows/dataManagementZoneDeployment.yml for Azure DevOps and
  • infra/params.dev.json and

Update these files in a seperate branch and then merge via Pull Request to trigger the initial deployment.

Configure dataManagementZoneDeployment.yml

For GitHub Actions

To begin, please open the .github/workflows/dataManagementZoneDeployment.yml. In this file you need to update the environment variables section. Just click on .github/workflows/dataManagementZoneDeployment.yml and edit the following section:

env:
  AZURE_SUBSCRIPTION_ID: "17588eb2-2943-461a-ab3f-00a3ceac3112" # Update to '{dataHubSubscriptionId}'
  AZURE_LOCATION: "northeurope"                                 # Update to '{regionName}'

Further details about these parameters are provided in a table below.

For Azure DevOps

To begin, please open the .ado/workflows/dataManagementZoneDeployment.yml. In this file you need to update the variables section. Just click on .ado/workflows/dataManagementZoneDeployment.yml and edit the following section:

variables:
  AZURE_RESOURCE_MANAGER_CONNECTION_NAME: "data-management-zone-service-connection" # Update to '{yourResourceManagerConnectionName}'
  AZURE_SUBSCRIPTION_ID: "17588eb2-2943-461a-ab3f-00a3ceac3112"                     # Update to '{yourDataManagementZoneSubscriptionId}'
  AZURE_LOCATION: "North Europe"                                                    # Update to '{yourRegionName}'

The following table explains each of the parameters:

Parameter Description Sample value
AZURE_SUBSCRIPTION_ID Specifies the subscription ID of the Data Management Zone where all the resources will be deployed
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_LOCATION Specifies the region where you want the resources to be deployed. Please check 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. my-connection-name

Configure params.dev.json

To begin, please open the infra/params.dev.json. In this file you need to update the variable values. Just click on infra/params.dev.json and edit the values. An explanation of the values is given in the table below:

Parameter Description Sample value
location Specifies the location for all resources. northeurope
environment Specifies the environment of the deployment. dev, tst or prd
prefix Specifies the prefix for all resources created in this deployment. prefi
vnetAddressPrefix Specifies the address space of the vnet. 10.0.0.0/16
azureFirewallSubnetAddressPrefix Specifies the address space of the subnet that is use for Azure Firewall. 10.0.0.0/24
servicesSubnetAddressPrefix Specifies the address space of the subnet that is used for the services. 10.0.1.0/24
firewallPrivateIp Specifies the private IP address of the central firewall. 10.0.0.4
dnsServerAdresses Specifies the private IP addresses of the dns servers. [ 10.0.0.4 ]

5. (not applicable for GH Actions) Reference pipeline from GitHub repository in Azure DevOps Pipelines

Install Azure DevOps Pipelines GitHub Application

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.

  2. 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

  3. Select it and click on Install it for free.

    GitHub Template repository

  4. 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.

  5. You may be prompted to confirm your GitHub password to continue.

  6. 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.

Configuring the Azure Pipelines project

As a last step, you need to create an Azure DevOps pipeline in your project based on the pipeline definition YAML file that is stored in your GitHub repository. To do so, execute the following steps:

  1. Select the Azure DevOps project where you have setup your Resource Manager Connection.

  2. Select Pipelines and then New Pipeline in order to create a new pipeline.

    Create Pipeline in DevOps

  3. Choose GitHub YAML and search for your repository (e.g. "GitHubUserName/RepositoryName").

    Choose code source in DevOps Pipeline

  4. Select your repository.

  5. Click on Existing Azure Pipelines in YAML file

  6. Select main as branch and /.ado/workflows/dataHubDeployment.yml as path.

    Configure Pipeline in DevOps

  7. Click on Continue and then on Run.

6. Merge these changes back to the main branch of your repo

After following the instructions and updating the parameters and variables in your repository in a separate branch and opening 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. By doing this, you trigger the deployment workflow.

7. Follow the workflow deployment

Congratulations! You have successfully executed all steps to deploy the template into your environment through GitHub Actions or Azure DevOps.

If you are using GitHub Actions, you can navigate to the Actions tab of the main page of the repository, where you will see a workflow with the name Data Management Zone Deployment running. Click on it to see how it deploys the environment. If you run into any issues, please open an issue here.

If you are using Azure DevOps Pipelines, you can navigate to the pipeline that you have created as part of step 5 and monitor it as each service is deployed. If you run into any issues, please open an issue here.

Documentation

Code Structure

File/folder Description
.ado/workflows Folder for ADO workflows. The dataManagementZoneDeployment.yml workflow shows the steps for an end-to-end deployment of the architecture.
.github/workflows Folder for GitHub workflows. The dataManagementZoneDeployment.yml workflow shows the steps for an end-to-end deployment of the architecture.
code Sample password generation script that will be run in the deployment workflow for resources that require a password during the deployment.
docs Resources for this README.
infra Folder containing all the Bicep and ARM templates for each of the resources that will be deployed.
CODE_OF_CONDUCT.md Microsoft Open Source Code of Conduct.
LICENSE The license for the sample.
README.md This README file.
SECURITY.md Microsoft Security README.

Enterprise Scale Analytics and AI - Documentation and Implementation

Known issues

Error: MissingSubscriptionRegistration

Error Message:

ERROR: Deployment failed. Correlation ID: ***
  "error": ***
    "code": "MissingSubscriptionRegistration",
    "message": "The subscription is not registered to use namespace 'Microsoft.DocumentDB'. See https://aka.ms/rps-not-found for how to register subscriptions.",
    "details": [
      ***
        "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:

This error message appears, in case during the deployment it tries to create a type of resource which has never been deployed before inside the subscription. We recommend to check prior the deployment whether the required resource providers are registered for your subscription and if needed, register them through the Azure Portal, Azure Powershell or Azure CLI as mentioned here.

Error Message:

"statusMessage": "{\"error\":{\"code\":\"InvalidTemplateDeployment\",\"message\":\"The template deployment 'deploy.purview' is not valid according to the validation procedure. The tracking id is '9e22893b-1e0a-48ba-800c-77a27a86cade'. See inner errors for details.\",\"details\":[{\"code\":\"1000\",\"message\":\"Failed to list providers from ARM. Exception: The client '38a6ed90-8590-42fb-b09f-fbcf6f6849c3' with object id '38a6ed90-8590-42fb-b09f-fbcf6f6849c3' does not have authorization to perform action 'Microsoft.Resources/subscriptions/providers/read' over scope '/subscriptions/9ae0dd4c-d127-4901-bb76-46d39676a2cc' or the scope is invalid. If access was recently granted, please refresh your credentials.\"}]}}"
"eventCategory": "Administrative",

Solution:

Error Purview Specific This error message appears during the deployment of Purview in case it was not registered inside the subscription. We recommend to check prior the deployment whether the 'purview' resource providers is registered for your subscription and if needed, register it through the Azure Portal, Azure Powershell or Azure CLI as mentioned here.

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.

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. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.