Apply / Update application settings for Azure App Service using PowerShell

Windows Azure App Service (Now an umbrella term for Azure Web App, Azure Api App, etc.) has a handy capability whereby developers can store key-value string pairs in Azure as part of the configuration information associated with a website.  At runtime, Windows Azure Web Sites automatically retrieves these values for you and makes them available to code running in your website.  Since the key-value pairs are stored behind the scenes in the Windows Azure Web Sites configuration store, the key-value pairs don’t need to be stored in the file content of your web application.  From a security perspective that is a nice side benefit since sensitive information such as Sql connection strings with passwords never show up as cleartext in a config file. However, sometimes, this can be a little too much for the Azure Admins to configure each setting over there. In this blog post, we’ll learn how to apply application settings using PowerShell.  Continue reading “Apply / Update application settings for Azure App Service using PowerShell”

Backup / Restore Data to / from Azure Cosmos Database with Mongo DB API

Azure Cosmos Database (formerly known as Azure DocumentDB) is a PaaS offering from Microsoft Azure. As a document store, it falls into the same category as MongoDB, CouchDB or RethinkDB and other No SQL DBs and just like those, it handles documents in the JSON format.

Azure Cosmos DB automatically takes backups of all your data at regular intervals.  These automated backups are currently taken approximately every four hours and latest 2 backups are stored at all times. If the data is accidentally dropped or corrupted, you can contact Azure support within eight hours.

Now what happens if you figure out after 8 hours that your data is lost or if its corrupted in your development / staging environments or something accidentally went wrong with production while everyone was on holidays. Continue reading “Backup / Restore Data to / from Azure Cosmos Database with Mongo DB API”

Protect source code and use code policies in VSTS

As part of best practices, your source code should always in working state so that it can be readily made available in case of the disaster. The easiest way of maintaining this is by making use of various branches for source code modification and merging only valid source code changes in the master branch. Also build and release process is often set on the master branch so that you can always deploy release from working source code. So it becomes further important to protect your master branch from unwanted changes. In this blog post, we’ll discuss how to protect master branch from unwanted changes in VSTS by making use of both permissions and code policies.

Making use of Permissions to adjust Security

A project can have multiple source code repositories for different parts of the project. Continue reading “Protect source code and use code policies in VSTS”

Create Azure Storage Shared Access Signature and manage files with PowerShell

In one of the previous posts, we discussed how to create and manage Azure Storage accounts using PowerShell. However, we were using storage account key when trying to upload / delete / download files from azure blob storage. In case, you need to delegate access to a third person, this seems like a too much of access since that person will have access to whole storage account. In this post, we will discuss how to use SAS aka Shared Access Signature to delegate access in controlled way.

Concept of Shared Access Signature

A shared access signature is a way to delegate access to resources in a storage account, without sharing the storage account keys. Continue reading “Create Azure Storage Shared Access Signature and manage files with PowerShell”

Working with Git and Visual Studio – Merging Changes using Visual Studio

This post is part of the series of posts on the Git and Visual Studio where we are discussing in detail on meaning of basic git operations, how to do them in Git and Visual Studio both and understand the difference of both tools. You can find the previous blog post here.

In previous blog post, we discussed what is Git Merge, types of Merging and how to achieve the same using git native commands. In this blog post, we’ll learn how to do the same by using Visual Studio.

Fast-forward Merge / Simple Merge

First, let’s reset everything back to commit before merge by using git reset –hard so that we can now compare the results how we did in previous post vs using visual studio. Continue reading “Working with Git and Visual Studio – Merging Changes using Visual Studio”

Setup API definition and CORS for Azure Web Apps using Azure ARM template

Microsoft Azure App Service can not only be used to host web apps but they can also be used to host API services. Swagger is a framework for describing your API using a common language that everyone can understand. In order for the other softwares to parse your Swagger and notice your API as connector, it’s necessary that you enable CORS and set the APIDefinition properties of the web application you want to use:

api definition from azure portal

Continue reading “Setup API definition and CORS for Azure Web Apps using Azure ARM template”

Create Azure Web App in existing App Hosting Plan using Azure ARM template

When working with Azure services, you will combine services together. Many times, you would need to add an Azure Web App to an existing App Hosting Plan rather than creating a new app hosting plan every time you want to create an azure app service. This is a useful strategy to save cost if the load on the web site is not high. In this blog post we are going to discuss how we can leverage Azure ARM to deploy an app service to an existing app hosting plan.

In one of the previous posts, we discussed how to create an app hosting plan and an azure app service in one go using Azure ARM. The way we linked an hosting plan with app service is by mentioning app hosting plan id inside the property of the web app:

Continue reading “Create Azure Web App in existing App Hosting Plan using Azure ARM template”