Pages

Monday, 12 June 2017

Windows Azure random FAQs

1. What are IaaS, PaaS and SaaS?

Basically these are cloud service models for cloud offerings. These are categorized on the basis of cloud management of resources.
SaaS: In this web browsers are used to access the software.  In SaaS, all things are managed by cloud providers like infrastructure, data, storage, security etc.
Example of SaaS: Office365, Web based Email services.
Benefits: Scalability, Multi-Tenancy, Security, Pay only what you use. You don’t need to purchase, install, update or maintain any hardware, middle-ware or software. SaaS makes costly application like ERP and CRM affordable for users that lack the resources to buy, deploy and manage the required infrastructure and software themselves.
PaaS: This offers a platform to develop and deploy applications.
IaaS: This offers the cloud servers and associated resources with these servers.
The below table explain these in details.

SaaS
PaaS
IaaS
1.       Hosted Applications



All are managed by Cloud Provider.

Managed by User.


Managed by User.
2.       Develop and deployment tools


Managed by cloud provider.
3.       OS
4.       Server and Storage
Managed by cloud provider.
5.       Networking/Firewall Security
6.       Data Centers

2. What is Service bus and its components?

Main use of service bus is to integrate on premise applications with cloud.
It’s something like postal service that we see in real world. This ensure the communication between two parties even both are not online at same time. That’s why it is brokered messaging mechanism. However it also provides third party communication as well. So it supports two type of messaging patterns.
Azure Relay: The WCF Relay component of Azure Relay is a centralized (but highly load-balanced) service that supports a variety of different transport protocols and Web services standards. The relay service supports traditional one-way messaging, request/response messaging, and peer-to-peer messaging.
Azure Service Bus: Also called Brokered messaging. In this the messaging infrastructure reliably stores messages in a "broker" (such as a queue) until the consuming party is ready to receive them.
 Below are the basic components of Azure Service Bus.
Queues
Topics
Relays
Can be many receivers but one receiver can only receive a message at a time. No two receivers can receive a single message simultaneously.
Each message is processed by a single consumer.

Methods:
ReceiveAndDelete: remove message and immediately deletes it. If exception then message will be lost.
PeekLock: Rather than delete, it locks the message and wait for three events.
1.       If the receiver processes the message successfully, it calls Complete (), and the queue deletes the message.

2.       If the receiver decides that it can't process the message successfully, it calls Abandon (). The queue then removes the lock from the message and makes it available to other receivers.

3.        If the receiver calls neither of these within a configurable period of time (by default, 60 seconds), the queue assumes the receiver has failed. In this case, it behaves as if the receiver had called Abandon, making              the message available to other receivers.

Support publish/subscribe messaging communication model.
"one-to-many" form of communication.
When a message is sent to a topic, it is then made available to each subscription to handle/process independently.

Can apply filter when subscribe.
// Create a "HighMessages" filtered subscription.
SqlFilter highMessagesFilter =
   new SqlFilter("MessageId > 3");

namespaceManager.CreateSubscription("TestTopic",
   "HighMessages",
   highMessagesFilter);


Supports traditional one-way, request/response, and peer-to-peer traffic.

Enabling you to securely expose services that reside within a corporate enterprise network to the public cloud, without having to open a firewall connection, or require intrusive changes to a corporate network infrastructure.


       
Event Hubs are also part of service bus that are also work on Publisher/subscriber model. When events are stored in the Hub, it will stay in the hub until the retention period expires. so you can read messages if needed, even after other subscribers are already read that event/message.

3. What is App Service?

It is an Azure PaaS offerings to create web and mobile applications and provides supports to integrate your apps with on premise applications.
·         It support multiple languages like ASP.Net, Node.js, PHP, Java, Python etc.
·         Also you can run PS scripts inside app service VMs.
·         Support of scale up and out.
·         Connections to SaaS platforms and on-premises data - Choose from more than 50 connectors for enterprise systems (such as SAP, Siebel, and Oracle), SaaS services (such as Salesforce and Office 365), and internet services (such as Facebook and Twitter). Access on-premises data using Hybrid Connections and Azure Virtual Networks.

