Upload Images to Azure Storage Using Portal (not programmatically) - sql-server

I need a SQL Server database that stores images, and their name, category, etc, so the SQL table will have 5 or so columns. I'm using Azure as my SQL Server host. It appears I cannot seem to insert image data into my VARBINARY(MAX) column from SQL Server Management Studio which was my first plan. I cannot do this because I cannot seem to give my user permissions to use BULK LOAD. Azure SQL seems to make this impossible. I think I need to use Azure Storage, and then in the SQL Server database, just store a link to the image.
To be clear, I want the images in the database already, I do not want to add them from within the application I am developing. The application I'm developing will only download the images to the device, not upload them.
So How do I upload the images to Azure Storage using the portal, not using code?

So how do I upload the images to Azure Storage using the portal, not using code?
Short Answer
You cannot. The portal does not have a way to upload an image to a storage container from either the old or the new portal.
Alternative
Use the AzCopy Command-Line Utility by Microsoft. It allows you to do what you want with just two command lines. There is terrific tutorial here.
First, download and install the utility. Second, open a command prompt and navigate to the installation AzCopy install directory. Third, upload a file to your storage account. Here are the second and third steps.
> cd C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy
> AzCopy /Source:folder /Dest:account /DestKey:key /Pattern:file
And here are what the parameters mean.
Source The folder on your computer that contains the images to upload.
Dest The address of the storage container at which to store the images.
DestKey The primary access key for your storage account.
Pattern The name of the file to upload (or a pattern).
Example
This uploads an image named my-cat.png from the C:\temp folder on my computer to a storage contained called mvp1. If you wanted to upload all the png images in that folder, you could replace my-cat.png with *.png and it work upload them all.
AzCopy /Source:C:\temp /Dest:https://my.blob.core.windows.net/mvp1 /DestKey:tLlbC59ggDdJ+Dg== /Pattern:my-cat.png
You might also what to take a look at the answers to this question: How do I upload some file into Azure blob storage without writing my own program?

Related

WPF and Squirrel deployment on Azure

