Monday, June 21, 2021

Your Synapse Moment: Adding Synapse Workspace User

 Just a quick script for Azure Synapse. Let's say your synapse workspace is named "dev-synapse-workspace", and you've already set up the Managed Identity


To allow synapse to actually interact with your SQL pool user databases, in each database you should run the following script (put your synapse workspace name in place of the example name)

CREATE USER [dev-synapse-workspace] FROM EXTERNAL PROVIDER;

exec sp_addrolemember 'db_owner', 'dev-synapse-workspace';

After that, your pipelines should be able to easily access your Synapse SQL Pools. 

This same code works in an Azure SQL database if you need to access one from Azure Synapse. 

Happy coding!

Saturday, June 19, 2021

My NEW Crafting Blog


 I have decided to completely separate my technical blog (SQL server / Azure posts) from my crafting (sewing / crafting) blog because it makes more sense to have them separate rather than intertwined. 

Azure Logo
Crafting blog: https://craftingwithandie.blogspot.com/

This blog will remain as the technical blog. If you're interested in reading about my future adventures in crafting and sewing, please visit my crafting blog. Otherwise, stay tuned here for more interesting Azure and SQL server articles.


Thursday, June 17, 2021

First Heat Transfer Vinyl Project: Awesome Aunt Shirt

 I'm fairly new to using a cutting machine - I bought my Silhouette Cameo in April 2021 - and since my niece was planning to visit me soon, I thought it would be neat to have a shirt labeling me as an awesome aunt. Awesome aunts do crafting with their nieces, of course, and I planned to help her make some things using the Cameo. 

For the shirt, I decided to use one of my old but rarely worn t-shirts just in case my first use of heat transfer vinyl (HTV) was a disaster and it had to be discarded. After searching around, I found a "This is what an awesome aunt looks like" design on Creative Fabrica in their print templates category


I was happy to see that it was not only a free design, but it also came with a commercial license. Most other design houses mark their free designs as "personal use only", which means you can't use those designs for items you sell. All of Creative Fabrica's free designs come with a commercial license, which is fantastic and extremely generous. They also offer more free designs than most sites - over 25,000 free designs including fonts, SVGs, graphics and machine embroidery files are available in their freebies section. Creative Fabrica also has "daily gifts" which are selected premium fonts, crafts, and graphics designs available free for one day only.

The "This is what an awesome aunt looks like" design came in 6 formats: AI, SVG, DXF, EPS, PNG, and PDF. I have Silhouette Studio Designer edition so I chose to use the SVG instead of the DXF because I read that SVG is supposed to be the best non-.studio3 file format available. I made one small edit to the file, removing the extra space between the k & s in "looks". I also resized the design so it would fit on my 12" x 7.5" piece of HTV.  I then connected my machine and prepared to send the file.

My Cameo came bundled with a collection of vinyl including 9 sheets of HTV. I selected the silvery gray because it looked like it would stand out well on the dark green shirt. After rechecking the documentation on determining which side of the HTV to cut (dull side up because shiny side is the carrier sheet), I placed the HTV on the mat and loaded it in the machine. 

When I hit "send", Silhouette Studio asked me if I remembered to mirror the design? 

I looked back at the design and realized I had forgotten to reverse the design. I mentally thanked the creator of that error message - I'm sure many have forgotten to flip designs and ruined numerous sheets of expensive HTV in the process. I canceled the job, returned to editing mode, mirrored the design, and switched back to the send screen to send it to the machine. The design cut out smoothly and relatively quickly.  

After weeding the design, I stuck it to the shirt and checked the design placement by pinning the shirt's shoulders to my dressform. 
I decided to move the design up closer to the neckline because my initial placement put the hands pointing right at my bust (not a good look). The higher placement looked much better, so I put the shirt on my ironing board and ironed the HTV. I found I had to press certain sections again because the HTV was pulling up when I tried to remove the backing. I think that would happen with any HTV design when using a regular household iron. I have a heat press on my wish list so I can do more HTV designs with less struggle. 