App Service offers several app types, each of which is intended to host a specific workload:
·         Web Apps - For hosting websites and web applications.
·         Mobile Apps -For hosting mobile app back ends.
·         API Apps - For hosting RESTful APIs.
·         Logic Apps - For automating business processes and integrating systems and data across clouds without writing code.

4. Difference between Azure Web Role vs Azure Web Apps (Azure websites)?

Web role provides the ability to run elevated startup scripts, edit registries, install third party exe, and optimize IIS.
It provides the full control over IIS and web server. You can RDP the VM.
With Windows Azure Web Apps, you don’t have control over IIS or web Server. But it provides fast deployment than Web roles.

5. Brief about Azure API management.

AAPIM is a solution for publishing your APIs to external and internal customers. You have to create an API gateway for your existing backend services hosted anywhere. You can apply security, rules on these services and get how the developers and other users are consuming your services.

Benefits:
·         Secure your APIs using a key, token and IP filtering.
·         Enforce flexible and fine-grained quotas and rate limits, modify the shape and behavior of your APIs using policies and improve latency and scale your APIs with response caching.
·         Get near real-time analytics reports and identify trends that might affect your business. Plus, log request and response data for more online and offline analysis.
·         Expose all APIs behind a single static IP and domain.

6. How to manage your data in Azure.

Azure provides various ways to store and manage the data. Like
·         SQL Database: if data is relational then it would be good option.
·         Blob Storage: store collection of unstructured bytes like backups, videos, mp3, pdf, documents etc.
·         Table Storage: provides NoSQL like storage that work on key-value pairs.

7. Brief state management in azure.

For state management you can use
·         Table Storage
·         Sql Azure
·         Azure Caching
You can provide the session state provide for each as below.
Table Storage:
<sessionState mode="Custom" customProvider="TableStorageSessionStateProvider">
 <providers>
    <clear/>
    <add name="TableStorageSessionStateProvider"
        type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider" />
  </providers>
</sessionState>
TableStorageSessionStateProvider created by Azure Product development team.

Sql Azure:
<sessionState mode="SQLServer"
sqlConnectionString="Server=tcp:[serverName].database.windows.net;Database=myDataBase;User ID=[LoginForDb]@[serverName];Password=[password];Trusted_Connection=False;Encrypt=True;"
cookieless="false" timeout="20" allowCustomSqlDatabase="true" />

Azure Caching:
<sessionState mode="Custom" customProvider="AzureCacheSessionStoreProvider">
  <providers>
    <add name="AzureCacheSessionStoreProvider"
          type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache"
          cacheName="default" useBlobMode="true" dataCacheClientName="default" />
  </providers>
</sessionState>

8. What is VIP swap?

VIP swap is just a virtual IP swap. VIP swap is the standard way to move your staging deployment to prod and vice versa. This feature is intended to high availability.

9. How to replace azurewebsites.net URL from custom domain name?

Custom DNS is not supported in free tier. You have to access control over DNS settings.
·         Create a CNAME record with your domain provider. Provide name as “www”.
·         Enable CNAME record mapping in your app in azure portal.
·         Add hostname
·         Create A and TXT record inside domain provider
For A record provide IP address of your app from azure portal.
For TXT record provide azurewebsite.net URL of your app.
·         Add these record type also by add hostname in azure portal.

10. What is NoSQL Db. List some example of those.

·         DocumentDb
·         CosmosDb



Wednesday, 7 June 2017

Random Advance C# FAQs


  1.  Difference between const, readlonly and static readonly?
  2.  const: const variable value is set as constant value at compile time. it can not be changed.
     readonly: readonly value can be changed at run time using constructor. 
     static readonly: static readonly variables value only can be changed inside static  constructor at run time.

  3. Difference between Binary and XML Serialization?

  4. Binary Serialization: In binary serialization, all  members whether these are pubic, private or readonly are serialized. This is faster than XML serialization. 
    XML Serialization: It serialize only public members.