Importing a BACPAC to SQL Server

We previously looked at Create a backup for Azure SQL Server and in today’s post we are going to address how to look at that data by restoring or importing it to a local SQL Server.

To start, open SQL Server Management Studio (SSMS) and connect to a local instance of SQL Server. Right-click on the instance name and select Import Data-tier Application.

AzureImportSQL1

Simply click Next to go back the welcome screen of the import wizard.

image

Click browse and locate the BACPAC file on your local computer. Click Next.

AzureImportSQL2

Alternately, change the radio button to Import from Windows Azure and click Connect. You will be prompted to enter your storage account name and access key and then locate the BACPAC in your storage account. This will be downloaded as part of the import process to a temporary directory that can also be specified in the wizard.

On the database settings page of the wizard the database name, data file storage path and log file storage paths can be modified. The default locations for the data and log files will be pulled from the model database. Click Next.

AzureImportSQL3

Click Finish on the Summary page to being the import.

AzureImportSQL4

Each step and the status of the operation will be displayed. Assuming all green check marks click Close on the wizard. If there are any errors click the link in the Result column to see the details behind the failure. There should also be a new database in the SQL Server object explorer carrying the same name specified on the Database Settings page of the import wizard.

AzureImportSQL5

This satisfies the full set of requirements given by the customer:

  • Full backup of the data, archived monthly for 10 years – this can be stored in Azure blob storage and/or downloaded and stored locally
  • Ability to restore the archive at any time – a BACPAC can be imported to Azure SQL Database or to a local SQL Server
  • Maintain data access should the customer decide to no longer leverage Azure SQL Database – BACPAC files can be imported to a local SQL Server instance

Create a backup for Azure SQL Database

Azure SQL Database is a managed database platform as a service (Paas) offering available from Microsoft in the Azure cloud. One of the advantages to Azure SQL Database is all the file management, server maintenance and backups are taken care of automatically. Point in time recovery is built directly into the service. The amount of time a user can go back and perform a point in time restore depends on the service tier selected.

Creating the BACPAC

