Showing posts with label Cloud. Show all posts
Showing posts with label Cloud. Show all posts

Wednesday, January 17, 2018

Operationalize models from AML workbench into Azure - Part 1

Hi All,

One of the primary tasks for any machine learning practitioner or data scientist is to operationalize machine learning models into a serving environment. This first blog post would be showing how to operationalize models using Azure Machine Learning (AML) workbench in a step to deploy models as realtime webservices into Azure.

First, Once you have your model ready to be operationlized, you need to create and set the right execution environment for your model to be deployed to in Azure.

A) Creating a machine learning model management service using CLI in Azure

First, You need to know that to provision a ml model management service in azure that acts as a serving environment for your models. You can create a new one using azure portal or by executing this command in CLI from your computer:

az ml account modelmanagement create --location westcentralus -n mymodelmanagement -g myresourcegroup

-n: where you can specify the name of the service when it is provisioned in azure.
-g: the resource group name that you would like this account model management services assigned to.

Checkpoint #1: You need to make sure to provision a ML model management account is created in azure before going forward with the rest of this article.

B) Configure the execution environment using Azure Machine Learning Workbench using CLI

Once you have a model management account, you would not be able deploy models from your workbench tool into azure using docker container images unless you provision an environment. In the below steps, we will walk through how to accomplish this.


Follow the below steps:

1) From AML workbench, open the command line window from File --> Open Command prompt.
2) You need to login to your azure account, type the following command:

     az login

3) Follow the screen instructions by logging into your azure subscription.
4) Make sure that you are using the right subscription, The below first command list all subscriptions you have, the second line set the intended subscription you would like to use.

      az account list -o table
      az account set -s <subscriptionId>

5) Verify that your current account is set correctly by exeucting the following command:

       az account show

6) To create an environment which creates set of cloud assets containing blob storage, container registry and other assets in a resource group to host docker images for your models into the cloud:

      az ml env setup -n mymldevenv --location westcentralus

Please note that we created an environment on the same location of the model management services in west central us.

7) Set the model management account

     az ml account modelmanagment set -n mymldevenv -g mymldevenvrg

 Please note that when we created an environment in step #6, it has created a resource group for this environment with the same name with rg suffix, which we used in this step to set our model management service we created in step A with this environment.

Checkpoint #2: An AML workbench environment and a model management service were provisioned before moving forward to the rest of this article.

8) Now, we are going to set the correct execution environment in CLI to connect to the provisioned environment and therefore the model management service in azure.

    a) To see available environments, run:
   
         az ml env list

    b) In my case, i do have few of these for different project. To set an active environment, run:

         az ml env set -n mymodelmanagement  -g myresourcegroup

     c) Once you run this command, you should see this confirmation message in the console window

         Compute set to mymldevenv .

9) Every time you re-open AML workbench, you need to make sure to set the right environment before deploying models as webservices into azure model management service.


In the second part, I will take the next step of publishing models into real-time web services in azure model management service in azure.


Enjoy ML :-)

- Mostafa


Friday, April 07, 2017

How to configure X2GO Client on Data Science Virtual Machine

Hi,

While i was trying to connect to a newly provisioned data science virtual machine in Azure. I have received few challenges on successfully start a session in X2GO client app.

The Data Science Virtual Machine (DSVM) VM image makes it easy to get started doing data science in minutes, without having to install and configure each of the tools individually.
This virtual machine contains: Cent OS, Microsoft R Developer edition, Anaconda python distribution, Standalone spark, CNTK, Rattle, XGBoost, in addition to other tools. Check out this article for the full details of this VM.

X2GO client provides a client tool for windows users to RDP to linux VMs, you can install this tool from here.

After you install this tool and try to connect to the DSVM VM, you will get this error:

unable to start startkde

To solve this problem, follow these steps:

1) Connect to the VM using any client linux tool to such as Putty.
2) After you login to the VM, execute the following command:

sudo yum install @kde 

This will install and upgrade existing packages on the VM. The VM will prompt you to accept installing all required packages and upgrades.