I have an application written in WPF (C#) and I deploy this application using Squirrel:
https://intellitect.com/deploying-app-squirrel/
Now I build application using these commands:
.\nuget pack nuget\HelloWorld.nuspec
Squirrel --releasify HelloWorld.1.0.0.nupkg --releaseDir "C:\SquirrelReleases"
on my local machine. But my application is stored in Azure.
How to make deployment using Squirrel on Azure?
How to make deployment using Squirrel on Azure?
Reading the documentation here, it seems there's no direct way to deploy your files in Azure Storage at least as of answering this question. Even for Amazon S3, they are mentioning that you upload the files manually in a s3 bucket:
5. upload the files from the Squirrel Releases directory into the S3 bucket.
I guess you can do something similar for Azure Storage as well. I have not tried it but I believe this is what you would need to do (based on their documentation for Amazon S3):
Create a blob container in your Azure Storage account and set its access level to either Blob (recommended) or Public.
Update the package location on the UpdateManager in your application to use the blob container URL (https://account.blob.core.windows.net/blob-container-name).
Upload the files in blob container. There are many options for you to do that from using available storage explorers, or using AzCopy, or using Azure PowerShell/CLI tools or writing code yourself by using any of the available SDKs.

How to verify the data stored in azure

We're in the designing phase. We are extracting the date using API calls and storing the extracted data in Azure SQL Server and i wanted to test whether the exact data is loading in azure or not.
To verify that the data has uploaded into Azure, take the following steps:
Go to the storage account associated with your disk order.
Go to Blob service > Browse blobs. The list of containers is presented. Corresponding to the sub folder that you created under Block Blob and Page Blob`enter code here` folders, containers with the same name are created in your storage account. If the folder names do not conform to Azure naming conventions, then the data upload to Azure will fail.
To verify that the entire data set has loaded, use Microsoft Azure Storage Explorer. Attach the storage account corresponding to the Data Box Disk order and then look at the list of blob containers. Select a container, click …More and then click Folder statistics. In the Activities pane, the statistics for that folder including the number of blobs and the total blob size is displayed. The total blob size in bytes should match the size of the data set.

Automate the Upload of a .bak file to Azure

I'm very new to Azure and have been tasked with automating the process of taking an existing version of our database, converting it to the newer version and then uploading that to Azure.
The conversion is done, that parts easy, what I'm struggling with is getting a .bacpac file from SSMS using PowerShell. I know I can use the Export Data Tier Application function in SSMS to do this but I need it to be automated. From there I can use something like the following to actually upload the database:
https://blogs.msdn.microsoft.com/brunoterkaly/2013/09/26/how-to-export-an-on-premises-sql-server-database-to-windows-azure-storage/
I have looked around and cannot find a solution to this, or even know where to start.
You can create bacpac of your on-premises databases and locate them on a local folder (c:\MyBacpacs) using SQLPackage.
sqlpackage.exe /Action:Export /SourceServerName:. /sdn:"DB_Foo" /tf:"c:\MyBacpacs\DB_Foo.bacpac"
You can then use AzCopy to upload bacpacs to Azure BLOB storage
AzCopy /Source:"c:\MyBacpacs" /Dest:"https://exampleaccount.blob.core.windows.net/bacpacs" /DestKey:storageaccountkey /Pattern:*.bacpac

SQL Server 2016 Master Data Services

Can anyone tell me how to change the title of SQL Server 2016 Master Data Services within the web portal. Basically I want to change the "SQL Server 2016" to be my company name.
Can this be achieved?
Many thanks
This is based on my knowledge of SQL Server 2012. 2016 may be slightly different.
If you're referring to the "title" in the top-left corner of every page then that is actually an image. In order to change that to another logo image of your choosing you will have to replace that image on the site in the web server. This is how you can achieve this:-
Log on to (remote desktop to) the Web Server hosting the MDS site. If you have separate DB & Web servers then this is Not the one where the database is hosted.
You now need to go the physical folder where the MDS website is located on the server. If you don't know the exact location then open IIS, locate your MDS site in the tree structure on the left (under sites), right-click on your site & click Explore.
Once you're in the folder, look for a sub-folder named Images. Inside this folder, you will find a file logo.png. This is the file you need to replace. Verify by opening the original file in an image viewer.
Backup the original file, add your png file here, rename your file to logo.png.
You should be set here. In case refreshing the browser page does not bring up the correct logo, then try restarting the site in IIS.
Note: for your new logo image, try to get the same dimensions as the original image on the server (logo.png).

How do you export settings from the Database Publishing Wizard?

I'm using the Database Publishing Wizard in VS2008 to push changes to my hosting provider. It doesn't look like those settings go with the project (which seems a little silly to me), but rather they go with the machine.
On each new machine that I'd like to publish from I need to go through the process of digging up my database settings.
Is there a way to backup/export/save these settings to a file?
If so, what is it?
Hmmm ... it appears that the publishing wizard uses 2 config files for it's application configuration:
The Publish Database Wizard uses the
files user.config and hoster.config to
store configuration information. The
directory in which these files are
stored must have the appropriate NTFS
file system permissions set. These
files contain user names and encrypted
passwords. The passwords are encrypted
by using DPAPI.
user.config File
This file stores persisted host and
configuration settings for the Publish
Database Wizard. The user.config file
is located at %SystemDrive%\Documents
and Settings\%Username%\Application
Data\Microsoft\Microsoft SQL
Server\90\Tools\Publishing
Wizard\user.config.
hoster.config File
This file stores options about Web
service addresses, user names, and
databases for shared hosting
providers. The hoster.config file is
located at %SystemDrive%\Documents and
Settings\%Username%\Application
Data\Microsoft\Microsoft SQL
Server\90\Tools\Publishing
Wizard\hoster.config.
I'm trying to access these files in Vista (with VS2008 and SQL Express installed) and striking out. I'll keep you posted.
Update: Looks like I didn't have the Publishing Wizard installed after all. After grabbing the version for VS2008 here, and then installing (and don't worry -- you won't see any indication it's getting installed, but it does).... and THEN setting up my first database using the wizard, it looks like there are indeed some settings stored uder the 'Application Data' directory listed above. However, it looks like it's just a user.config, and then an XML file for each database configured. I believe you can backup each of these files for later use.

Resources