Saturday, 12 October 2019

Top 20 Azure Administrator Interview Questions and Answers

  1. What is Azure Virtual Machine?

    Azure Virtual Machines are on-demand computing resources or virtual machines offering of Microsoft Azure. We can typically use a VM as a service when required and shut down the system when not in use. The Azure Virtual Machines are listed under Infrastructure as a service (IaaS) category in Azure. With Azure Virtual Machines we get more control over the environment to customize the development environment or hosting.
  2. You have received an email from your company security team that a couple of VMs are exposed to the internet, how toprevent that public access without interruption of any service?

    In that case, you need to create the NSG and associate your VMs if there is no NSG. Now, block the port 80/443 and allow only specific ports of azure which will fix the issue.
    • Click on the VMs
    • Click on the networking tab
    • Click on the NSG
    • Then create the Outbound deny rule for the internet.
  3. You have a couple of VMs of 4 Core and 16GB. You need to upgrade VMs to 8 Core and 32 GB Ram since they are not performing well. So, what are the steps you will take?

    You will go to specific VMs and perform the below steps.
    • First, take approval from the Application Owner for downtime because it will automatically reboot the VM.
    • Go to each VM and Click on the Size
    • Select the VM instance Size of 8 core 32 GB Ram VMs.
    • Once you will select the specific Size, it will automatically start upgrading the instance.
    • After that, you need to verify all the setting of the VMs and handover to application Owner if activity completed successfully.
  4. You have a couple of VMs running in Azure environments and you need to enable the Availability set, how to do that?

    No. It’s not possible to enable the AV set in running systems there is a limitation to it, if you want to enable the same then you need to recreate the VMs and Add the Availability set to it.
  1. Is it possible to enable the NSG in Vnetsinceyou doesn’t want to enable it on VMs level?

    It’s not possible to enable the NSG in Vents but certainly, you can associate with Subnets which will help you to reduce the manageability of your NSG.
  2. What is NSG and How can you create the NSG?

    NSG is nothing but its services will help you to allow or deny the specific port to communicate to your services within subscription or outside of the subscription. It’ has inbound and outbound rules.
    Inbound Rule: It defines the traffic coming from the internet to VMs or specific services or VMs.
    Outboard Rules: It defines the traffic going to the internet from your VMs or specific services or VMs.
    You need to follow steps to create the NSG and Associate to VMs.
    • In All Services Search the NSG.
    • Provide the Name, Location and Resource Group
    • Click on the NSG and create the NSG.
  3. Is it possible to host the VM in another region and connect to a different region?

    Yes, you need to set up the interconnectivity while creation the V-net (Virtual Network) to V-net (Virtual Network) connection between both the regions.
  4. One of your clients escalated that hisVM has been rebooted without intimating to him and you need to know logs who has rebooted the VM, how can get the details.

    In that case, Activity logs will help, as any activity happens in VMs through the portal, you will get a log alerts store in the activity logs, so you will go to activity logs and found that who has rebooted the VM and can share with clients after manager approval.
  5. In your organization, you have some client who doesn't want to give the subscription access, but they have given the PowerShell access, how you create the Storage account using PowerShell?

    New-AzureRmStorageAccount -ResourceGroupName azure4you -Name azureint234 -SkuNameStandard_LRS -Location 'East Us'
  6. How to tag the resources using a command?

    You should use the below command lets to tag the resources.
    Set-AzureRmResourceGroup -Name "Azure4you.com" -Tag @{Department="IT"}
  7. What is the difference between Premium Storage Account and Standard Storage Account?

    Premium Storage Accounts are backed by SSD Disk which provided the resilience and better performance where standard Storage Accounts are backed by HDD (magnetic Disk) and Provides the maximum IOPS up to 500.
  8. What is the difference between Managed Disk and Unmanaged Disk?

    Managed Disk: In Managed disk storage accounts creation/Management done on the backend. It will help you on the scalability of storage accounts and backed by Standard/premium Tires.
    Unmanaged Disk: Unmanaged disk are the disk which you will create the storage accounts. Create the disk and Managed by you and you need to make sure you can’t exceed the Storage limit up 20K IOPS while adding many disks which may throttled the VMs performance.
  9. What is Site to Site VPN?

    Azure Site to Site VPN will help you to connect to On-Premises Network to Azure Virtual Network Over an IPsec/IKE (IKEV1/IKEV2) VPN tunnel. Basically, this connection required a VPN device which public facing IP Address assigned to it.
  10. A customer has Prod, Dev and Test environments. How to implement a solution that each environment can’t connect to each other?

    In that case, you can separate the environments while creating the different subnets for Prod, Dev, Test environments and apply the NSG on each subnet with specific deny rule which will not allow connecting to those environments.
  11. What are the tools you will use to create the Vnets?

    You can use the below tools to configure the Azure Vnets.
    • Azure portal
    • PowerShell
    • Azure CLI
  12. Your customer has configured the policy-based routing but due to the issue, he wants to change to route based configuration in Azure VPN, how you can deliver the solution?

    Basically, the customer can’t change them or update their routing method directly as that is not supported by MS Azure. He must create the New connection use the method to route based on the new connection.
    • First, you need to delete the Route based connection
    • Delete the Gateway
    • Then you will recreate the connection using Azure Portal, CLI or PowerShell.
  13. How to configure the static public IP address VPN gateway?

    Basically, it’s not supported by Microsoft and when you create the VPN gateway at that time dynamic IP address will automatically configure and that will change only when you will delete or recreate the VPN gateway.
  14. What protocols are supported by Application gateway?

    It supports the HTTP, HTTPS, HTTP/2, and WebSocket
  15. What is Azure Active Directory?

    Azure AD is cloud-based identity and access management services which will help to access the Azure resources like Azure subscription, Other Application. You can integrate Azure AD to O365, SharePoint Online, etc.
  16. What is Azure Backup and what are the benefits of Azure Backup?

    Azure Backup is a cloud-based solution which will help you to take the backup of the Azure VM, PaaS SQLDB, file service, web apps etc.
    • It provides a hybrid solution to take the backup.
    • Storage will be managed automatically using Azure storage accounts and it doesn’t require any local storage like on-premises.
    • You can transfer the unlimited data and this data stored in encrypted format in Azure storage accounts.

