diff --git a/.ado/workflows/dataHubDeployment.yml b/.ado/workflows/dataHubDeployment.yml index f71e36c..5de727f 100644 --- a/.ado/workflows/dataHubDeployment.yml +++ b/.ado/workflows/dataHubDeployment.yml @@ -139,7 +139,7 @@ stages: displayName: 'Deployment of ARM templates' continueOnError: false pool: - vmImage: 'ubuntu-latest' + vmImage: 'vs2017-win2016' steps: # Checkout repository @@ -203,21 +203,6 @@ stages: storage: datahubstorage001 containerName: scripts - # Upload file to storage account 002 - - task: AzureFileCopy@3 - name: upload_file_002 - displayName: Upload file to storage account 002 - enabled: true - continueOnError: false - inputs: - sourcePath: 'infra/DnsForwarder/forwarderSetup.sh' - additionalArgumentsForBlobCopy: | - '/Y' - azureSubscription: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)' - destination: AzureBlob - storage: datahubstorage001 - containerName: scripts - # Deploy data factory 001 - task: AzureResourceManagerTemplateDeployment@3 name: data_factory_001_deployment diff --git a/.ado/workflows/networkDeployment.yml b/.ado/workflows/networkDeployment.yml index ed99d79..ce8748d 100644 --- a/.ado/workflows/networkDeployment.yml +++ b/.ado/workflows/networkDeployment.yml @@ -58,6 +58,25 @@ stages: csmParametersFile: 'infra/VirtualNetwork/params.vnet.json' deploymentMode: 'Validation' + # Deploy storage account 001 - validation + - task: AzureResourceManagerTemplateDeployment@3 + name: storage_account_001_validation + displayName: Deploy storage account 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_MANAGEMENT)' + location: '$(AZURE_LOCATION)' + templateLocation: 'Linked artifact' + csmFile: 'infra/Storage/deploy.storage.json' + csmParametersFile: 'infra/Storage/params.storage001.json' + deploymentMode: 'Validation' + + # Deploy firewall - validation - task: AzureResourceManagerTemplateDeployment@3 name: firewall_validation @@ -80,8 +99,8 @@ stages: - task: AzureResourceManagerTemplateDeployment@3 name: dns_forwarder_validation displayName: Deploy dns forwarder - validation - enabled: true - continueOnError: false + enabled: false + continueOnError: true inputs: deploymentScope: 'Resource Group' azureResourceManagerConnection: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)' @@ -337,7 +356,7 @@ stages: displayName: 'Deployment of ARM templates' continueOnError: false pool: - vmImage: 'ubuntu-latest' + vmImage: 'vs2017-win2016' steps: # Checkout repository @@ -368,6 +387,39 @@ stages: csmParametersFile: 'infra/VirtualNetwork/params.vnet.json' deploymentMode: 'Incremental' + # Deploy storage account 001 + - task: AzureResourceManagerTemplateDeployment@3 + name: storage_account_001_deployment + displayName: Deploy storage account 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_MANAGEMENT)' + location: '$(AZURE_LOCATION)' + templateLocation: 'Linked artifact' + csmFile: 'infra/Storage/deploy.storage.json' + csmParametersFile: 'infra/Storage/params.storage001.json' + deploymentMode: 'Incremental' + + # Upload file to storage account 001 + - task: AzureFileCopy@3 + name: upload_file_001 + displayName: Upload file to storage account 001 + enabled: true + continueOnError: false + inputs: + sourcePath: 'infra/DnsForwarder/forwarderSetup.sh' + additionalArgumentsForBlobCopy: | + '/Y' + azureSubscription: '$(AZURE_RESOURCE_MANAGER_CONNECTION_NAME)' + destination: AzureBlob + storage: datahubstorage001 + containerName: scripts + # Deploy firewall - task: AzureResourceManagerTemplateDeployment@3 name: firewall_deployment @@ -602,8 +654,6 @@ stages: csmParametersFile: 'infra/PrivateDns/params.privateDnsWebApps.json' deploymentMode: 'Incremental' - - # Deploy vnet peering 001 - task: AzureResourceManagerTemplateDeployment@3 name: vnet_peering_001_deployment diff --git a/.github/workflows/dataHubDeployment.yml b/.github/workflows/dataHubDeployment.yml index a48ec0e..811fe75 100644 --- a/.github/workflows/dataHubDeployment.yml +++ b/.github/workflows/dataHubDeployment.yml @@ -205,18 +205,6 @@ jobs: $ctx = $storageAccount.Context Set-AzStorageBlobContent -File "infra/SelfHostedIntegrationRuntime/gatewayInstall.ps1" -Container scripts -Blob "gatewayInstall.ps1" -Context $ctx -Force - # Upload file to storage account 002 - - name: Upload file to storage account 002 - id: upload_file_002 - uses: azure/powershell@v1 - with: - azPSVersion: latest - inlineScript: | - "Uploading file to storage account" - $storageAccount = Get-AzStorageAccount -ResourceGroupName "dh-mgmt" -Name "datahubstorage001" - $ctx = $storageAccount.Context - Set-AzStorageBlobContent -File "infra/SelfHostedIntegrationRuntime/gatewayInstall.ps1" -Container scripts -Blob "gatewayInstall.ps1" -Context $ctx -Force - # Deploy data factory 001 - name: Deploy data factory 001 id: data_factory_001_deployment diff --git a/.github/workflows/networkDeployment.yml b/.github/workflows/networkDeployment.yml index 67091e8..a9b29b8 100644 --- a/.github/workflows/networkDeployment.yml +++ b/.github/workflows/networkDeployment.yml @@ -90,6 +90,20 @@ jobs: --template-file $GITHUB_WORKSPACE/infra/VirtualNetwork/deploy.vnet.json \ --parameters $GITHUB_WORKSPACE/infra/VirtualNetwork/params.vnet.json + # Deploy storage account 001 - validation + - name: Deploy storage account 001 - validation + id: storage_001_validation + uses: azure/cli@v1 + with: + azcliversion: latest + inlineScript: | + echo "Creating deployment in resource group" + az deployment group validate \ + --mode Incremental \ + --resource-group ${{ env.AZURE_RESOURCE_GROUP_NAME_MANAGEMENT }} \ + --template-file $GITHUB_WORKSPACE/infra/Storage/deploy.storage.json \ + --parameters $GITHUB_WORKSPACE/infra/Storage/params.storage001.json + # Deploy firewall - validation - name: Deploy firewall - validation id: firewall_validation @@ -117,6 +131,7 @@ jobs: --resource-group ${{ env.AZURE_RESOURCE_GROUP_NAME_NETWORK }} \ --template-file $GITHUB_WORKSPACE/infra/DnsForwarder/deploy.dnsForwarder.json \ --parameters $GITHUB_WORKSPACE/infra/DnsForwarder/params.dnsForwarder001.json + continue-on-error: true # Deploy private DNS zone for data factory - validation - name: Deploy private DNS zone for data factory - validation @@ -327,6 +342,7 @@ jobs: uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} + enable-AzPSSession: true # Deploy vnet - name: Deploy vnet @@ -342,6 +358,32 @@ jobs: --template-file $GITHUB_WORKSPACE/infra/VirtualNetwork/deploy.vnet.json \ --parameters $GITHUB_WORKSPACE/infra/VirtualNetwork/params.vnet.json + # Deploy storage account 001 + - name: Deploy storage account 001 + id: storage_account_001_deployment + uses: azure/cli@v1 + with: + azcliversion: latest + inlineScript: | + echo "Creating deployment in resource group" + az deployment group create \ + --mode Incremental \ + --resource-group ${{ env.AZURE_RESOURCE_GROUP_NAME_MANAGEMENT }} \ + --template-file $GITHUB_WORKSPACE/infra/Storage/deploy.storage.json \ + --parameters $GITHUB_WORKSPACE/infra/Storage/params.storage001.json + + # Upload file to storage account 001 + - name: Upload file to storage account 001 + id: upload_file_001 + uses: azure/powershell@v1 + with: + azPSVersion: latest + inlineScript: | + "Uploading file to storage account" + $storageAccount = Get-AzStorageAccount -ResourceGroupName "dh-mgmt" -Name "datahubstorage001" + $ctx = $storageAccount.Context + Set-AzStorageBlobContent -File "infra/DnsForwarder/forwarderSetup.sh" -Container scripts -Blob "forwarderSetup.sh" -Context $ctx -Force + # Deploy firewall - name: Deploy firewall id: firewall_deployment diff --git a/infra/DnsForwarder/forwarderSetup.sh b/infra/DnsForwarder/forwarderSetup.sh index 66f7c87..fa6d520 100644 --- a/infra/DnsForwarder/forwarderSetup.sh +++ b/infra/DnsForwarder/forwarderSetup.sh @@ -43,7 +43,7 @@ server { } EOF -myip=`hostname -i` +myip=`hostname -i | awk '{print $1}'` sed -i "s/x.x.x.x/$myip/" /etc/nginx/nginx.conf