updated workflows and added password gen
This commit is contained in:
Родитель
cc86095ff5
Коммит
23c551ad66
|
@ -6,16 +6,28 @@ trigger:
|
|||
- main
|
||||
paths:
|
||||
include:
|
||||
- 'infra/Storage/**'
|
||||
- 'infra/KeyVault/**'
|
||||
- 'infra/MachineLearning/**'
|
||||
- 'infra/PrivateEndpoint/**'
|
||||
- '.ado/workflows/dataProductDeployment.yml'
|
||||
- infra/ApplicationInsights/*
|
||||
- infra/BigDataPool/*
|
||||
- infra/CognitiveServices/*
|
||||
- infra/ContainerRegistry/*
|
||||
- infra/DataFactory/*
|
||||
- infra/KeyVault/*
|
||||
- infra/LogicApps/*
|
||||
- infra/MachineLearning/*
|
||||
- infra/MachineLearningAks/*
|
||||
- infra/MachineLearningCluster/*
|
||||
- infra/MachineLearningComputeInstance/*
|
||||
- infra/MachineLearningSynapse/*
|
||||
- infra/Search/*
|
||||
- infra/SqlPool/*
|
||||
- infra/Storage/*
|
||||
- infra/Synapse/*
|
||||
- .ado/workflows/dataProductDeployment.yml
|
||||
|
||||
variables:
|
||||
AZURE_RESOURCE_MANAGER_CONNECTION_NAME: 'Marvins Azure Subscription(558bd446-4212-46a2-908c-9ab0a628705e)'
|
||||
AZURE_SUBSCRIPTION_ID: '558bd446-4212-46a2-908c-9ab0a628705e'
|
||||
AZURE_RESOURCE_GROUP_NAME: 'dataproduct002'
|
||||
AZURE_RESOURCE_MANAGER_CONNECTION_NAME: 'My Subscription'
|
||||
AZURE_SUBSCRIPTION_ID: '2f68ca09-59d9-4ab5-ad11-c54872bfa28d'
|
||||
AZURE_RESOURCE_GROUP_NAME: 'dn001-dp001'
|
||||
AZURE_LOCATION: 'North Europe'
|
||||
|
||||
stages:
|
||||
|
@ -39,10 +51,10 @@ stages:
|
|||
continueOnError: false
|
||||
enabled: true
|
||||
|
||||
# Deploy key vault 001 - validation
|
||||
# Deploy Key Vault 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: key_vault_001_validation
|
||||
displayName: Deploy key vault 001 - validation
|
||||
displayName: Deploy Key Vault 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -53,14 +65,32 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: 'infra/KeyVault/params.keyVault001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/params.keyVault001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy storage account 001 - validation
|
||||
# Deploy Key Vault 002 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: key_vault_002_validation
|
||||
displayName: Deploy Key Vault 002 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/params.keyVault002.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Storage Account 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: storage_account_001_validation
|
||||
displayName: Deploy storage account 001 - validation
|
||||
displayName: Deploy Storage Account 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -71,14 +101,14 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/Storage/deploy.storage.json'
|
||||
csmParametersFile: 'infra/Storage/params.storage001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Storage/deploy.storage.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Storage/params.storage001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy ml workspace 001 - validation
|
||||
# Deploy Application Insights 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: ml_workspace_001_validation
|
||||
displayName: Deploy ml workspace 001 - validation
|
||||
name: application_insights_001_validation
|
||||
displayName: Deploy Application Insights 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -89,14 +119,228 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/MachineLearning/deploy.mlWorkspace.json'
|
||||
csmParametersFile: 'infra/MachineLearning/params.mlWorkspace001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/ApplicationInsights/deploy.applicationInsights.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/ApplicationInsights/params.applicationInsights001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy data factory 001 - validation
|
||||
# Deploy Container Registry 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: container_registry_001_validation
|
||||
displayName: Deploy Container Registry 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/ContainerRegistry/deploy.containerRegistry.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/ContainerRegistry/params.containerRegistry001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Machine Learning 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_001_validation
|
||||
displayName: Deploy Machine Learning 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearning/deploy.machineLearning.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearning/params.machineLearning001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Machine Learning Cluster 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_cluster_001_validation
|
||||
displayName: Deploy Machine Learning Cluster 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningCluster/deploy.machineLearningCluster.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningCluster/params.machineLearningCluster001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Machine Learning Compute Instance 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_compute_instance_001_validation
|
||||
displayName: Deploy Machine Learning Compute Instance 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningComputeInstance/deploy.machineLearningComputeInstance.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningComputeInstance/params.machineLearningComputeInstance001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Machine Learning AKS 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_aks_001_validation
|
||||
displayName: Deploy Machine Learning AKS 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningAks/deploy.machineLearningAks.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningAks/params.machineLearningAks001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Generate Password 001
|
||||
- task: PowerShell@2
|
||||
name: generate_password_001
|
||||
displayName: Generate Password 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(System.DefaultWorkingDirectory)/code/GeneratePassword.ps1'
|
||||
errorActionPreference: 'stop'
|
||||
failOnStderr: false
|
||||
ignoreLASTEXITCODE: false
|
||||
pwsh: true
|
||||
|
||||
# Deploy Synapse 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: synapse_001_validation
|
||||
displayName: Deploy Synapse 001 - validation
|
||||
enabled: false
|
||||
continueOnError: true
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Synapse/deploy.synapse.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Synapse/params.synapse001.json'
|
||||
deploymentMode: 'Validation'
|
||||
overrideParameters: >
|
||||
-synapseSqlAdministratorPassword "$(password)"
|
||||
|
||||
# Deploy SQL Pool 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: sql_pool_001_validation
|
||||
displayName: Deploy SQL Pool 001 - validation
|
||||
enabled: false
|
||||
continueOnError: true
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/SqlPool/deploy.sqlPool.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/SqlPool/params.sqlPool001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Big Data Pool 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: big_data_pool_001_validation
|
||||
displayName: Deploy Big Data Pool 001 - validation
|
||||
enabled: false
|
||||
continueOnError: true
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/BigDataPool/deploy.bigDataPool.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/BigDataPool/params.bigDataPool001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Machine Learning Synapse 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_synapse_001_validation
|
||||
displayName: Deploy Machine Learning Synapse 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningSynapse/deploy.machineLearningSynapse.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningSynapse/params.machineLearningSynapse001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Cognitive Services 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: cogitive_services_001_validation
|
||||
displayName: Deploy Cognitive Services 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/CognitiveServices/deploy.cognitiveService.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/CognitiveServices/params.cognitiveService001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Search 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: search_001_validation
|
||||
displayName: Deploy Search 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Search/deploy.search.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Search/params.search001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
# Deploy Data Factory 001 - validation
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: data_factory_001_validation
|
||||
displayName: Deploy data factory 001 - validation
|
||||
displayName: Deploy Data Factory 001 - validation
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -107,10 +351,10 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/DataFactory/deploy.dataFactory.json'
|
||||
csmParametersFile: 'infra/DataFactory/params.dataFactory001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/DataFactory/deploy.dataFactory.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/DataFactory/params.dataFactory001.json'
|
||||
deploymentMode: 'Validation'
|
||||
|
||||
|
||||
- stage: Deployment
|
||||
displayName: 'Deployment of ARM templates'
|
||||
dependsOn: Validation
|
||||
|
@ -133,10 +377,10 @@ stages:
|
|||
continueOnError: false
|
||||
enabled: true
|
||||
|
||||
# Deploy key vault 001
|
||||
# Deploy Key Vault 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: key_vault_001_deployment
|
||||
displayName: Deploy key vault 001
|
||||
displayName: Deploy Key Vault 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -147,14 +391,32 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: 'infra/KeyVault/params.keyVault001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/params.keyVault001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy storage account 001
|
||||
# Deploy Key Vault 002
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: key_vault_002_deployment
|
||||
displayName: Deploy Key Vault 002
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/deploy.keyVault.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/KeyVault/params.keyVault002.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Storage Account 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: storage_account_001_deployment
|
||||
displayName: Deploy storage account 001
|
||||
displayName: Deploy Storage Account 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -165,14 +427,14 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/Storage/deploy.storage.json'
|
||||
csmParametersFile: 'infra/Storage/params.storage001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Storage/deploy.storage.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Storage/params.storage001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy ml workspace 001
|
||||
# Deploy Application Insights 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: ml_workspace_001_deployment
|
||||
displayName: Deploy ml workspace 001
|
||||
name: application_insights_001_deployment
|
||||
displayName: Deploy Application Insights 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -183,14 +445,14 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/MachineLearning/deploy.mlWorkspace.json'
|
||||
csmParametersFile: 'infra/MachineLearning/params.mlWorkspace001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/ApplicationInsights/deploy.applicationInsights.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/ApplicationInsights/params.applicationInsights001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy data factory 001
|
||||
# Deploy Container Registry 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: data_factory_001_deployment
|
||||
displayName: Deploy data factory 001
|
||||
name: container_registry_001_deployment
|
||||
displayName: Deploy Container Registry 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
|
@ -201,6 +463,220 @@ stages:
|
|||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: 'infra/DataFactory/deploy.dataFactory.json'
|
||||
csmParametersFile: 'infra/DataFactory/params.dataFactory001.json'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/ContainerRegistry/deploy.containerRegistry.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/ContainerRegistry/params.containerRegistry001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Machine Learning 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_001_deployment
|
||||
displayName: Deploy Machine Learning 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearning/deploy.machineLearning.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearning/params.machineLearning001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Machine Learning Cluster 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_cluster_001_deployment
|
||||
displayName: Deploy Machine Learning Cluster 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningCluster/deploy.machineLearningCluster.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningCluster/params.machineLearningCluster001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Machine Learning Compute Instance 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_compute_instance_001_deployment
|
||||
displayName: Deploy Machine Learning Compute Instance 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningComputeInstance/deploy.machineLearningComputeInstance.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningComputeInstance/params.machineLearningComputeInstance001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# # Deploy Machine Learning AKS 001
|
||||
# - task: AzureResourceManagerTemplateDeployment@3
|
||||
# name: machine_learning_aks_001_deployment
|
||||
# displayName: Deploy Machine Learning AKS 001
|
||||
# enabled: true
|
||||
# continueOnError: false
|
||||
# inputs:
|
||||
# deploymentScope: 'Resource Group'
|
||||
# azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
# subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
# action: 'Create Or Update Resource Group'
|
||||
# resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
# location: '$(AZURE_LOCATION)'
|
||||
# templateLocation: 'Linked artifact'
|
||||
# csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningAks/deploy.machineLearningAks.json'
|
||||
# csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningAks/params.machineLearningAks001.json'
|
||||
# deploymentMode: 'Incremental'
|
||||
|
||||
# Generate Password 001
|
||||
- task: PowerShell@2
|
||||
name: generate_password_001
|
||||
displayName: Generate Password 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(System.DefaultWorkingDirectory)/code/GeneratePassword.ps1'
|
||||
errorActionPreference: 'stop'
|
||||
failOnStderr: false
|
||||
ignoreLASTEXITCODE: false
|
||||
pwsh: true
|
||||
|
||||
# Deploy Synapse 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: synapse_001_deployment
|
||||
displayName: Deploy Synapse 001
|
||||
enabled: false
|
||||
continueOnError: true
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Synapse/deploy.synapse.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Synapse/params.synapse001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
overrideParameters: >
|
||||
-synapseSqlAdministratorPassword "$(password)"
|
||||
|
||||
# # Deploy SQL Pool 001
|
||||
# - task: AzureResourceManagerTemplateDeployment@3
|
||||
# name: sql_pool_001_deployment
|
||||
# displayName: Deploy SQL Pool 001
|
||||
# enabled: false
|
||||
# continueOnError: true
|
||||
# inputs:
|
||||
# deploymentScope: 'Resource Group'
|
||||
# azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
# subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
# action: 'Create Or Update Resource Group'
|
||||
# resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
# location: '$(AZURE_LOCATION)'
|
||||
# templateLocation: 'Linked artifact'
|
||||
# csmFile: '$(System.DefaultWorkingDirectory)/infra/SqlPool/deploy.sqlPool.json'
|
||||
# csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/SqlPool/params.sqlPool001.json'
|
||||
# deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Big Data Pool 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: big_data_pool_001_deployment
|
||||
displayName: Deploy Big Data Pool 001
|
||||
enabled: false
|
||||
continueOnError: true
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/BigDataPool/deploy.bigDataPool.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/BigDataPool/params.bigDataPool001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Machine Learning Synapse 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: machine_learning_synapse_001_deployment
|
||||
displayName: Deploy Machine Learning Synapse 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningSynapse/deploy.machineLearningSynapse.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/MachineLearningSynapse/params.machineLearningSynapse001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Cognitive Services 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: cogitive_services_001_deployment
|
||||
displayName: Deploy Cognitive Services 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/CognitiveServices/deploy.cognitiveService.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/CognitiveServices/params.cognitiveService001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# Deploy Search 001
|
||||
- task: AzureResourceManagerTemplateDeployment@3
|
||||
name: search_001_deployment
|
||||
displayName: Deploy Search 001
|
||||
enabled: true
|
||||
continueOnError: false
|
||||
inputs:
|
||||
deploymentScope: 'Resource Group'
|
||||
azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
action: 'Create Or Update Resource Group'
|
||||
resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
location: '$(AZURE_LOCATION)'
|
||||
templateLocation: 'Linked artifact'
|
||||
csmFile: '$(System.DefaultWorkingDirectory)/infra/Search/deploy.search.json'
|
||||
csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/Search/params.search001.json'
|
||||
deploymentMode: 'Incremental'
|
||||
|
||||
# # Deploy Data Factory 001
|
||||
# - task: AzureResourceManagerTemplateDeployment@3
|
||||
# name: data_factory_001_deployment
|
||||
# displayName: Deploy Data Factory 001
|
||||
# enabled: true
|
||||
# continueOnError: false
|
||||
# inputs:
|
||||
# deploymentScope: 'Resource Group'
|
||||
# azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)'
|
||||
# subscriptionId: '$(AZURE_SUBSCRIPTION_ID)'
|
||||
# action: 'Create Or Update Resource Group'
|
||||
# resourceGroupName: '$(AZURE_RESOURCE_GROUP_NAME)'
|
||||
# location: '$(AZURE_LOCATION)'
|
||||
# templateLocation: 'Linked artifact'
|
||||
# csmFile: '$(System.DefaultWorkingDirectory)/infra/DataFactory/deploy.dataFactory.json'
|
||||
# csmParametersFile: '$(System.DefaultWorkingDirectory)/infra/DataFactory/params.dataFactory001.json'
|
||||
# deploymentMode: 'Incremental'
|
||||
|
|
|
@ -4,10 +4,22 @@ on:
|
|||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'infra/Storage/**'
|
||||
- 'infra/ApplicationInsights/**'
|
||||
- 'infra/BigDataPool/**'
|
||||
- 'infra/CognitiveServices/**'
|
||||
- 'infra/ContainerRegistry/**'
|
||||
- 'infra/DataFactory/**'
|
||||
- 'infra/KeyVault/**'
|
||||
- 'infra/LogicApps/**'
|
||||
- 'infra/MachineLearning/**'
|
||||
- 'infra/PrivateEndpoint/**'
|
||||
- 'infra/MachineLearningAks/**'
|
||||
- 'infra/MachineLearningCluster/**'
|
||||
- 'infra/MachineLearningComputeInstance/**'
|
||||
- 'infra/MachineLearningSynapse/**'
|
||||
- 'infra/Search/**'
|
||||
- 'infra/SqlPool/**'
|
||||
- 'infra/Storage/**'
|
||||
- 'infra/Synapse/**'
|
||||
- '.github/workflows/dataProductDeployment.yml'
|
||||
|
||||
env:
|
||||
|
@ -62,57 +74,220 @@ jobs:
|
|||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
# Deploy key vault 001 - validation
|
||||
- name: Deploy key vault 001 - validation
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Key Vault 001 - validation
|
||||
- name: Deploy Key Vault 001 - validation
|
||||
id: key_vault_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group validate \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/KeyVault/deploy.keyVault.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/KeyVault/params.keyVault001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/KeyVault/deploy.keyVault.json
|
||||
parameters: ${{ github.workspace }}/infra/KeyVault/params.keyVault001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy storage account 001 - validation
|
||||
- name: Deploy storage account 001 - validation
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Key Vault 002 - validation
|
||||
- name: Deploy Key Vault 002 - validation
|
||||
id: key_vault_002_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group validate \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/Storage/deploy.storage.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/Storage/params.storage001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/KeyVault/deploy.keyVault.json
|
||||
parameters: ${{ github.workspace }}/infra/KeyVault/params.keyVault002.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy ml workspace 001 - validation
|
||||
- name: Deploy ml workspace 001 - validation
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Storage Account 001 - validation
|
||||
- name: Deploy Storage Account 001 - validation
|
||||
id: storage_account_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group validate \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/MachineLearning/deploy.mlWorkspace.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/MachineLearning/params.mlWorkspace001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Storage/deploy.storage.json
|
||||
parameters: ${{ github.workspace }}/infra/Storage/params.storage001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy data factory 001 - validation
|
||||
- name: Deploy data factory 001 - validation
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Application Insights 001 - validation
|
||||
- name: Deploy Application Insights 001 - validation
|
||||
id: application_insights_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group validate \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/DataFactory/deploy.dataFactory.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/DataFactory/params.dataFactory001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/ApplicationInsights/deploy.applicationInsights.json
|
||||
parameters: ${{ github.workspace }}/infra/ApplicationInsights/params.applicationInsights001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Container Registry 001 - validation
|
||||
- name: Deploy Container Registry 001 - validation
|
||||
id: container_registry_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/ContainerRegistry/deploy.containerRegistry.json
|
||||
parameters: ${{ github.workspace }}/infra/ContainerRegistry/params.containerRegistry001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Machine Learning 001 - validation
|
||||
- name: Deploy Machine Learning 001 - validation
|
||||
id: machine_learning_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearning/deploy.machineLearning.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearning/params.machineLearning001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Machine Learning Cluster 001 - validation
|
||||
- name: Deploy Machine Learning Cluster 001 - validation
|
||||
id: machine_learning_cluster_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningCluster/deploy.machineLearningCluster.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningCluster/params.machineLearningCluster001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Machine Learning Compute Instance 001 - validation
|
||||
- name: Deploy Machine Learning Compute Instance 001 - validation
|
||||
id: machine_learning_compute_instance_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningComputeInstance/deploy.machineLearningComputeInstance.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningComputeInstance/params.machineLearningComputeInstance001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Machine Learning AKS 001 - validation
|
||||
- name: Deploy Machine Learning AKS 001 - validation
|
||||
id: machine_learning_aks_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningAks/deploy.machineLearningAks.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningAks/params.machineLearningAks001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Generate Password 001
|
||||
- name: Generate Password 001
|
||||
id: generate_password_001
|
||||
run: |
|
||||
echo "Generating Password"
|
||||
pwsh $GITHUB_WORKSPACE/code/GeneratePassword.ps1 -GitHub
|
||||
|
||||
# Deploy Synapse 001 - validation
|
||||
- name: Deploy Synapse 001 - validation
|
||||
id: synapse_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Synapse/deploy.synapse.json
|
||||
parameters: ${{ github.workspace }}/infra/Synapse/params.synapse001.json synapseSqlAdministratorPassword="${{ steps.generate_password_001.outputs.password }}"
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Sql Pool 001 - validation
|
||||
- name: Deploy Sql Pool 001 - validation
|
||||
id: sql_pool_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/SqlPool/deploy.sqlPool.json
|
||||
parameters: ${{ github.workspace }}/infra/SqlPool/params.sqlPool001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Big Data Pool 001 - validation
|
||||
- name: Deploy Big Data Pool 001 - validation
|
||||
id: big_data_pool_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/BigDataPool/deploy.bigDataPool.json
|
||||
parameters: ${{ github.workspace }}/infra/BigDataPool/params.bigDataPool001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Machine Learning Synapse 001 - validation
|
||||
- name: Deploy Machine Learning Synapse 001 - validation
|
||||
id: machine_learning_synapse_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningSynapse/deploy.machineLearningSynapse.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningSynapse/params.machineLearningSynapse001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Cognitive Services 001 - validation
|
||||
- name: Deploy Cognitive Services 001 - validation
|
||||
id: cogitive_services_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/CognitiveServices/deploy.cognitiveService.json
|
||||
parameters: ${{ github.workspace }}/infra/CognitiveServices/params.cognitiveService.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Search 001 - validation
|
||||
- name: Deploy Search 001 - validation
|
||||
id: search_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Search/deploy.search.json
|
||||
parameters: ${{ github.workspace }}/infra/Search/params.search001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Deploy Data Factory 001 - validation
|
||||
- name: Deploy Data Factory 001 - validation
|
||||
id: data_factory_001_validation
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/DataFactory/deploy.dataFactory.json
|
||||
parameters: ${{ github.workspace }}/infra/DataFactory/params.dataFactory001.json
|
||||
deploymentMode: Validate
|
||||
|
||||
# Log out from Azure
|
||||
- name: Log out from Azure
|
||||
|
@ -140,57 +315,220 @@ jobs:
|
|||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
# Deploy key vault 001
|
||||
- name: Deploy key vault 001
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Key Vault 001
|
||||
- name: Deploy Key Vault 001
|
||||
id: key_vault_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group create \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/KeyVault/deploy.keyVault.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/KeyVault/params.keyVault001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/KeyVault/deploy.keyVault.json
|
||||
parameters: ${{ github.workspace }}/infra/KeyVault/params.keyVault001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy storage account 001
|
||||
- name: Deploy storage account 001
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Key Vault 002
|
||||
- name: Deploy Key Vault 002
|
||||
id: key_vault_002_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group create \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/Storage/deploy.storage.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/Storage/params.storage001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/KeyVault/deploy.keyVault.json
|
||||
parameters: ${{ github.workspace }}/infra/KeyVault/params.keyVault002.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy ml workspace 001
|
||||
- name: Deploy ml workspace 001
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Storage Account 001
|
||||
- name: Deploy Storage Account 001
|
||||
id: storage_account_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group create \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/MachineLearning/deploy.mlWorkspace.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/MachineLearning/params.mlWorkspace001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Storage/deploy.storage.json
|
||||
parameters: ${{ github.workspace }}/infra/Storage/params.storage001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy data factory 001
|
||||
- name: Deploy data factory 001
|
||||
uses: azure/CLI@v1
|
||||
# Deploy Application Insights 001
|
||||
- name: Deploy Application Insights 001
|
||||
id: application_insights_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
echo "Creating deployment in resource group"
|
||||
az deployment group create \
|
||||
--mode Incremental \
|
||||
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
|
||||
--template-file $GITHUB_WORKSPACE/infra/DataFactory/deploy.dataFactory.json \
|
||||
--parameters $GITHUB_WORKSPACE/infra/DataFactory/params.dataFactory001.json
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/ApplicationInsights/deploy.applicationInsights.json
|
||||
parameters: ${{ github.workspace }}/infra/ApplicationInsights/params.applicationInsights001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Container Registry 001
|
||||
- name: Deploy Container Registry 001
|
||||
id: container_registry_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/ContainerRegistry/deploy.containerRegistry.json
|
||||
parameters: ${{ github.workspace }}/infra/ContainerRegistry/params.containerRegistry001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Machine Learning 001
|
||||
- name: Deploy Machine Learning 001
|
||||
id: machine_learning_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearning/deploy.machineLearning.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearning/params.machineLearning001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Machine Learning Cluster 001
|
||||
- name: Deploy Machine Learning Cluster 001
|
||||
id: machine_learning_cluster_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningCluster/deploy.machineLearningCluster.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningCluster/params.machineLearningCluster001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Machine Learning Compute Instance 001
|
||||
- name: Deploy Machine Learning Compute Instance 001
|
||||
id: machine_learning_compute_instance_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningComputeInstance/deploy.machineLearningComputeInstance.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningComputeInstance/params.machineLearningComputeInstance001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# # Deploy Machine Learning AKS 001
|
||||
# - name: Deploy Machine Learning AKS 001
|
||||
# id: machine_learning_aks_001_deployment
|
||||
# uses: azure/arm-deploy@v1
|
||||
# with:
|
||||
# scope: resourcegroup
|
||||
# subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
# resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
# region: ${{ env.AZURE_LOCATION }}
|
||||
# template: ${{ github.workspace }}/infra/MachineLearningAks/deploy.machineLearningAks.json
|
||||
# parameters: ${{ github.workspace }}/infra/MachineLearningAks/params.machineLearningAks001.json
|
||||
# deploymentMode: Incremental
|
||||
|
||||
# Generate Password 001
|
||||
- name: Generate Password 001
|
||||
id: generate_password_001
|
||||
run: |
|
||||
echo "Generating Password"
|
||||
pwsh $GITHUB_WORKSPACE/code/GeneratePassword.ps1 -GitHub
|
||||
|
||||
# Deploy Synapse 001
|
||||
- name: Deploy Synapse 001
|
||||
id: synapse_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Synapse/deploy.synapse.json
|
||||
parameters: ${{ github.workspace }}/infra/Synapse/params.synapse001.json synapseSqlAdministratorPassword="${{ steps.generate_password_001.outputs.password }}"
|
||||
deploymentMode: Incremental
|
||||
|
||||
# # Deploy Sql Pool 001
|
||||
# - name: Deploy Sql Pool 001
|
||||
# id: sql_pool_001_deployment
|
||||
# uses: azure/arm-deploy@v1
|
||||
# with:
|
||||
# scope: resourcegroup
|
||||
# subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
# resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
# region: ${{ env.AZURE_LOCATION }}
|
||||
# template: ${{ github.workspace }}/infra/SqlPool/deploy.sqlPool.json
|
||||
# parameters: ${{ github.workspace }}/infra/SqlPool/params.sqlPool001.json
|
||||
# deploymentMode: Incremental
|
||||
|
||||
# Deploy Big Data Pool 001
|
||||
- name: Deploy Big Data Pool 001
|
||||
id: big_data_pool_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/BigDataPool/deploy.bigDataPool.json
|
||||
parameters: ${{ github.workspace }}/infra/BigDataPool/params.bigDataPool001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Machine Learning Synapse 001
|
||||
- name: Deploy Machine Learning Synapse 001
|
||||
id: machine_learning_synapse_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/MachineLearningSynapse/deploy.machineLearningSynapse.json
|
||||
parameters: ${{ github.workspace }}/infra/MachineLearningSynapse/params.machineLearningSynapse001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Cognitive Services 001
|
||||
- name: Deploy Cognitive Services 001
|
||||
id: cogitive_services_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/CognitiveServices/deploy.cognitiveService.json
|
||||
parameters: ${{ github.workspace }}/infra/CognitiveServices/params.cognitiveService.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# Deploy Search 001
|
||||
- name: Deploy Search 001
|
||||
id: search_001_deployment
|
||||
uses: azure/arm-deploy@v1
|
||||
with:
|
||||
scope: resourcegroup
|
||||
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
region: ${{ env.AZURE_LOCATION }}
|
||||
template: ${{ github.workspace }}/infra/Search/deploy.search.json
|
||||
parameters: ${{ github.workspace }}/infra/Search/params.search001.json
|
||||
deploymentMode: Incremental
|
||||
|
||||
# # Deploy Data Factory 001
|
||||
# - name: Deploy Data Factory 001
|
||||
# id: data_factory_001_deployment
|
||||
# uses: azure/arm-deploy@v1
|
||||
# with:
|
||||
# scope: resourcegroup
|
||||
# subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
|
||||
# resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP_NAME }}
|
||||
# region: ${{ env.AZURE_LOCATION }}
|
||||
# template: ${{ github.workspace }}/infra/DataFactory/deploy.dataFactory.json
|
||||
# parameters: ${{ github.workspace }}/infra/DataFactory/params.dataFactory001.json
|
||||
# deploymentMode: Incremental
|
||||
|
||||
# Log out from Azure
|
||||
- name: Log out from Azure
|
||||
|
|
|
@ -0,0 +1,205 @@
|
|||
# Define script arguments
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Switch]
|
||||
$GitHub
|
||||
)
|
||||
|
||||
function New-Password {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generate pseudo-random passwords based on templates
|
||||
|
||||
.PARAMETER Template
|
||||
The template for the password you want to generate. (Defaults to a totally random 16-20 character password)
|
||||
|
||||
This defines which types of characters are generated for each character in the password.
|
||||
IMPORTANT: the US English alphabet is hardcoded ... (we make no apologies, but thought you should know that)
|
||||
|
||||
NOTE: The template has changed somewhat from v1 (to more closely resemble the pattern used by KeePass)
|
||||
|
||||
Char | Type | Actual character set
|
||||
-----|-----------------------------|---------------------
|
||||
a | Lower-Case Alphanumeric | abcdefghijklmnopqrstuvwxyz 0123456789
|
||||
A | Mixed-Case Alphanumeric | ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
|
||||
U | Upper-Case Alphanumeric | ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
|
||||
d | Digit | 0123456789
|
||||
h | Lower-Case Hex Character | 0123456789 abcdef
|
||||
H | Upper-Case Hex Character | 0123456789 ABCDEF
|
||||
l | Lower-Case Letter | abcdefghijklmnopqrstuvwxyz
|
||||
L | Mixed-Case Letter | ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
|
||||
u | Upper-Case Letter | ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
v | Lower-Case Vowel | aeiou
|
||||
V | Mixed-Case Vowel | AEIOU aeiou
|
||||
Z | Upper-Case Vowel | AEIOU
|
||||
c | Lower-Case Consonant | bcdfghjklmnpqrstvwxyz
|
||||
C | Mixed-Case Consonant | BCDFGHJKLMNPQRSTVWXYZ bcdfghjklmnpqrstvwxyz
|
||||
z | Upper-Case Consonant | BCDFGHJKLMNPQRSTVWXYZ
|
||||
p | Punctuation | ,.;:
|
||||
b | Bracket | ()[]{}<>
|
||||
s | Printable 7-Bit Punctuation | !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
||||
S | Printable 7-Bit ASCII | A-Z, a-z, 0-9, !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
||||
|
||||
\ | Escape (Fixed Char) | Use following character as is.
|
||||
0-9 | Repeat | Repeat the previous character n times.
|
||||
|
||||
Using a number, you can define how many times the previous placeholder should occur:
|
||||
* d4 is equivalent to dddd
|
||||
* dH4a is equivalent to dHHHHa
|
||||
* Hda1dH is equivalent to HdadH
|
||||
* S16 is equivalent to SSSSSSSSSSSSSSSS (this is the default password pattern)
|
||||
|
||||
To define custom character sets, you pass a hashtable to -CustomCharacterSets which maps one character to an array of characters, then you can use that character in your template.
|
||||
Note you cannot overwrite characters that are already in the character map (as listed above).
|
||||
|
||||
.PARAMETER CustomCharacterSet
|
||||
A hashtable mapping single characters to an array of characters for a custom character set.
|
||||
|
||||
For example, to use numbers without zero or 1 (avoiding confusion with the letters O and L), you can define:
|
||||
|
||||
-CustomCharacterSet @{ n = "23456789" }
|
||||
|
||||
.EXAMPLE
|
||||
New-Password "zvcvcdd"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Generates a "pronounceable" 7 character password consisting of alternating consonants and vowels followed by a 2-digit number
|
||||
|
||||
.EXAMPLE
|
||||
New-Password A16
|
||||
|
||||
Description
|
||||
-----------
|
||||
Generates a 16 character alpha-numeric password
|
||||
|
||||
.EXAMPLE
|
||||
-split "Cvcvcdd " * 8 | New-Password
|
||||
|
||||
Description
|
||||
-----------
|
||||
Demonstrates that the function can take pipeline input. Passing multiple templates via the pipeline will generate multiple passwords.
|
||||
In this case, we generate EIGHT "pronounceable" 7 character password consisting of alternating consonants and vowels followed by a 2-digit number
|
||||
|
||||
.EXAMPLE
|
||||
New-Password "zvvcpzvvcdd"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Generates a password which starts with an upper-case consonant, followed by two lower-case vowels, followed by a punctuation mark, followed by an upper-case consonant, followed by two lower-case vowels, followed by two numbers.
|
||||
|
||||
|
||||
.EXAMPLE
|
||||
New-Password "Get-zvcvvc"
|
||||
|
||||
Description
|
||||
-----------
|
||||
Generates a password which looks like a strange PowerShell command, starting with "Get-" and ending with an uppercase consonant, a vowel, a consonant, two vowels, and a final consonant.
|
||||
|
||||
.INPUTS
|
||||
[String]
|
||||
A string template for a password
|
||||
|
||||
.OUTPUTS
|
||||
[SecureString]
|
||||
A password, as secure as we can make it
|
||||
|
||||
.NOTES
|
||||
HISTORY
|
||||
2.0 Change random number generator
|
||||
Return a SecureString
|
||||
1.1 Bugfix for the \ escape character
|
||||
+ added a hex option (H for upper) and (h for lower)
|
||||
+ changed the '#' to 'd' for digits so you can write the patterns without quotes.
|
||||
1.0 First release
|
||||
#>
|
||||
[OutputType([SecureString])]
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(ValueFromPipeline = $true, Position = 0)]
|
||||
[string]$Template = "A16",
|
||||
|
||||
[hashtable]$CustomCharacterSet = @{}
|
||||
)
|
||||
begin {
|
||||
$CharacterSets = [System.Collections.Generic.Dictionary[char, char[]]]::new()
|
||||
@{
|
||||
[char]'a' = [char[]]"abcdefghijklmnopqrstuvwxyz0123456789"
|
||||
[char]'A' = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||
[char]'U' = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
[char]'d' = [char[]]"0123456789"
|
||||
[char]'h' = [char[]]"0123456789abcdef"
|
||||
[char]'H' = [char[]]"0123456789ABCDEF"
|
||||
[char]'l' = [char[]]"abcdefghijklmnopqrstuvwxyz"
|
||||
[char]'L' = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
||||
[char]'u' = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
[char]'v' = [char[]]"aeiou"
|
||||
[char]'V' = [char[]]"AEIOUaeiou"
|
||||
[char]'Z' = [char[]]"AEIOU"
|
||||
[char]'c' = [char[]]"bcdfghjklmnpqrstvwxyz"
|
||||
[char]'C' = [char[]]"BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"
|
||||
[char]'z' = [char[]]"BCDFGHJKLMNPQRSTVWXYZ"
|
||||
[char]'p' = [char[]]",.;:"
|
||||
[char]'b' = [char[]]"()[]<>"
|
||||
[char]'s' = [char[]]"!`#$%&()*+,-./:;<=>?@[\]^_``|~"
|
||||
[char]'S' = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!`#$%&()*+,-./:;<=>?@[\]^_``|~"
|
||||
}.GetEnumerator().ForEach{ $CharacterSets.Add($_.Key, $_.Value) }
|
||||
|
||||
$CustomCharacterSet.GetEnumerator().ForEach{ $CharacterSets.Add($_.Key, $_.Value) }
|
||||
|
||||
# This returns a RNGCryptoServiceProvider
|
||||
$cryptoRNG = [System.Security.Cryptography.RandomNumberGenerator]::Create()
|
||||
}
|
||||
process {
|
||||
# Create the return object
|
||||
$securePassword = [System.Security.SecureString]::new()
|
||||
|
||||
# Expand the template
|
||||
$Template = [regex]::replace($Template, "(.)(\d+)", { param($match) $match.Groups[1].Value * [int]($match.Groups[2].Value) })
|
||||
|
||||
Write-Verbose "Template: $Template"
|
||||
|
||||
$b = [byte[]]0
|
||||
for ($c = 0; $c -lt $Template.Length; $c++) {
|
||||
$securePassword.AppendChar($(
|
||||
if ($Template[$c] -eq '\') {
|
||||
$Template[(++$c)]
|
||||
}
|
||||
else {
|
||||
$cryptoRNG.GetBytes($b)
|
||||
$char = $Template[$c]
|
||||
if ($Set = $CharacterSets[$char]) {
|
||||
$Index = [int]$b[0] % $Set.Length
|
||||
$Set[$Index]
|
||||
}
|
||||
else {
|
||||
$char
|
||||
}
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
return $securePassword
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Generate password
|
||||
Write-Output "Generating password"
|
||||
$Password = New-Password -Template "lusdA16dlu" | ConvertFrom-SecureString -AsPlainText
|
||||
|
||||
if ($GitHub) {
|
||||
# Mask password
|
||||
Write-Output "Masking password"
|
||||
Write-Output "::add-mask::$Password"
|
||||
|
||||
# Set output
|
||||
Write-Output "Setting output"
|
||||
Write-Output "::set-output name=password::$Password"
|
||||
}
|
||||
else {
|
||||
# Set output
|
||||
Write-Output "Setting output"
|
||||
Write-Output "##vso[task.setvariable variable=password;issecret=true]$Password"
|
||||
}
|
Загрузка…
Ссылка в новой задаче