3) This command will take few seconds to complete. Below screenshot upon completion step is finished.



4) Return back to X2GO client and login using your username and password.

5) You will be able to successfully RDP to DSVM machine.



Hope this helps!

Wednesday, March 01, 2017

How to set storage account connection string in Azure Functions

Hi,

I was developing an Azure Function App that connects to an Azure blob storage. After setting up the binding for my blob storage account. I got the following error message when running my function app:







The error message in the screen shot above suggests three options to fix this. I will walk through how to implement the first option as one of the available solutions. The first solution is to set the connection string name in the appsettings.json file so it will look like this.

appsettings.json
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "AzureWebJobsDashboard": "",
    "AzureWebJobsmofunctions_STORAGE": "DefaultEndpointsProtocol=https;AccountName=mofunctions;AccountKey=KEY"
  }
}

function.json (Just a section where i define my blob binding info)

 {
      "type": "blob",
      "name": "iBlob",
      "path": "mydata/file1.csv",
      "connection": "mofunctions_STORAGE",
      "direction": "in"
    }

NOTE: 
You will notice that the connection name value in function.json is a suffix for AzureWebJobs key in the appsettings.json file.


Once you set this, Press F5 and you will be able to connect and read blob contents from Azure storage accounts.



Enjoy!

Thursday, September 08, 2016

Build Intelligent Microservices Solutions using Azure

Hi All,

I had the pleasure last night to present at one of our local user groups to talk about building intelligent microservices in Azure.

The session covers in detail how to build intelligent microservices solutions using Cloud Services including web and worker roles, Azure App Service features in Azure & Service Fabric. The session was a demo driven and i demonstrated how to design and provision complete end-to-end solutions using cloud services using web roles, worker roles and service bus in Azure.
I also covered Azure App Service capabilities that help developers to scale and monitor production applications; in addition to setup continuous deployment.

Session objectives and takeaways:

  1. Benefits of creating micro services in the cloud
  2. End-To-End Use case for building cloud service with web & worker roles with service bus integration
  3. Azure App Service intelligent features including troubleshooting, CI, back up, routing, scheduling & other features
  4. Azure Service Fabric microservices platform


The presentation is posted below.

Wednesday, June 15, 2016

Content was blocked because it was not signed by a valid security certificate when running Office Add-Ins

Hi All,

While i was developing an office add-in and using IE to view a deployed outlook add-in i was getting the following error:

Content was blocked because it was not signed by a valid security certificate.

It turns out that this issue is related to a self signed certificate that is being used on my local web server using gulp-webserver plugin; since i am using Visual Studio code in developing my office add-ins.

If you want to configure gulp server to use a certificate, open gulpfile.js in your project and add https to the configuration of gulp web server as explained here.

The other solution is to use chrome instead and not IE since IE requires self signed certificates to be added as a trusted certificate in your machine. So if you don't want to go through adding a self signed certificate to trusted certificates store, just use chrome and your add-in will load with no issues.



Hope this helps.

Friday, May 13, 2016

Data Science essentials in Azure ML

Hi All

I have the opportunity today to speak at RevolutionConf at Virginia Beach.

RevolutionConf is a one-day, platform and language agnostic, software development conference being held on May 13, 2016 in Virginia Beach, VA.

I had so much fun with chatting and speaking with speakers and attendees. The schedule has variety of topics, technologies and platforms talks. I am impressed and loved to be here with the crowd.

I'm glad to be a speaker at the first time RevolutionConf event and looking forward to the upcoming event next year.

Special thanks for organizers, volunteers and attendees to have such an amazing event.

Here is my presentation and talk details:

Topic: Data Science Essentials in AzureML
Description:
In this session i am covering data science principals such as: Regression, Clustering, Classification, Recommendation and how to build programmable components in Azure Machine Learning experiments using data science programming languages. The session shows and illustrate how to implement these concepts using Azure ML studio.



Data science essentials in azure ml from Mostafa Elzoghbi

References:
** Free e-book “Azure Machine Learning”
https://mva.microsoft.com/ebooks#9780735698178

