serving the solutions day and night

Pages

Sunday, August 16, 2020

ASP.NET Core Application with Docker

Create new ASP.NET Core MVC application through Visual Studio with Dockerfile.

OR Using Visual Studio Code, type "code .". Install the VSC extension named Docker by Microsoft, which help us to edit the Docker files.  

OR Create by .NET Core CLI

Create new folder c:\frontendmvc, use powershell to run the below commands

  • mkdir c:\frontendmvc
  • cd c:\frontendmvc
  • dotnet new mvc 
  • dotnet run

 


Saturday, August 15, 2020

.NET Core CLI Commands

  • dotnet new: Creates a new project from the specified template. If you want to create an MVC application, you can use dotnet new mvc
  • dotnet restore: Restores all the NuGet dependencies of our application. 
  • dotnet build: Builds our project. 
  • dotnet run: Executes our project. 
  • dotnet watch run: Runs our project and watches for file changes to rebuild and rerun it. 
  • dotnet publish: Creates a deployable build (the .dll) of our project. 
  • dotnet --list-sdks : look all net version in your computer

 


Wednesday, August 5, 2020

SQL Server Stretch Database

Stretch Database
Data can be split between on-premises and cloud storage. 

With Stretch Database, cold/audit data is kept in the cloud and data remains available for users to
query, might be a small amount of additional latency associated with queries. Data in the cloud is backed up automatically. 

With Stretch Database, active data is kept on-premises for maximum performance and reduce storage requirements both for data and backups (it run quicker than standard backups). 

It requires no changes to new or existing TSQL queries. 

Friday, May 15, 2020

PCF - CF SSH command connection error

PS C:\\doc> cf ssh makdns-blogger-api-demo

FAILED
Error opening SSH connection: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

Solution
PS C:\\doc>cf enable-ssh makdns-blogger-api-demo =>  "makdns-blogger-api-demo" application name
PS C:\\doc>cf space-ssh-allowed demo  => "demo" is space name
PS C:\\doc>cf ssh makdns-blogger-api-demo

Saturday, April 18, 2020

Azure SQL

Search Azure SQL
3 Options to Choose


Large Volume Data Migration to Azure using Azure Data Box

Migrating Large volume of data(like Terabytes or Petabytes) from on-premises to Azure using Azure Data Box.

Two types of data transfer options: Offline & Online

Offline - choose
1. More than 5 TB, no good bandwidth connectivity
2. Data can be upload to any one of storage: Block Blob, Page Blob, Managed Disk, File Storage
3. Four Data Box options available to choose 

Saturday, April 11, 2020

Docker Commands

Verify the application exist inside the windows container,  connect to the cmd of the "frontendapiwin" container using the docker exec command
1. C:\> docker exec -it 64a61d823b28  cmd
           - "64a61d823b28 " - docker container id
           - It should take us inside the container.
     Run the powershell inside the "frontendapiwin" the container 
     1.1 C:\inetpub\wwwroot> powershell 
            Using Powershell to manage application web configuration
           1.1.1 PS C:\inetpub\wwwroot> gc .\web.config   or  gc web.config 
                       - Gets the content (gc) of the item at the specified location (C:\inetpub\wwwroot\web.config)
         > [xml]$web = gc .\web.config
                         -  The [xml] casts the variable as an XML object.
                         - <?xml>
                            <configuration>
                                    <appsettings>
                                             <add key="DBCon" value="db value."/>
                                             ...
                                     </appsettings>
                                    ...
                             </configuration>
         > $web.configuration.appSettings.SelectNodes("add[@key='DBCon']")
                           - display DBCon key value
                           -  key                 value
                              -----                 -------
                               DBCon        db value.
         > $key=$web.configuration.appSettings.SelectNodes("add[@key='DBCon']")
                           - assign to key
         > $key
                           - another way display DBCon key value
         > $key.SetAttribute("value","db value changed.")
                           - change DBCon value
         > $web.save(".\web.config")
                           - save file
         > exit  => exit from powershell
           > exit  = exit from container

Sunday, February 2, 2020

ASP.NET CORE and Docker

Command to see the installed docker version

docker --version

Commands to list docker images  - display the repository name, a tag that usually specifies the repository version, image ID, creation date and size

Thursday, January 30, 2020

Add SQL Server 2017 Docker Container to ASP.NET Core MVC/Web API Project

SQL Server 2017 is available for both Windows and Linux Containers. 

            docker pull mcr.microsoft.com/mssql/server


  • Verify SQL Server 2017 image was successfully pulled locally using "docker images" cmd