Top 20 Azure Developer Interview Questions and Answers

  1. What is Cloud Computing?

    Cloud computing is a way to deliver computing as a service rather than a product. It is completely based on the Internet. Cloud computing provides on-demand hardware (like Server), storage, application hosting, and other services. In this way, it reduces the need for having your local servers or personal devices to configure and manage your services and applications.
  2. What are the key characteristics exposed by Cloud Computing?

    The key characteristics of cloud computing are given below-

    Scalability and Elasticity 

    Scalability allows you to handle the increasing workload by increasing the number of resources or its capacity-on-demand or based upon the usage of the resources.
    Elasticity allows you to use or free, a resource capacity dynamically. It is measured based upon the speed as the resources are requested on-demand and the usage of the resources.

    Maintenance

    Maintenance of a cloud computing application is easier, as it does not require to be installed on each user’s machine. Also, the applications which are deployed or running on the cloud, you don’t need to install on each system. Everyone can access it using the internet.

    Reliability 

    Your deployed application or database multiple copies are maintained by the cloud vendors, which makes well-designed cloud computing suitable for business continuity and disaster recovery.

    Cost

    Cloud vendors always charge only for the usages and used storage. If a resource is not in use, you don’t need to pay extra cost for any unused resource.

    Security

    All the created resources are secured by each cloud vendors. Even they are certified from various certification authorities that ensure your privacy and data security.
  3. What is Microsoft Azure?

    Microsoft Azure is an open and flexible cloud platform that serves as the development, data storing, service hosting and service management environment. Microsoft Azure provides developers with on-demand compute and storage to host, scale, and manage web applications on the internet through Microsoft data centers. Microsoft Azure helps you to build and manage enterprise-level web, mobile, IoT apps faster using your existing skills and technologies you know.
  4. What is Microsoft Azure Advantages?

    These are the following advantages of Microsoft Azure:
    • Reduce the effort and costs of IT management
    • Reduce the cost of building and extending on-premises resources
    • Respond quickly to changes in your business & customer needs
    • Choose on-premises or off-premises deployment model that suits you
    • Scale your IT resources up and down based on your needs
    • Consume computing resources ONLY when the needs arise
    • Remove the need to manage hardware
    • Use your existing development skills to build cloud applications

    • Consistent development and management experience across on-premises and the cloud
  5. What are Microsoft Azure role-based certification exams or paths?

    Microsoft announced new roles based Azure certification paths for Administrators, Developers, Solutions Architects and DevOps Engineer who are working with Microsoft Azure Cloud platform. These new certification paths have been introduced based on technical roles and working, rather than covering the broad range of Microsoft Azure features and services to each of them.
    The new role-based certifications will help you to be aligned with your technical role and skills. Earn a role-based Azure certification and make a bright career in Microsoft Azure as a Developer, Administrator, Solutions Architect or DevOps Engineer.
  6. What is a Resource group?

    A resource group is a logical container for created resources in Azure. An ARM resource can exist only in one resource group. A resource group is created in a region and it can have the resources from the other regions. All resources within the resource group share the common lifecycle.
    Image Source: https://docs.microsoft.com/en-us/azure/architecture
  7. Can you move a resource from one group to another?

    Yes, you can. A resource can be moved among resource groups.
  8. How many resource groups a subscription can have?

    A subscription can have up to 800 resource groups. Also, a resource group can have up to 800 resources of the same type and up to 15 tags.
  9. What is Azure Storage?

    Azure Storage is Microsoft’s storage solution for data persistence scenarios. Azure Storage offers highly durable, available and scalable as compared to the traditional data storage solutions. In Azure storage, you have to pay only for what you use and it is exposed via easy and open REST APIs. It’s having support for rich Client Libraries and Tools.
  10. What are the different types of storage available in Azure?

    The different types of Storage are:
    • Blobs: Used for storing massive amounts of unstructured and large data.
    • Queues: Used for storing messages used for communication between application components.
    • Files: Used for storing files and sharing it among the VMs as shared disk storage.
    • Disks: Used for creating virtual machine disks for high I/O and random read-write operations.
    • Tables: Used for storing structured data in NoSQL format. Suitable for small size database.
  11. What are Azure App Services?

    Azure App Services is the part of PaaS offering from Microsoft Azure. These are used to Quickly build, deploy, and scale enterprise-grade web, mobile, and API apps running on any platform. Behind the scenes, VMs are used but they are abstracted. These support manual scaling and auto-scaling. It having support for Java, Node.js, PHP, Python, .NET and Ruby.
  12. What are the different types of applications provided by App Services in Azure?

    Azure App Service supports the following types of applications.
    • Web Apps
    • Mobile Apps
    • API Apps
    • Logic Apps
  13. What are the different ways to host web sites in Azure?

    Azure supports multiple ways to Host like App Service (PaaS), Virtual Machine (IaaS) and Service Fabric.
    • App Service is the best option for Most of the web sites. It allows quick deployment, scalability, management & also cost-effective.
    • A Virtual Machine is an option if your existing Web Sites require Custom Configurations in IIS Level, Cannot Fit into App Service etc.
    • Service Fabric is an option if you are writing a Microservice application that requires Massive Scaling, Stateful Services etc.
  14. How the app services can be scaled?

    An app service supports two types of scaling - vertical (up/down) and horizontal (out/in). During scaling, there is no impact on service availability.
    • In vertical scaling, VM size can be increased or decreased as per your need.
    • In horizontal scaling, identical VMs of the desired size will be created or removed as per your need
    • Autoscaling is supported by standard and premium based on matrices (response time, memory, CPU, data uses etc.)
  15. What is Server-less Computing?

    Server-less computing is one of the most coined terms in the cloud these days. Unleashing the PaaS feature with an immense amount compute power without any server to host an app has really impacted web development a big way. The idea is to do compute without hosting the app on a server.
    Basically, we can think of it to be a cab aggregator or even food delivery startups which provide us with a platform to book a cab or order food but the actual service will be provided by a third-party vendor. On a similar note, we put our logic on a serverless computing module which can connect to different third-party services to do the job.
  16. What is Azure Function?

    Azure Function is a Serverless Compute Service that Runs code on Demand like Events or External-Invoke. Azure Functions can Scale up Automatically based on Demand. Azure functions are the evolution of Web Jobs. You can develop functions in C#, Node, Java, Python etc. Internally, Azure functions use App services.
    We can use Functions for Backend Services, Event-based Processing like Data Table creation on File Upload, Scheduled Tasks etc.
  17. What are Azure SQL Database Models?

    Azure supports the three database models for storing database as given below:

    Standalone Database

    An isolated and self-contained database service that has database scoped functionalities. It is designed for modern cloud-based applications, software-as-a-service solutions, and microservices that use a single database to store data.
    Image Source: https://azure.microsoft.com/en-us/blog

    Elastic pool

    A group of standalone databases that share the same resources. Helpful to reduce the operational cost.

    Managed Instance

    A full SQL Server Instance with instance-level functionalities (SQL Agent, Broker, .NET hosting). Designed for easy migration of most of the on-premises databases to the Azure cloud.
  18. How to choose between DTU and vCore?

    Refer to the following suggestions:
    • Use the DTU model If there are no performance issues.
    • In DTU based model, you need to pay a fixed amount each month for pre-configured compute resources.
    • vCore allows you to dig into the underlying resources and scale them independently for optimal performance.
    • vCore allows you to take Azure Hybrid Benefit for SQL Server.
    • You can migrate between DTU-based and vCore-based models through the portal online.
  19. What is Azure Cosmos DB?

    Azure Cosmos DB is a Planet-scale, Globally Distributed Database provided by Azure. It is Schema-agnostic and hence considered a NoSQL database. Cosmos DB provides Incredibly Low Latency in the order of Milliseconds. Cosmos DB supports a wide range of APIs including SQL, MongoDB, Cassandra, Graph, Table etc.
  20. What is Azure Search?

    Azure Search is a Search-as-a-Solution hosted & managed by Azure. Azure Search allows Developers to build Search Experience over multiple sources of content in web, mobile & enterprise applications queryable with a REST API interface.
    Azure Search itself takes care of Index creation, Service availability, Scaling and Service updates.