** Azure Machine Learning documentation
https://azure.microsoft.com/en-us/documentation/services/machine-learning/

** Data Science and Machine Learning Essentials
www.edx.org


Thanks all and hope this helps.

Wednesday, April 06, 2016

Power BI embedded step by step

Hi All,

In this blog post i am providing a walk through on how to use Power BI Embedded feature in an asp.net MVC application. Microsoft announced this feature in Build 2016 few days ago.
As of now, Power BI embedded feature is still in preview.

This blog post is describing how to build this app from scratch in a step by step. The source code is in GitHub as well.

Power BI Embedded allows developers to integrate Power BI capabilities in their web or mobile application with out the need to login! so customers can view your power bi reports in custom applications without the need to login or provide o365 credentials to view these reports.


To be able to use Power BI embedded you need the following:
1) A power bi report that you have created & saved in (pbix) file format.
2) Azure subscription because we need to provision Power BI workspace collection that will host our reports.
3) An application to integrate these reports to,
    a) We will create ASP.NET MVC application to visualize a reports (Step #3)
    b) We will create ASP.NET Web Forms application to visualize a report (Step #4)

Screen shot below shows an asp.net MVC application that uses Power BI embedded feature (NO LOGIN IS NEEDED!!!)



How to implement this application:

1) Provision Power BI Workspace Collection:
a) Navigate to Azure Portal, Under Data and + Analytics

Once you select Power BI Embedded, enter the following details:

  • Workspace Collection Name: Demo1
  • Subscription: Select any subscription you have.
  • Resource group: Select any RG or create a new one.
  • Location: Select any location for PBI workspace collection.
  • Click on create button

Once the Power BI Embedded workspace collection is created. We will have an empty collection.

This video shows how to implement step #1 & it covers the basics of Power BI Embedded (Optional)


2) Import pbix report file into Workspace Collection:
Microsoft has created a console application that you need to run to import pbix report file into the create workspace collection in Azure.

You can download the console app utility from GitHub here.

Open the solution in VS 2015 and set "Provision Sample" project as a startup project.
Follow these instructions to import pbix file into Azure Power BI Workspace collection.


First, we will enter "5" so we create a workspace in an existing workspace collection we have just created in step #1.

Enter Workspace Collection Name: Demo1 (Same name as we created in step #1)
Access Key: From Azure Portal, Copy Access Key (Key1) for the created Workspace collection.
Copy the generated Workspace Id, since we will use it in the next step.


Second, we will enter "6" to import pbix into the workspace we just created in the previous step.

Enter workspace collection name: Demo1
Workspace Id: copy what we have created in the previous step, also, you can get workspace if you refresh azure portal.
File Path: full file path for pbix file.

Now, we have imported our report into Power BI workspace collection that we created in Azure.

I have created a video for step #2 (Optional to watch)



3) Create ASP.NET MVC Application to use PowerBI Embedded reports:
I have checked in the code for this sample, here is what you need to know about this application.
Open Home Controller, Check Index action:

  List<ReportViewModel> reportsList = new List<ReportViewModel>();
            var devToken = PowerBIToken.CreateDevToken(this.workspaceCollection, this.workspaceId);
            using (var client = this.CreatePowerBIClient(devToken))
            {
                var reportsResponse = client.Reports.GetReports(this.workspaceCollection, this.workspaceId);
                for (int i = 0; i < reportsResponse.Value.ToList().Count; i++)
                {
                    reportsList.Add(new ReportViewModel
                    {
                        Id = reportsResponse.Value[i].Id,
                        Name = reportsResponse.Value[i].Id,
                        EmbedUrl = reportsResponse.Value[i].EmbedUrl,
                        WebUrl = reportsResponse.Value[i].WebUrl,
                        Report = reportsResponse.Value[i]
                    }
                    );
                }
            }

Above code segment connect to power bi sdk and get all reports we have in the specified workspace id. Once we have this reports list, we can embed  any of them in our pages.

 var reportId = reportsList[0].Id;
            using (var client = this.CreatePowerBIClient(devToken))
            {
                var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, reportId);
                var viewModel = new ReportViewModel
                {
                    Report = reportsList[0].Report,
                    AccessToken = embedToken.Generate(this.accessKey)
                };
                return View(viewModel);
            }