To start, open a web browser and access the Azure portal (https://portal.azure.com). After signing in navigate to the SQL Databases section and select the database you want to archive.

AzureSql1

On the overview page click the Export button near the top of the page.

AzureSql2

On the resulting page name the BACPAC. Select the subscription and storage location where the BACPAC file will be saved. Enter the credentials that will be used to access the Azure SQL Server. Click OK at the bottom of the pane and the export process will begin in the background.

AzureSql3

If you don’t already have a storage, you can configure one. Go to All resources, Add a new resource and search for Storage account - blob, file, table, queue. Be careful: the name of the storage is lower case.

AzureSql4

Then in your new storage you have to create a container. You can create a container also in the Export process.

Under Activity log you can see the status of the export.

AzureSql5

When the process is finished, in your storage you have to file under Blobs, ready to download it.

This file is a zip file and contains the structure and data of your database. Now you can delete the storage on Azure (it costs money).

iPhone owners have less than two weeks to replace battery for £25

Why-Does-My-iPhone-Battery-Die-So-Fast-Heres-The-Real-Fix-828x466

Owners of iPhones with failing batteries have 12 days to take advantage of Apple’s out-of-warranty £25 battery swap offer before the price rises to as much as £65.

The discounted battery replacement scheme, which applies to the iPhone 6 and newer models, was launched following revelations last year that Apple was intentionally slowing iPhones because of worn batteries.

Apple apologised and reduced the cost of its out-of-warranty battery replacements for iPhone 6 and 6 Plus, 6S and 6S Plus, SE, 7 and 7 Plus, 8 and 8 Plus and iPhone X.

It also rolled out an iOS software update that showed the health of the phone’s battery and allowed users to switch off the feature that slowed their performance to avoid power problems.

If the iPhone reports that the battery is worn out or a user experiences slower performance because of an old battery, they can get it replaced in-store for £25 or via post for an additional £7.44 shipping fee.

But from 1 January, the cost of a battery replacement will increase to £45 for phones from the iPhone 6 or newer, or £65 for the iPhone X. The cost for older iPhones such as the 5S will be £79.

Battery replacements within the warranty period, or if the user has Apple’s extended warranty, AppleCare+, are free.

Microsoft officially announces 'Windows Sandbox' for running applications in isolation

Windows-Sandbox-Screenshot-open

Microsoft officially took the wraps off a feature expected to come to Windows 10 19H1 early next year that it has rechristened as "Windows Sandbox." This feature, which will be part of Windows 10 Pro and Enterprise editions, creates "an isolated, temporary desktop environment" where users can run potentially suspicious software, officials said in a blog post on December 18.

Earlier this year, Microsoft was rumored to be readying a new security feature for Windows 10 that was called, at that time, "InPrivate Desktop." InPrivate Desktop got a mention in Microsoft's Insider Feedback Hub during a bug-bash q1uest in August. The codename for InPrivate Desktop was "Madrid."

Quick start

  1. Install Windows 10 Pro or Enterprise, Insider build 18305 or newer
  2. Enable virtualization:
    • If you are using a physical machine, ensure virtualization capabilities are enabled in the BIOS.
    • If you are using a virtual machine, enable nested virtualization with this PowerShell cmdlet:
    • Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
  3. Open Windows Features, and then select Windows Sandbox. Select OK to install Windows Sandbox. You might be asked to restart the computer. Optional-Windows-Features-dlg
  4. Using the Start menu, find Windows Sandbox, run it and allow the elevation
  5. Copy an executable file from the host
  6. Paste the executable file in the window of Windows Sandbox (on the Windows desktop)
  7. Run the executable in the Windows Sandbox; if it is an installer go ahead and install it
  8. Run the application and use it as you normally do
  9. When you’re done experimenting, you can simply close the Windows Sandbox application. All sandbox content will be discarded and permanently deleted
  10. Confirm that the host does not have any of the modifications that you made in Windows Sandbox.

Enable Developer Options on Samsung Galaxy S9

The Developer Options has many useful features that certainly elevate the usability, and user experience of an Android phone. In this tutorial, we are going to learn how to activate/enable Developer Options on Samsung Galaxy S9, and how to use it effectively. All Samsung smartphones come with an option, but it usually it comes hidden within the operating system. But it doesn’t mean that you can’t access it. And importantly, that is not a tough task either. The method is almost same as we perform on other Samsung’s smartphones.

  1. Open the app menu, and then tap on Settings.
  2. Scroll to locate ‘Device information‘ and tap on it.
  3. Next, locate the ‘Software info‘ and tap on it.
  4. Under the hood of this menu, find the ‘Build number‘.
  5. Now tap 7 times on ‘Build number’. Each time you tap on ‘Build number’, it displays a screen with a message about remaining taps to become a developer.
  6. This will activate the Developer Options on your phone:galaxy-s9-developer-options

Now, the Developer Options will appear under Settings.

How to Automatically Backup Your Web Server Files With WinSCP over FTP

WinSCPYou’ve heard it time and time again: back up your data. There are plenty of backup solutions, but nothing is better than an easy and free solution. So with a few lines of code and a very helpful program called WinSCP, we’re going to set up an automatic sync between your FTP server and your home computer.

Requirements

  • An FTP server and access credentials
  • A Windows computer
  • A copy of WinSCP (Windows only)

Setting Up WinSCP

Once you've downloaded your copy of WinSCP, install it on your computer. It also wouldn't be a bad idea to start remembering your FTP address, username, and password while WinSCP is installing.

From the login screen, enter your host name (i.e. ftp.puresourcecode.com), username, and password. You can use either FTP or SFTP, but be sure to change the port number the appropriate port your FTP host has provided you. Then click Save to save the profile. Open the profile to log into your FTP server. This will verify that you typed the right credentials in the profile.

image

Create the script

We’re going to create a simple script that logs into your FTP server, tells WinSCP where to download the missing files to on your computer, and then creates a log file that records FTP activity. Go ahead and open Notepad on your computer. Copy the following script template into Notepad:

option batch on
option confirm off
open ftp.puresourcecode.com
cd backups
option transfer binary
get /testremote* f:\backups\testlocal*
synchronize local f:\backups\testlocal testremote
exit

WinSCP will answer all prompts negatively to avoid holding up the script. Then it will automatically overwrite files when prompted. It then logs into your FTP server using the profile we created earlier, changes directories (if needed), and transfers binary (as opposed to ASCII). Finally, it reads the remote FTP directory and transfers files to the specified local directory. For even more options, check out the official WinSCP scripting page.

Now before you modify or run this script, we suggest creating test directories on both the remote and local targets. The last thing you want is to accidentally wipe your FTP server without any backups. So create a directory on your computer called “testlocal” (we created it under f:\backups) and another called “testremote” on your FTP server (we created it at the root). Once you run the script and it executes successfully, save it as “sync.txt” to your computer (we saved ours in our testlocal folder).

Automating the script

Now you’re ready to automate the script. For this we can use Task Scheduler.

image

Click on Create Basic Task and follow the following screens. First insert a name for your task.

image

Select when you want to start the task.

image

Select Start a program in the next screen.

image

Now click on Browse... and find WinSCP executable file in your program folder.

image

Underneath, add

/console /script=f:\backup\sync.txt /log=f:\backup\log.txt 

to Add arguments. Be sure to change the arguments if your sync.txt is in a different location and if you want to generate the log file in a different location. Click Next.

So the task is created!

Microsoft’s new Office icons are part of a bigger design overhaul

office_icons_HD_00007

Microsoft is modernizing its Office icons as part of a broader focus on design for its various Office apps. It’s the first time the Office icons have changed in five years, and they’re designed to be more simple and modern to span across multiple devices and platforms. Office now exists on Windows, Mac, iOS, and Android, and Microsoft has been building a single core codebase to make rapid monthly improvements to the apps. These icons are designed to reflect how Office has changed recently, with new AI features, more collaborative features, and its platform independence for key apps like Word, Excel, PowerPoint, and Outlook.

The new icons deemphasize the letter for each Office app, but still manage to look familiar. “Our design solution was to de-couple the letter and the symbol from the icons, essentially creating two panels (one for the letter and one for the symbol) that we can pair or separate,” explains Jon Friedman, partner director of design at Microsoft. “This allows us to maintain familiarity while still emphasizing simplicity when inside the app.”

Google hints shutting down Google News over EU’s implementation of Article 11 or the “link tax”

458475271

Last week, The Guardian reported that Google may shut down Google News in Europe if the “link tax” is implemented in a way that the company has to pay news publishers. According to the “link tax” or Article 11, news publishers must receive a fair and proportionate remuneration for their publications by the information society service providers.

The vice president of Google News, Richard Gingras expressed his concern regarding the proposal and told The Guardian that the discontinuation of the news service in Europe will depend on the final verdict, “We can’t make a decision until we see the final language.”

The first draft of the “link tax”, or more formally, Directive on Copyright in the Digital Single Market was first issued in 2016. After several revisions and discussions, it was approved by the European Parliament on 12 September 2018. And, now a formal trilogue discussion with the European Commission, the Council of the European Union and the European Parliament is initiated to reach the final decision. The conclusion of this discussion is expected to be announced in January 2019.

Another part of the proposed directive, Article 13 is designed to ensure content creators are paid for material uploaded to sites such as the Google-owned YouTube. Article 11 and Article 13 have faced a lot of criticism since the directive was proposed. Mr. Gingras further said that when in 2014 the Spanish government attempted to charge a link tax on Google, the company responded by shutting down Google News in the country. It also removed Spanish newspapers from the service internationally. This resulted in a tremendous fall in traffic to Spanish news websites. “We would not like to see that happen in Europe,” Gingras added.

Julia Reda, an MEP, however, believes that this “link tax” will not be as extreme as the link tax implemented in Spain, where Google was required to pay publishers even if they didn’t want to be paid. “What we think is more likely is that publishers will have the choice to ask for Google to pay or not,” she told WIRED.

To know more in detail about Google’s response towards the link tax, read the full story on The Guardian.

Connect ASP.NET MVC 4.6.2 project to IdentityServer4

I have a website running on ASP.NET MVC 4.5.2. I have an IdentityServer4 server running but when I try and authenticate against it I get an:

invalid_request

I googled a bit but I can’t find a solution. Finally, I found the way.

First, in your IdentityServer4 you have to create a new client:

public static IEnumerable GetClients() {
    return new List<client> {
        new Client {
            ClientId = "yourid",
            AllowedScopes = new List<string> { "openid" },
            AllowedGrantTypes = GrantTypes.Hybrid,
            RedirectUris = new List { "http://yoururl/signin-oidc" },
        }
    }
}

When you added the new client, you can update your other MVC project. Under App_Start open Startup.Auth.cs and add this code:

using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.OpenIdConnect;
using Owin;

namespace PSC
{
    public partial class Startup
    {
        public void ConfigureAuth(IAppBuilder app)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = "Cookies"
            });

            app.UseOpenIdConnectAuthentication(
              new OpenIdConnectAuthenticationOptions
              {
                Authority = "https://yourIdentityServerUrl",
                ClientId = "yourid",
                ResponseType = "id_token code",
                SignInAsAuthenticationType = "Cookies",
                RedirectUri = "http://yoururl/signin-oidc",
                Scope = "openid",
              });
        }
    }
}

