These are some quick notes on how to configure an SQL Server to Listen on a Specific TCP port. Open Run Command line and type: SQLServerManager12.msc for SQL Server 2014 SQLServerManager11.msc for SQL Server 2012 SQLServerManager10.msc for SQL Server 2008 and press Enter. To assign a TCP/IP port number to the SQL Server Database Engine In SQL Server Configuration Manager, in the console…
When you launch a web project in Visual Studio, by default is uses the 32-bit version of IIS Express. To change that you can enable the 64-bit version through Options. So, head to:
In Connect(); // 2015 while watching Scott Hanselman’s Keynote on “The Microsoft Cloud Platform for Developers” I noticed a new tool called “Microsoft Azure Storage Explorer“. It’s a new tool that provides a file explorer for your Azure Blob Storage accounts, enabling you to easily work with your assets and containers from Mac OS X, Windows, and Linux. Features currently available in this Preview version Mac OS…
If you are into developing using node you might end up with a lot of dependencies installed in your machine that might be outdated and finding what to update might be quite tricky. npm-check comes to help as a package that checks for outdated, incorrect, and unused dependencies allowing you to update them easily. So for example if you want to upgrade…
In Windows 10 Quick Access may happen to stop working properly and when you try to add a new entry, you can come the following message:
1 | The docfile has been corrupted |
In order to fix it you can open Command Line and execute the following:
1 | del %appdata%\microsoft\windows\recent\automaticdestinations\* |
Or in your Windows Explorer you can go to
1 | %appdata%\microsoft\windows\recent\automaticdestinations |
and delete its content.
When you upload files in your Azure Storage account usually all files are uploaded with application/octet-stream as ContentType. In order to change this you need to parse each file and update each file’s Properties. The following class allows you to update all files in your azure storage containers with the appropriate ContentType.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | public class BlobReset { private readonly CloudStorageAccount _storageAccount; public BlobReset(string connectionString) { _storageAccount = CreateStorageAccountFromConnectionString(connectionString); } public void ResetAllContainers() { CloudBlobClient cloudBlobClient = _storageAccount.CreateCloudBlobClient(); var containers = cloudBlobClient.ListContainers(); foreach (var container in containers) { ResetContainer(container); } } public void ResetBlobs(string containerName) { var container = GetCloudBlobContainer(containerName); ResetContainer(container); } private void ResetContainer(CloudBlobContainer container) { if (!container.Exists()) return; Trace.WriteLine($"Ready to parse {container.Name} container"); Trace.WriteLine("------------------------------------------------"); ; var blobs = container.ListBlobs().ToList(); var total = blobs.Count; var counter = 1; foreach (var blob in blobs) { if (blob is CloudBlobDirectory) continue; var cloudBlob = (CloudBlob) blob; var extension = Path.GetExtension(cloudBlob.Uri.AbsoluteUri); string contentType; _contentTypes.TryGetValue(extension, out contentType); if (string.IsNullOrEmpty(contentType)) continue; Trace.Write($"{counter++} of {total} : {cloudBlob.Name}"); if (cloudBlob.Properties.ContentType == contentType) { Trace.WriteLine($" ({cloudBlob.Properties.ContentType}) (skipped)"); continue; } cloudBlob.Properties.ContentType = contentType; cloudBlob.SetProperties(); Trace.WriteLine($" ({cloudBlob.Properties.ContentType}) (reset)"); } } private CloudBlobContainer GetCloudBlobContainer(string name) { CloudBlobClient cloudBlobClient = _storageAccount.CreateCloudBlobClient(); return cloudBlobClient.GetContainerReference(name.ToLowerInvariant()); } /// <summary> /// Validates the connection string information in app.config and throws an exception if it looks like /// the user hasn't updated this to valid values. /// </summary> /// <param name="storageConnectionString">The storage connection string</param> /// <returns>CloudStorageAccount object</returns> private CloudStorageAccount CreateStorageAccountFromConnectionString(string storageConnectionString) { CloudStorageAccount storageAccount; try { storageAccount = CloudStorageAccount.Parse(storageConnectionString); } catch (FormatException) { throw new FormatException("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the sample."); } catch (ArgumentException) { throw new ArgumentException("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the sample."); } return storageAccount; } } |
This class provides two public methods ResetAllContainers(): which processes all blobs found in…
In Azure all hosted sites have URL Rewrite and ARR (Application Request Routing) modules installed but the proxy functionality is disabled by default in ARR. So, when you create a simple rewrite rule like the one that follows:
1 2 3 4 5 6 7 8 | <rewrite> <rules> <rule name="ProxyAdmin" stopProcessing="true"> <match url="backend/api(.*)" /> <action type="Rewrite" url="http://api.yourdomain.com/api/{R:1}" logRewrittenUrl="false" /> </rule> </rules> </rewrite> |
where, for example all the requests like http://www.yourdomain.com/backend/api/… should be served by http://api.yourdomain/api/… will result in a 404 (Not Found) status code with the following message:
1 | The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. |
To…
In this tutorial we are going to move a quite big database (~160GB) to an Azure SQL Database using BACPAC and Azure Storage. We are going to describe below the process of exporting a database from your local SQL Server instance and importing it to an Azure SQL Database. First things first, in order to proceed with the above action we are going to use the…
In Azure it is very easy to upgrade from one pricing/performance tier to another in a matter of clicks, but some processes are not instant. Upgrading your SQL Database may take some time and through the portal the only info you can get at the moment is that an update is in process. Azure SQL Database provides progress information on management operations (like CREATE,…