Above code segment selects the first report and return the full report object (Power BI Report) and access token to the view (index.cshtml)

In Index.cshtml, Microsoft created an extension to HTML helper for PowerBI reports. PowerBIReportFor that renders PowerBI reports ;-) Amazing!!

<div class="side-body padding-top">
    @Html.PowerBIReportFor(m => m.Report, new { style = "height:85vh", powerbi_access_token = Model.AccessToken })
</div>
One Pro Tip: you need to make sure to include powerbi.js in any page or the masterpage (aka _layout.cshtml) to be able to show any power bi report in your page. This JS file has been added when i added powerbi nuget packages to my project.


Open the web.config and change these keys as you have in your Azure provision keys before running the application:

   <add key="powerbi:AccessKey" value="" />
   <add key="powerbi:WorkspaceCollection" value="" />
    <add key="powerbi:WorkspaceId" value="" />

Run the application :-)

I have created a video for step #3 that covers App Tokens and explains how to build the demo app (Optional)


4) Create ASP.NET Web Forms Application to use PowerBI Embedded reports:
I have checked in the code for this sample, here is what you need to know about this application.

Open the web.config and change these keys as you have in your Azure provision keys before running the application:

   <add key="powerbi:AccessKey" value="" />
   <add key="powerbi:WorkspaceCollection" value="" />
    <add key="powerbi:WorkspaceId" value="" />
