With the Azure Functions v2 runtime, supporting .NET Core it has become easier to do dependency injection. It can be done in a similar way that ASP.NET Core does via Microsoft.Extensions.DependencyInjection
.
Azure Event Grid events across Azure subscriptions
Consider a scenario where you need to listen to Azure resource events happening in one Azure subscription from another Azure subscription. A use case for such a scenario can be when you are developing a solution where you listen to events happening in your customers’ Azure subscriptions, and then you need to handle those events from an Azure Function or Logic App running in your subscription. A solution for such a scenario could be:
- Create an Azure Function in your subscription that will handle Azure resource events received from Azure Event Grid.
- Handle event validation in the above function, which is required to perform a handshake with Event Grid.
- Create an Azure Event Grid subscription in the customers’ Azure subscriptions.
How to Test Azure Logic Apps
Azure Logic Apps are a great solution to write workflows of the business processes, and that too without writing any code. As a result, unit tests can not be written because there’s no code to write unit tests against. How do one go around testing a logic app then?
Create a dotnet core Azure Function
Latest version of Visual Studio Extension Azure Functions and Web tools helps you create pre-compiled C# Azure Functions, and lets you write functions as a C# library. Being a pre-compiled function it has better performance while starting up. Along with that, it lets you use Webjobs attributes for declaring bindings, thus not needing a functions.json file. And, it lets you debug and run azure functions locally.
Blocking all external access and securing Azure Functions
If you’re developing a solution with micro services architecture with Azure, there are chances you’ve been using Azure Functions to develop a service. For example, If you’re solution can involving sending email alerts. One of the microservices here can be Email Service. This can further be broken down into two micro services. One to enqueue mail message to Azure storage queue. This can be a Http Triggered function. Second one can be a Queue trigerred function that prcesses these messages and actually sends the email, using a third party API.
An ASP.NET Picasa Image Gallery
Few days back I was thinking of creating an Image Gallery of the collection of photos I have. Although, there are multiple options available over the internet that you can download and get ready on the go; most of them involves saving the images on your own server. But what I was more concerned was to just have a display only image in my web site to showcase my photos to the word. And, I wanted to make use of one of my social network account – Facebook, Google+, Twitter or Flickr to host the images.
Changing Drive Letter of an Azure Drive (aka X-drive)
Data Persitence in Azure VM Role
Azure VM Role involves creating a base image, uploading it to Azure using csupload, and then creating a servic model in Visual Studio to point to the uploaded base image.
Unable to connect to Azure VM Role for a long time after it is Deployed or Restarted
I have been really frustrated in waiting for days to log in to my VM Role instance via RDP. I have encountered this issue multiple times. Once a VM Role is deployed or it is restarted, we can not login via RDP for a long period, and it takes a lot of time, sometimes 2-3 (random) days once it is back and allows us to connect via RDP.
Startup Tasks in Azure Virtual Machine (VM ) Role
Since the release of Windows Azure SDK 1.3 we can now have startup tasks defined in the *ServiceDefinition *file for web/worker roles. However, this is not allowed for a Virtual Machine role. So what to do in case you need to have some tasks/scripts to be run on your VM Role’s startup? For example, your VM Role runs some software applications that require some configuration information that can be available only at run time.
Azure VM Role CSUPLOAD Error 0x80070070 Cannot prepare VHD
Unexpected Error 0x80070070
Cannot prepare VHD C:\Users\user1\Desktop\baseimage.vhd## Reason: The reason for this error as i discovered was that the disk from where it was uploaded was full. When you use csupload it uses temporary directory for preparing image and by default it uses the location from where you are uploading your base image. So if this disk is full you get this error.
How to enable Remote Desktop for your Windows Azure Roles
Active Directory Domain Join of Azure Roles Using Connect
We already have seen how Windows Azure connect can help us in connecting our windows azure role instances to our local computers in the previous post. We also saw in the use cases/scenarios for azure connect, that we can domain join our windows azure roles with our on-premise Active Directory, and this is possible by using connect plug-in.
Guide to Windows Azure Connect
Building applications for cloud and hosting them on cloud is one of the great things that happened in recent times. However, you might be having number of existing applications that you wish to migrate to cloud, but you do not want to move your database server to the cloud. Or you want to create a new application and host it in the cloud, but this new application needs to communicate with your existing on-premise applications hosted in your enterprise’s network. Other case might be that your new application that you wish to host in cloud will rely for its authentication on your enterprise’s Active Directory.
HTTP Error Code: 400 Message: No tenant signing key of type X509 certificate is provisioned.
What is Relying Party (RP)
An application that accepts tokens from an
STS
is called as a Relying Party (or RP). In modern scenarios, web applications
use WIF and accept tokens from an STS to manage
authentications process.
What are Claims
The security tokens generated by
STS
contain various attributes based on which a grant/deny access is provided or
based on which user experience is customized. These attributes are called as
Claims.
What is Security Token Service (STS)
Traditionally, access control was implemented within the main application by writing a code against user’s credentials to authenticate them and based on their attributes grant/deny access to various resources. This required application developers to be skilled in implementing security and writing a code which is hard to implement and maintain.
AppFabric ACS Exception: A potentially dangerous Request.Form value was detected from the client (wresult="
AppFabric ACS Exception : A potentially dangerous Request.Form value was
AppFabric ACS September release is announced
Well, i was just over with integrating AppFabric ACS with windows azure cloud app, using the August release, and now i hear that September release is out.
What is Passive Federation
When i started working with ACS on Appfabric I kept on encountering various terminologies, one of them was Passive Federation and it was widely used. I could understand the term Federation but passive was not clear to me ever.
Debug SSIS Script Component
While working with your SSIS package, have not you ever tried debugging a script component transformation by putting a breakpoint in the VB code? Well, i did and found that, unfortunately, it does not work.
Downloading files with ASP.NET using Save As Dialog
This article
explains how to download a file that is stored in the database with the
possibility of forcing the browser to open a “Save As” dialog box to save
the file on to the client system. The content of the file is stored in a
column of a table of image data type. Such a dialog-box for saving a file can
be displayed by using HttpContext.Current.Response property. HttpContext is a class that encapsulates all HTTP-specific
information about an individual HTTP request. The property HttpContext.Current gets the HttpContext
object for the current HTTP request.
Here is an example: 1.
HttpContext.Current.Response.Clear(); 2. HttpContext.Current.Response.ContentType = "file";
3. HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fileName); 4. // Remove the
charset from the Content-Type header. 5. HttpContext.Current.Response.Charset = ""; 6. byte [] buffer = (byte[])(dsFile.Tables[0].Rows[0]["FILE_CONTENT"]); 7. HttpContext.Current.Response.BinaryWrite(buffer); 8. // End the
response. 9. HttpContext.Current.Response.End(); In the Line 7 we are actually
writing the contents of the file, as binary characters, to the HTTP output
stream. Method **BinaryWrite****()**
is used for this purpose. This method takes a parameter buffer which is a
byte array containing bytes to be written to the HTTP output stream. In our
case the content of this buffer are fetched from the database into a dataset
**dsFile** with column “**FILE_CONTENT**”
corresponding to the bytes to be written. The **End()** method in Line 9,
sends all currently buffered output to the client, stops execution of the
page, and raises the **Application_EndRequest** event.
This is when we see a message asking us to save or open the file, displaying
the information about the file, like file type, file name.
Output Paramaters in OLE DB Command in SSIS
Today when i was nearly at the verge of finishing my SSIS package i just found out that i really can not complete it at the moment. I am having lot of validations on the input data, lot of look ups to get the reference values and after that i need to insert the rows into a SQL server database. It is not simple insertion, there is a big logic behind inserting rows, checking if the rows containing individual numbers form a sequence so that those can be inserted into a range rather than individual entries. Not only that i need to check if that number is already in the table in some range, if yes i need to discard it, redirect that row to an error output file.
Using Temp Tables in SSIS Package Development
Often while working in a SSIS package you will require to temporary hold your data in a staging table in one of the Data Flow Tasks and then in another task you will require to fetch data from the staging table, perform transformations and load it and delete the staging table.
Sending Mails in .NET framework 2.0 : new namespace System.Net.Mail
If you have used
System.Web.Mail namespace in .NET 1.x for sending emails programmatically,
expect a surprise. All classes within this namespace have been deprecated in
favor of the new System.Net.Mail namespace. System.Net.Mail contains classes
such as MailMessage, Attachment, MailAddress, SmtpClient, etc to help us send
emails in the 2.0 world. The features provided by this namespace, in a
nutshell, are given below. To know more about some of these classes, [read this
article](http://aspnet.4guysfromrolla.com/articles/072606-1.aspx).
Code Analysis in Visual Studio 2005 Team Suite
If you are using VS.NET 2005 Team Suite, code analysis is built into the IDE itself. In older version of VS.NET, you might have used FxCop externally for comparing against pre-defined rules or would have integrated with the IDE by adding FxCop as an Add-In.