kromerm / adflab

Azure Data Factory hands-on lab, self-paced. Learn how to lift & shift SSIS packages to the Cloud with ADF. Build new ETL pipelines in ADF, transform data at scale, load Azure Data Warehouse data marts. Also walks through operationalizing ADF pipelines with scheduling and monitoring modules.
http://aka.ms/adflab2
137 stars 129 forks source link

PowerShell Lab deployment #21

Closed nShanmugaraj closed 6 years ago

nShanmugaraj commented 6 years ago

I am new to PowerShell scrips. In LAB 1 -Part 1 , i am unable to link to PowerShell Run Script and connect to my Azure Account. Getting the error `PS SQLSERVER:>

Prompt for Azure credentials

Login-AzureRmAccount Login-AzureRmAccount : The term 'Login-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:3 char:1

lnewportmsft commented 6 years ago

You need to install Azure PowerShell : https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-6.4.0

nShanmugaraj commented 6 years ago

Thanks for the quick response. Its working now.. connected to Azure portal Now i am executing LabDeploy.ps1 , got the below error

PS C:\Windows\system32> E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1 Lab deployment starting.... PackageManagement\Install-Package : The following commands are already available on this system:'Add-RoleMember,Add-SqlAvailabilityDa tabase,Add-SqlAvailabilityGroupListenerStaticIp,Add-SqlFirewallRule,Backup-ASDatabase,Backup-SqlDatabase,Convert-UrnToPath,Decode-Sql Name,Disable-SqlAlwaysOn,Enable-SqlAlwaysOn,Encode-SqlName,Get-SqlCredential,Get-SqlDatabase,Get-SqlInstance,Get-SqlSmartAdmin,Invoke -ASCmd,Invoke-PolicyEvaluation,Invoke-ProcessCube,Invoke-ProcessDimension,Invoke-ProcessPartition,Invoke-Sqlcmd,Join-SqlAvailabilityG roup,Merge-Partition,New-RestoreFolder,New-RestoreLocation,New-SqlAvailabilityGroup,New-SqlAvailabilityGroupListener,New-SqlAvailabil ityReplica,New-SqlBackupEncryptionOption,New-SqlCredential,New-SqlHADREndpoint,Remove-RoleMember,Remove-SqlAvailabilityDatabase,Remov e-SqlAvailabilityGroup,Remove-SqlAvailabilityReplica,Remove-SqlCredential,Remove-SqlFirewallRule,Restore-ASDatabase,Restore-SqlDataba se,Resume-SqlAvailabilityDatabase,Set-SqlAuthenticationMode,Set-SqlAvailabilityGroup,Set-SqlAvailabilityGroupListener,Set-SqlAvailabi lityReplica,Set-SqlCredential,Set-SqlHADREndpoint,Set-SqlNetworkConfiguration,Set-SqlSmartAdmin,Start-SqlInstance,Stop-SqlInstance,Su spend-SqlAvailabilityDatabase,Switch-SqlAvailabilityGroup,Test-SqlAvailabilityGroup,Test-SqlAvailabilityReplica,Test-SqlDatabaseRepli caState,Test-SqlSmartAdmin'. This module 'SqlServer' may override the existing commands. If you still want to install this module 'SqlServer', use -AllowClobber parameter. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21

lnewportmsft commented 6 years ago

You can add the -AllowClobber parameter to "Install-Module -Name SqlServer -Scope CurrentUser", or just comment it out with #

nShanmugaraj commented 6 years ago

Do you mean

Install SQL components

Install-Module -Name SqlServer -Scope CurrentUser -AllowClobber

Also can you let me know $sqlUsername = "labadmin" do i need to create any sql server related things in Azure. This is my new Azure Account , i dont have any apps installed till now

lnewportmsft commented 6 years ago

Yes.

No, the script creates objects for you after you fill in the parameters.

nShanmugaraj commented 6 years ago

Every time i execute , i am getting below message and an SQL is installed. can you give me the fix for this

Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y

nShanmugaraj commented 6 years ago

let me summarize the issues heading where i am struggling to do the powershell activity

  1. New-AzureStorageContainer : Container '' already exists.
  2. Set-AzureStorageBlobContent : Can not find the specified file
  3. New-AzureRmSqlDatabaseImport There was an error that occurred during this operation : AirlinePerformance-OLTP.bacpac is not readable
  4. The property 'OperationStatusLink' cannot be found on this object. Verify that the property exists.
  5. The variable '$importStatus' cannot be retrieved because it has not been set.
nShanmugaraj commented 6 years ago

Error 1 --------

adflabstoragetqoqa New-AzureStorageContainer : Container 'input' already exists. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:47 char:44

New-AzureStorageContainer : Container 'output' already exists. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:47 char:44

New-AzureStorageContainer : Container 'blobsource' already exists. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:47 char:44

New-AzureStorageContainer : Container 'backups' already exists. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:47 char:44

Error 2 -----------

Set-AzureStorageBlobContent : Can not find the specified file 'E:\Daywise content\Day4\ADFLab-Master\Deployment\Files\input\FAAMaster\FAAmaster.txt'. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:56 char:1

Error 3 -----------

               : FAAaircraft/FAAaircraft.txt

Set-AzureStorageBlobContent : Can not find the specified file 'E:\Daywise content\Day4\ADFLab-Master\Deployment\Files\backups\AirlinePerformance-OLTP.bacpac'. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:60 char:1

Error 3-A -----------

New-AzureRmSqlDatabaseImport : 0: There was an error that occurred during this operation : 'Error encountered during the service operation. ; Exception Microsoft.SqlServer.Management.Dac.Services.ServiceException:Blob http://adflabstoragetqoqa.blob.core.windows.net/backups/AirlinePerformance-OLTP.bacpac is not readable. ; ' At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:64 char:18

Error 4 -------

The property 'OperationStatusLink' cannot be found on this object. Verify that the property exists. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:102 char:1

**Error 5 ----------- OLTP DB Restoring... The variable '$importStatus' cannot be retrieved because it has not been set. At E:\Daywise content\Day4\adflab-master\Deployment\LabDeploy.ps1:104 char:8

joshuha commented 6 years ago
  1. Make sure you follow the instructions in Lab Module 1 for deploying the PowerShell script. It asks you to replace your subscription information and so on and some of the errors are the result of that.
  2. If you do encounter an error and then fix the issue, please delete the resource group it created in Azure before you restart. This will ensure a clean deployment. Thanks.
nShanmugaraj commented 6 years ago
  1. Done
  2. Have deleted , now scripts are re executed sucessfully