In Default.aspx.cs, check out the code to connect to PBI REST API to get DevTok and then AccessToken for the displayed report.

 if (!Page.IsPostBack)
            {    

                List<ReportViewModel> reportsList = new List<ReportViewModel>();
                var devToken = PowerBIToken.CreateDevToken(workspaceCollection, workspaceId);
                using (var client = this.CreatePowerBIClient(devToken))
                {
                    var reportsResponse = client.Reports.GetReports(workspaceCollection, workspaceId);

                    for (int i = 0; i < reportsResponse.Value.ToList().Count; i++)
                    {
                        reportsList.Add(new ReportViewModel
                        {
                            Id = reportsResponse.Value[i].Id,
                            Name = reportsResponse.Value[i].Id,
                            EmbedUrl = reportsResponse.Value[i].EmbedUrl,
                            WebUrl = reportsResponse.Value[i].WebUrl,
                            Report = reportsResponse.Value[i]
                        }
                        );
                    }
                }
             
                var reportId = reportsList[0].Id;
                using (var client = this.CreatePowerBIClient(devToken))
                {
                    var embedToken = PowerBIToken.CreateReportEmbedToken(workspaceCollection, workspaceId, reportId);

                    var viewModel = new ReportViewModel
                    {
                        Report = reportsList[0].Report,
                        AccessToken = embedToken.Generate(accessKey)
                    };

                    accessTokenText.Value = viewModel.AccessToken;
                    embedUrlText.Value = viewModel.Report.EmbedUrl;
                }

In Default.aspx, check out the iframe and JS function to load PBI report:


<iframe ID="iFrameEmbedReport" src="" height="768px" width="1024px" frameborder="1" seamless></iframe>

 
    <!-- Js function to assign iframe embedUrl and access token -->
     <script type="text/javascript">

          window.onload = function () {

              //debugger;
              // find the iFrame on the page and handle the loaded event.
              var iframe = document.getElementById('iFrameEmbedReport');
              iframe.src = document.getElementById('MainContent_embedUrlText').value;  //embedReportUrl;
              iframe.onload = postActionLoadReport;
              // post the access token to the iFrame to load the tile
              function postActionLoadReport() {
                  // get the app token.
                  accessToken = document.getElementById('MainContent_accessTokenText').value;//{generate app token};
                  // construct the push message structure
                  var m = { action: "loadReport", accessToken: accessToken };
                  message = JSON.stringify(m);
                  // push the message.
                  iframe = document.getElementById('iFrameEmbedReport');
                  iframe.contentWindow.postMessage(message, "*");
              }
          };

    </script>

Here is a video for step 4 on how to use Power BI embedded in asp.net web forms:




References:
* Source Code GitHub Repos:
ASP.NET MVC: https://github.com/melzoghbi/PowerBIEmbeddedSimplified
ASP.NET Web Forms: https://github.com/melzoghbi/PowerBIEmbeddedWebForms

* Power BI Embedded Resources:
https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started/

Enjoy!

Tuesday, March 08, 2016

Azure App Service in depth

Hi All,

I have published a new video on how to build web, mobile and api applications using Azure App service.


Video Details:

In this video i am describing in depth out of the box features for Azure App Service. Azure App service allows developers to build web, mobile and api applications using your favorite programming language. 
The video shows how to provision azure app service without the need to have azure subscription to get a sense of what can you build with azure app service. Also, we cover how to use azure portal features for app services in terms of: scalability,security, automated backups, deployment slots, VNet integration vs Hybrid networking and much more.
Hope you enjoy it!

Build micro-services in Azure Cloud Services

Hi All,

I have published a new video to cover how to build scalable micro-services in Azure using cloud services. The video covers who to use web and worker roles in cloud services. In addition when to use worker roles vs. web jobs for backend jobs.


Video Details: "Build Intelligent Cloud Services using Azure"

The session covers how to build web, mobile, Api solutions using Microsoft Azure platform. The session covers in detail how to build intelligent solutions using Azure Cloud Services. The session is a demo driven and demonstrate how to design and provision complete end-to-end solutions using Microsoft intelligent cloud.
Session Objectives & Takeaways
  • Benefits of creating micro services in the cloud using Azure cloud services
  • Showing End-To-End Use case for building cloud service with web & worker roles with service bus integration
GitHub Repo:


Enjoy!

Wednesday, February 17, 2016

Build Intelligent Solutions using Azure

Hi All,

Last night i was honored to present to one of our local user groups in DC about how to build intelligent solutions using Azure.

In this session, I was illustrating different scenarios and practical approaches on building microservices that are elastic and resilient into the cloud. I covered with a practical use case on how to build cloud services that have web and worker roles that integrates with services bus queue as an intercommunication channel between web and worker roles. Also, I covered how to add web jobs into web roles into cloud services as well.

The second part of the presentation was covering Azure App services including: web apps, mobile apps, logic apps and api apps. Then , I covered lots of intelligent features that Azure offers to build intelligent solutions from backup automation, continuous integration, traffic routing, troubleshooting features and deployment slots.


Session Description is below:

The session covers how to build web, mobile, Api solutions using Microsoft Azure platform. The session covers in detail how to build intelligent solutions using Azure App Service. Azure App Service includes web apps, logic apps and mobile apps services as PaaS solutions for engineers. The session is a demo driven and demonstrate how to design and provision complete end-to-end solutions using Microsoft intelligent cloud.


Build intelligent solutions using ms azure from Mostafa Elzoghbi

Case Manager Demo code is on GitHub: https://github.com/melzoghbi/AzureCloudServices

At the end of the event, I had some giveaways that are IoT sensor Kits and "Fundamentals of Azure" books. Most audience asked about how to get the pdf of this book, here is the download link:

Fundamentals of Azure book download link


Hope this helps.

Monday, November 30, 2015

How to migrate console applications to the cloud using Azure WebJobs

Hi All,

This post is to answer a question i frequently receive from developers and architect on what is the best way to take legacy console applications (exe) to the cloud.

I have creates a video that answers the address the following issues & concerns:

1) The challenges of scaling console applications.
2) The available options to migrate console applications to the cloud.
3) How Azure webjobs is a great option for migration light weight backend jobs to the cloud.
4) Scaling up or down web jobs in Azure.
5) Scheduling options for Azure web jobs.

Enjoy watching the video and keep the feedback coming.



Channel 9 Video Url:

https://channel9.msdn.com/Blogs/MostafaElzoghbi/How-to-migrate-Console-Apps-as-a-cloud-service

