How do I … backup by using Create Database … As Copy Of to an Azure database (to Azure)

–Start logged into Azure and with master as current database
–Does work 27/06/2012
DROP DATABASE _20120627
CREATE DATABASE _20120627 AS COPY OF

–Must wait for state to be changed from Copying to ?Ready?
SELECT * FROM sys.dm_database_copies
SELECT * FROM sys.databases
SELECT name, state, state_desc from sys.databases where name = ‘_20120627’

–Test that data is there
SELECT * FROM .

Azure Storage – a pre-requisite to export SQL to blob storage

A storage account needs a container before it can be used.
The container may be made in Visual Studio using a new Project > Cloud > Windows Azure Cloud Service
When this project is created with any Web Roles you create the relevant projects will also be created and linked.
When this is created make this Cloud Service Project the start-up project and run-it in Visual Studio as an administrator you may then get further, it will not start the cloud service project but the web project. This will then give relevant keys.

I found this not to run in local. Needed to publish it first.
Then in Azure Management > Hosted Services > Locate > Run from DNS

http://social.technet.microsoft.com/wiki/contents/articles/2153.windows-azure-and-sql-azure-tutorials-tutorial-3-using-windows-azure-blob-service-en-us.aspx#__Lesson1Proc1

 

To test the application in the staging environment

  1. From the portal, in the left pane, click Hosted Services.
  2. In the middle pane, expand GolferMessageBoard, and then click v1.2.0.0.
  3. In the Properties pane, click the URL in the DNS name box. The application is opened in a new browser tab or a new browser window depending on your browser configuration.
  4. Test the application by entering one or more entries.

After the application is working correctly in the staging environment, you are ready to promote it to the production environment.

To promote the application to production

  1. From the portal, in the left pane, click Hosted Services.
  2. In the middle pane, expand GolferMessageBoard, and then click v1.2.0.0.
  3. From the top menu, click Swap VIP.
  4. In the Swap VIPs dialog, click OK. Wait until the Status for the deployment changes to Ready.
  5. In the Properties pane, click the URL in the DNS name box. The application is opened in a new browser tab or a new browser window depending on your browser configuration.
  6. Test the application in the production environment by entering one or more entries.

 

Azure Export of SQL database to blob

The format of the file should be
http:// teststorage01.blob. core.windows.net/dbbackup/ebcgroup1.bacpac

I had following error:
“azure blob is not writeable … the specified container does not exist”

To create the container make sure the above has been published to Azure and run from there.

 

ASP.Net publish to Azure with Database and control of Start Page

Followed

https://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/

There was a warning on publish page 3, which mentioned code-first migrations must be enabled. After web-search I realised I needed to upgrade to a higher version of EntityFramework which has System.Data.Entity.Migrations

Used Visual Studio > Tools > Library Package Manager > Package Manager Console

PM> install-package EntityFramework -Pre

PM> enable-migrations

will then publish. Although now up, the sites page is “This web site has been successfully created. There’s nothing here yet, but Windows Azure makes it simple to publish content with GIT, TFS, FTS or your favorite development tool”

If go directly to a page I know exists it does take me there, (or in my case redirects to login)

http://xamlgeek.net/2010/11/19/start-page-in-azure/

During development this of course wasn’t an issue – I just right clicked the page I wanted as startpage as selected “Set as Start Page”.

When I deployed to Azure the start page wasn’t recognized. To set the start page in Azure it is necessary to do one of two things: 1) Implement a start page called “Default.aspx” or 2) specify the start page in the web.config file:

2010-11-19_002433

Setting the defaultDocument value in the web.config fixed my issue.

 

 

Windows Azure – SQL Azure – Manage firewall settings

Not immediately obvious where this is.
On Management Portal select the server – not higher – not lower – not on the SQL portal
There on the right is the Firewall settings