I wore the shirt the day my niece visited. She noticed it after we had been talking for about an hour. 

I have washed the shirt once and noticed that couple of letters are starting to peel up on the edges. The good news is that was easily fixed by ironing the shirt inside out. Of course, if I had that heat press, it would have stayed on better. 

I think I'm going to have a lot of fun decorating other garments with HTV. I have already ordered more HTV in a variety of colors.


HAPPY CRAFTING!

Thursday, April 29, 2021

Where did my table valued functions go in Azure Synapse?

I recently discovered that you can create table functions in Azure Synapse,  but they are NOT listed in SSMS.  Also, even if you know the function's name, you can't use sp_helptext to find out what it does.

So how can we find them or find out their definitions if we know someone created some functions? 

Here's the query you need to pull from system tables:


SELECT s.name
    ,o.name
    ,DEFINITION
    ,type
FROM sys.sql_modules AS m
JOIN sys.objects AS o
   ON m.object_id = o.object_id
JOIN sys.schemas AS s
   ON o.schema_id = s.schema_id
WHERE o.type IN ('IF','FN');
GO

Have fun with Azure Synapse!


Thursday, May 9, 2019

Preparing for the New Azure Certification Exams


Now that I have a few Microsoft certification exams under my belt, I decided that it's time to write a post with tips on preparing for the new Azure exams. Microsoft recently updated most of the Azure exams - and they're updating the rest over the next several months - so the exam experience isn't what it was even a year ago.

Your first stop should be to review the exam overview page, especially the skills measured section, as that is the official list of topics the exam covers.

Next, watch Azure videos and online classes related to the exam topics. You can find free Azure classes on Microsoft Learn and Pluralsight. Pluralsight and Udemy have many in-depth paid Azure training classes as well.

You will also want to get experience in Azure itself. Be sure to check out the Microsoft hands-on labs which allow you to get practical Azure experience without incurring cost from your own paid Azure subscriptions.

Finally, try a few practice tests. I recommend Microsoft’s official practice exam vendor MeasureUp, because they have the most up-to-date practice exams which include all the current type of questions.

In addition to questions, there are now practical tasks (or labs) on the exams. The new labs require you to log into a live environment and complete a number of tasks in Azure. The labs are not  simulation nor stripped down environments, but rather examples of real-world scenarios to truly test your skills and abilities.

The exams will always begin with a series of conventional questions to provide time for the labs to be provisioned and loaded into the environment. If you answer these questions too quickly, you will have to wait for the labs to finish loading. Carefully manage your time in the exam - at the end of each section, you can review your answers, but as soon as you leave that section, you cannot return to it. 

In the labs, you do NOT have to wait for tasks to complete before moving onto the next one. Starting a task by hitting "create" is sufficient for scoring since the provisioning of that resource will complete while you are finishing up other parts of the exam. Microsoft does NOT require you to use a specific method to perform tasks in the labs. If you are more comfortable using PowerShell or CLI, instead of a GUI, then use it. The exam is scored on the end result not on how the tasks were executed.

Each Role-based certification expires in two years. That may not sound like a good thing, but given the rate at which Azure changes, it makes sense - the current certification aligns more closely with the current state of Azure. Microsoft hasn't yet announced what the recertification requirements will be.


Tuesday, April 16, 2019

Azure SQL Managed Instance

Azure SQL managed instance is a relatively new Azure offering. It has nearly 100% feature compatibility with the latest on-premises SQL Server Enterprise Edition Database Engine and allows relatively easy lift and shift of on-premises applications to the cloud with minimal application and database changes. At the same time, Platform as a service capabilities such as automatic patching, version updates, backups, and high-availability drastically reduce required management overhead and total cost of ownership.

For customers running older versions of SQL Server, I'm happy to report that the Azure SQL managed instance supports backward compatibility to SQL 2008 databases. It supports direct migration from SQL 2005 database servers, however migrated SQL 2005 databases will have their compatibility level updated to SQL 2008.