Tuesday, October 13, 2015

DC Startups join Microsoft Ventures - Join our Equity free program $25k & $500k Azure Credits

Hi All,

I am calling all DC startups who are looking for getting mentorship, grow, get funded and get a great working environment and to join Microsoft Accelerator program.


Microsoft Ventures is a global initiative empowering entrepreneurs around the world on their journey to build great companies. We’re focused on building partnerships with venture funds, angel investors, incubators, accelerators, corporate executives, and at the core startups, as well as run its own accelerators around the world. Our goal and objective is to help scale and grow startups by giving them a great working environment, access to mentors and service providers, free technological tools and connecting them to Microsoft’s customers and business partners. 

The next batch of the program opens on Feb 2016 and it’s going to be themed around Machine Learning and Data Science. We will be targeting startups that are a more mature than previous batches – such that raised $1M-$1.5M, with an existing product and maybe even initial traction.


Having said that, startups that choose to use Azure will enjoy the help of the ML product group in architecting their solutions to the right size and using the cutting edge services Azure ML offers. 
Access to the Microsoft distribution channels – Microsoft Ventures is committed to help startups who have relevant products to our customers and partners get connected to them through our massive distribution channels. In addition, startups will receive assistance in getting set up on the Azure Marketplace allowing the Microsoft sales reps to sell their solutions with higher incentives. 
Free of Microsoft Azure – startups in the program will be automatically enrolled to BizSpark Plus program and be credited for $500K of cloud usage (storage and compute) for 3 years, to be used in their own pace. This allows the startup to focus on the crucial business aspects of their company.


Meet us in person, learn more about the program and benefits. Besides these locations we are evaluating a few more venues so please check out for more details at microsoftventures.com/seattle


Meet us in person on November 4th, 2015 at 1776:



Let me know if you have any questions or would like to get an invite to attend.


Tuesday, October 06, 2015

Secure sensitive data with SQL Server on Azure


Hi All,

SQL Server 2016 has released a new feature that is called "Dynamic Data Masking" which allows to mask sensitive information to be masked on the fly without a change to a line of code in your application. The video covers the DDM technology, the need for it and how to implement it on SQL DB in Azure. This feature can be implemented either using SQL PaaS (Azure SQL DBs) or IaaS (SQL Server VMs) on Azure.

If you have for example Personal Identification Information (PII), Credit Card Numbers, or Social Security Numbers that you would like to secure from non-authorized view from viewing restricted information to comply with your security policies. DDM is the right feature for you with zero change line of code.


SQL Database Dynamic Data Masking (DDM) limits sensitive data exposure by masking it to non-privileged users. Dynamic data masking is in preview for Basic, Standard, and Premium service tiers in the V12 version of Azure SQL Database.
Dynamic data masking helps prevent unauthorized access to sensitive data by enabling customers to designate how much of the sensitive data to reveal with minimal impact on the application layer. It's a policy-based security feature that hides the sensitive data in the result set of a query over designated database fields, while the data in the database is not changed.

In this video, I cover how to configure DDM feature in SQL Database on Azure using the new Azure portal. How to manage existing masks and how to test out this feature using SQL Server Management Studio (SSMS).

The video covers how to manage multiple users scenario to allow either masked or unmasked data on a SQL database in Azure.

Enjoy the video below.



Channel 9 video link


Enjoy!

Friday, August 07, 2015

How to setup Ubuntu server VM on Azure


Hi,

I was trying to provision an Ubuntu server VM on Azure and i'd like to share how to get up and running Ubuntu sever 12/14/15 VM on Azure step by step.

1) From Azure Portal,  Select Virtual Machines under compute, then select Ubuntu Server 15.



2) Install PuTTy as SSH Client to install extra components for the provisioned VM, you can find the client installation here:



3) Open PuTTY client and enter the Ubuntu server server VM url, you can find it in Azure portal -- Under Dashboard page for the provisioned VM. For example:  UbuntuDevSample101.cloudapp.net

  1. Click on connect, a PuTTY console window will pop up.
  2. Log in with the creds you have set while provisioning your Ubuntu VM.
  3. After a successful login, A SSH command window open.

 4) We need to install Ubuntu Desktop, run the following command:

$ sudo apt-get install ubuntu-desktop


This command will take a while, once it is completed, this means we have an Ubuntu desktop installed on the server.

Below screen show shows the command in SSH client:



 5) Install remote connection (RDP) capability by typing the following command:

$ sudo apt-get install xrdp


6) From Azure Portal, select the provisioned VM and select End Points tab.
7) We need to add a RDP end point to connect to the VM,
8) To add RDP endpoint to the VM, check out below screen shot:



9) From Azure portal, Click on Connect after adding the end point.
10) Enter the username and password!
11) After a successful login, you will be able to RDP to ubuntu VM with a desktop component!


Enjoy! Hope this helps.

Sunday, May 17, 2015

How to setup custom SSL certificate in Azure Cloud Services

Hi All,

In this blog post, I am providing a walk-through on how to setup custom SSL certificate into Azure cloud service. In any cloud service project, you may have multiple web roles that you need to configure some or all of them using SSL certificate.

Since Certificate authorities (CAs) don't provide a pfx file to configure and upload into windows azure, there are some work you need to do once you get the CA response which in some cases it is different formats for the ssl certificate.

For example: GoDaddy provides a zip file which contains .crt (which is your custom domain certificate response) and .p7b file which is set of intermediate certificates used to authenticate your certificate to the root GoDaddy certificate.

Windows Azure SSL certificate requirements:

1) Windows azure accepts only SSL certificate with personal exchange information extension (.pfx).
2) SSL certificate has to be 2048 bit encryption certificate.

Any Certificate Authority (CA) requires you to generate a CSR request to issue a SSL certificate, once you get the CA response, you will be getting file formats such as: (*.crt)

How to convert (*.crt) file into (.pfx) file:

1) Open your IIS manager, click on your server in the left pane.
2) Click on "Complete Certificate Request".
3) Select the certificate .crt file, provide a friendly name and click on OK.


4) Double click on the generated .pfx file to import it in your computer (CurrentUser) store.
5) Open the certificate manager by typing certmgr in the Run window.
6) Open your personal store, you will see the imported certificate with the same friendly name you gave in IIS is imported into your machine.
7) Right click on the certificate, click on export.


8) Make sure to select export the private key, save the generate SSL certificate with pfx file.
Note: remember the password you set for the file since we will need this password when we upload the ssl certificate into Azure portal.

9) We will be using this generate certificate file (.pfx) to be configured in the cloud service and to upload in windows azure.

10) Login to Azure portal, click on your cloud service, select certificates tab.
11) Upload the ssl certificate we generated, and type in the password you previously set when you export the ssl in step #8.

12) This step is to associate the installed SSL certificate in the cloud service for certain web role.
13) From VS 2013 Solution explorer window, double click on the web role you would like to associate the SSL certificate to.
14) Click on Add Certificate.
15) Add a name for your certificate, select store location: CurrentUser
16) Click on the thumbprint small button and select the SSL certificate.
You don't need to copy the thumbprint value for the ssl, once you select the certificate, VS 2013 pulls this value and set it in the field.
17) Click on endpoints tab and add a new endpoint using https protocol and select the certificate associated with the web role we previously added in the certificates tab.



17) Save and deploy your cloud service, Test out accessing the cloud service web role using https!


Enjoy!


How to configure custom domain in azure cloud service deployment

Hi All,

In this post i am going to show how to configure custom domains in azure cloud services.
As you my have multiple web roles in your cloud service, you need to configure your website to use your custom domain.

For example: if your domain is: www.MostafaElzoghbi.com --> You want this domain to point to the azure cloud service url: mycloudservice.cloudapp.net

The way to configure custom domains in azure cloud services is different than the web apps. In the web app scenario you have custom domain option to set your configuration per web app.
In case of the cloud service here are the steps you need to follow:

1) Login to Azure Portal, Click on Cloud Services.
2) Select your cloud service.
3) Copy your cloud service Site Url.
For example: mycloudservice.cloudapp.net

4) Copy your Cloud Service Public Virtual IP Address (VIP).
For Example: 191.236.48.195



5) Login to your hosting/domain provider, access your control panel and edit the DNS entries for the domain you want to point to azure cloud service.

6) Add CNAME record with the following values:
Type: CNAME
Name: www
Data: mycloudservice.cloudapp.net

7) Add A record with the following vaues:
Type: A Record
Data: VIP of the cloud service.

8) Save your entries and give it few minutes or hours to propagate.

7) Check out your cloud service web role using the custom domain: www.mycustomdomaain.com

Enjoy!

Friday, May 01, 2015

My Study notes and guidance to pass 70-532 Exam : Developing Microsoft Azure Solutions

Hi All,

Today i have passed Microsoft exam 70-532 "Developing Microsoft Azure Solutions". I have been studying for awhile. I have been implementing Azure solutions since 2008. The preparation was just a mater of getting the exam materials, focus on the exam topic areas, and do lots of readings!

I will provide all what you need to read, watch or most importantly is my study tips to pass the first exam in the Azure certifications for Developers and Architects.

A) What you need to read:

1) Topics covered in the exam:
https://www.microsoft.com/learning/en-us/exam-70-532.aspx

2) Developing Azure Solutions book (or the ebook):
http://www.amazon.com/70-532-Developing-Microsoft-Azure-Solutions/dp/0735697043


B) What you need to Watch:
Microsoft  Virtual Academy (MVA) has a course for this exam. Amazing course that cover all the basics of this exam, great conversations and discussions for these topics. It covers exam's  topics and lots of demos in the MVA course and  you need to do some exercise for all the topics they asked to read more about.

http://www.microsoftvirtualacademy.com/training-courses/developing-microsoft-azure-solutions


C) My Study notes & tips:




  • How to configure custom domain in your Azure app service:    
          http://azure.microsoft.com/en-us/documentation/articles/web-sites-custom-domain-name/

  • How to configure GIT in Azure for Continuous Integration:
          http://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/

  • How to enable remote debugging for deployed Azure app service:
          http://blogs.msdn.com/b/webdev/archive/2013/11/05/remote-debugging-a-window-azure-web-site-with-visual-studio-2013.aspx

  • How to configure Azure Mobile Push Notifications service:
          https://msdn.microsoft.com/en-us/library/azure/dn167707.aspx

  • Understand the factors that affect the cost (billing) when you store content in Azure CDN Services and how to control it.
  • How to integrate with Azure AD Services through REST API.
  • Understand Azure Storage replication strategies, check out this link:
          https://msdn.microsoft.com/en-us/library/azure/hh873027.aspx
  • How to manipulate data in Azure storage in C#, check out this simple reference:
           http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/
  • How to configure Virtual Networks (VNet) in Azure using Site-to-Site and Site-to-Point, check out this reference:
          https://msdn.microsoft.com/en-us/library/azure/jj156206.aspx


Hope this helps and best of luck for all of you!




Tuesday, April 14, 2015

How to fix 'thumbprint' attribute is invalid error in Azure Cloud Service

Hi,

While i was configuring a web role in a cloud service project to use SSL certificate, I was adding my certificate to the Service Configuration file (cscfg) as follows:

  <Certificate name ="MyCertTest" thumbprint="cd947ee0b988e3b144d9fc39af47128dec68b731" thumbprintAlgorithm="sha1"/>
 

After i copied the thumbprint value from my certificate and paste it in the configuration file (cscfg) i found that there is an underlying error under thumbprint attribute and when i build i get the following error:

the xml specification is not valid: the 'thumbprint' attribute is invalid the pattern constraint failed


Here is the steps on how to fix it:

1) Remove any spaces from the thumbprint value.
2) There was a hidden character at the beginning and end of this string and once i removed it the underlying error in the cscfg file went away.
3) Save your changes and build!
4) Deploy your cloud service to Azure.


Hope this helps.