Tuesday, 1 October 2019

Disable browser back button functionality using JavaScript in asp.net | ASP.Net disable browser back button (using javascript)

Here I will explain how to disable browser back button functionality using JavaScript in asp.net.

Description

One day I got requirement like disable browser back button to prevent users going back to previous page using back button of the browser. I search many sites for proper code to prevent users navigating back to previous page but there is no use because some of them work in IE but not in Mozilla and some of them will work in Mozilla but not in IE.


Here this JavaScript functionality will work in all browsers and prevent users navigating back to previous page by hitting on browser back button check below piece of JavaScript code



<script type="text/javascript" language="javascript">
function DisableBackButton() {
window.history.forward()
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function(evt) { if (evt.persisted) DisableBackButton() }
window.onunload = function() { void (0) }
</script>
We need to place above script in header section of a page wherever we need to prevent users navigate back to another page by using browser back button. 

I will explain our requirement with an example I have two pages Defaul1.aspx and Default2.aspx now I will redirect from Default1.aspx page to Defaul2.aspx page. After come from Defaul1.aspx page to Default2.aspx if I try to navigate back to Default1.aspx page from Defaul2.aspx then I want prevent user navigate back to previous page (Defaul1.aspx). To achieve this functionality place above JavaScript function in header section of required page. 



After add our JavaScript functionality to our page that code will be like this


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Disable Browser Back buttons</title>
<script type="text/javascript" language="javascript">


function DisableBackButton() {
window.history.forward()
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function(evt) { if (evt.persisted) DisableBackButton() }
window.onunload = function() { void (0) }
</script>
</head>
<body >
<form id="form1" runat="server">
<div>
First Page
</div>
<div>
<asp:Button id="btnFirst" runat="server" Text="Go to First Page" PostBackUrl="~/Default.aspx"  />
<asp:Button ID="btnSecond" runat="server" Text="Go to Second Page" PostBackUrl="~/Default2.aspx" />
<asp:Button ID="btnThree" runat="server" Text="Go to Third Page" PostBackUrl="~/Default3.aspx" />
</div>
</form>
</body>
</html>



We can also achieve this by disabling browser caching in code behind write the following lines of code in Page_Init event or Page_Load event and don’t forgot to add namespace using System.Web; because HttpCacheability related to that namespace.

protected void Page_Init(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
Response.Cache.SetNoStore();
}
We need to place this code in a page wherever we need to disable browser back button. If we use above caching method to disable browser back button that will display webpage expired message like this