A great benefit of choosing the managed instance deployment option is that it will always be up-to-date because patches and upgrades are automatically applied. Also, you don't have to purchase, manage or secure physical hardware.

Managed instance has High-availability built in and pre-configured using a technology similar to Always On Availability Groups, providing 99.99% uptime SLA. It also has automated backups and point in time restore.

With the managed instance you will spend less time on administrative tasks because the service either performs these tasks automatically for you or greatly simplifies them.

It supports Azure AD authentication as cloud alternative to Windows authentication, automatically manages XTP filegroup and files for databases containing In-Memory OLTP objects and supports SQL Server Integration Services (SSIS) and can host the SSIS catalog (SSISDB) that stores the packages. SSIS packages must be executed on a managed Azure-SSIS Integration Runtime (IR) in Azure Data Factory (ADF). Unlike Azure SQL Database, it allows cross-database queries.

There are two service tiers for Managed Instance: General Purpose and Business Critical.

General purpose: Designed for applications with typical performance and IO latency requirements.
Business critical: Designed for applications with low IO latency requirements and minimal impact of underlying maintenance operations on the workload.

Server sizes range from 8 to 80 vCores depending upon service tier. Memory is 7 GB per vCore.
Maximum storage is 8 TB for general purpose and up to 4 TB for Business Critical

NEW Stuff in Azure SQL Managed Instance!

As of 11 April 2019, managed instance now has a public endpoint. (YAY!)
Here's a link to the official Microsoft article on it - with full instructions for implementing it via Powershell

Friday, April 12, 2019

Azure Data Studio - now with Notebooks


Azure Data Studio is a light-weight cross-platform database tool based upon Visual Studio Code. It runs on Windows, Mac, and Linux. It includes a SQL editor with IntelliSense, keyword completion, code snippets, code navigation and Git source control integration. Although SQL Server Management Studio still remains the champion for database administration tasks, I believe that for developers and Mac and Linux users, Azure Data Studio is the best choice. I also like the fact that Azure Data Studio uses far fewer resources on my machine than SSMS.

As of March 2019, Azure Data Studio connects to:

  • SQL server 2014+
  • Azure SQL database
  • Azure SQL Data Warehouse
  • Azure SQL Managed Instance
  • PostgreSQL servers 

One of the newest and I think more notable features that has been added to Azure Data is its ability to create a SQL notebook.

Notebooks are type of document that combine formatted text with live code elements, images, and query results. You may have heard of them as "Python Jupyter Notebooks". Well, now they can be used with SQL in addition to other programming languages such as Python, Scala, and R.

To create a notebook, simply open Azure Data Studio, then select New Notebook from the file menu. Add a code type cell (or section), check that the Kernel is "SQL", set the connection to your favorite database, enter some SQL code and execute it.

The IntelliSense in Azure Data Studio simplifies code entry, and the right-click menu offers some excellent options, including formatting the document, changing all occurrences of the selected word, and taking a "Peek" at the definition of the selected SQL object (table or stored procedure name).



Just think of all the possibilities!

These notebooks will be great for technical presentations. I can prepare formatted text to describe the concepts presented in my session, and include executable code within the context of the document which the attendees can run at home on their own systems after they download the demos.

Another great scenario would be for troubleshooting or baselining a server. Because Notebooks allow you to save the query results inside the file, you can run diagnostic queries and save the results all in one neat package. Then, later on when you wish to compare to the original baseline, make a copy of the notebook, clear the results and re-run all the queries to see the differences.

For problem solving,  you could create a Notebook containing instructions and a series of queries, ask your client to run the queries and return it to you with the results populated.

I think these new features really make Azure Data Studio outshine old SSMS. I may not remove SSMS from my machine just yet, but I'm pretty certain it's not going to see very much use in the future.

Resoved: Error Creating Storage Event Trigger in Azure Synapse

My client receives external files from a vendor and wants to ingest them into the Data Lake using the integration pipelines in Synapse (Syna...