You have to add a Nuget package called Microsoft.Owin.Security.OpenIdConnect.

Happy coding!

Connect ASP.NET MVC 4.6.2 project to IdentityServer4

I have a website running on ASP.NET MVC 4.5.2. I have an IdentityServer4 server running but when I try and authenticate against it I get an:

invalid_request

I googled a bit but I can’t find a solution. Finally, I found the way.

First, in your IdentityServer4 you have to create a new client:

public static IEnumerable GetClients() {
    return new List<client> {
        new Client {
            ClientId = "yourid",
            AllowedScopes = new List<string> { "openid" },
            AllowedGrantTypes = GrantTypes.Hybrid,
            RedirectUris = new List { "http://yoururl/signin-oidc" },
        }
    }
}

When you added the new client, you can update your other MVC project. Under App_Start open Startup.Auth.cs and add this code:

using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.OpenIdConnect;
using Owin;

namespace PSC
{
    public partial class Startup
    {
        public void ConfigureAuth(IAppBuilder app)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = "Cookies"
            });

            app.UseOpenIdConnectAuthentication(
              new OpenIdConnectAuthenticationOptions
              {
                Authority = "https://yourIdentityServerUrl",
                ClientId = "yourid",
                ResponseType = "id_token code",
                SignInAsAuthenticationType = "Cookies",
                RedirectUri = "http://yoururl/signin-oidc",
                Scope = "openid",
              });
        }
    }
}

You have to add a Nuget package called Microsoft.Owin.Security.OpenIdConnect.

Happy coding!

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin




TagCloud

MonthList