Understand Syntax of Azure Resource Manager (or ARM) Templates

The infrastructure for an application generally consists of many components. It consists of an application code itself, a server somewhere to run that code (typically a virtual machine), a storage to hold the data, a database and a network. You may also want to have integration with 3rd party services. So in order for your application to work, either you want to have all this in place, or none at all. Same is true whenever you would want to deploy your application in Microsoft Azure. Azure Resource Manager or ARM is a way to manage all interdependent parts as one resource group. You can deploy, update or delete all the resources required for your application to work.

With Azure Resource Manager, you can create a template that defines all the interdependent parts required for your application. This template is defined using JSON format. See more details on ARM templates here and about JSON here. In this blog post, we’ll understand the syntax to create ARM templates. Continue reading “Understand Syntax of Azure Resource Manager (or ARM) Templates”

VSTS Azure SQL Database Deployment task keeps failing with Error: Login failed for user

The task is used to deploy Azure SQL Database to an existing Azure SQL Server, either by using DACPACs or SQL Server scripts. The DACPACs are deployed using SqlPackage.exe and the SQL Server scripts are deployed using the Invoke-Sqlcmd cmdlet. DACPACs and SqlPackage.exe and Invoke-Sqlcmd cmdlet provides for fine-grained control over the database creation and upgrades, including upgrades for schema, triggers, stored procedures, roles, users, extended properties etc. Using the task, multiple different properties can be set to ensure that the database is created or upgraded properly.  Continue reading “VSTS Azure SQL Database Deployment task keeps failing with Error: Login failed for user”

Identify outgoing Azure App Service IP address

Outgoing IP address for Azure App service are different than the incoming IP address. To clarify the difference, the incoming IP address (as the name would indicate) identify the IP address using which data could be sent to App Service. This is what you would see when you would typically do DNS resolution for the App Service. Outgoing IP address identify IP address which would be used when sending data from Azure App service to the outside world. You may need this info because you may need to protect your environment from threats or white-list certain requests.

To identify outgoing Azure App Service IP address, we can simply navigate to the https://portal.azure.com and then go to the app service in reference. Continue reading “Identify outgoing Azure App Service IP address”

Understand what Azure ARM templates are

The infrastructure for an application is typically made up of many components – a server to execute and respond to all calls, a storage mechanism to handle all I/O (input/output) , some kind of networking mechanism and finally off course, your application. Your application may be a standalone application with or without any database support and with or without any 3rd party integration services. You don’t generally want to see these components as separate entities or you may be (depending upon your background in Information Technology Sector) .

Generally, if you are a consumer, all you are concerned about is to consume how services available by a particular piece of the application. Continue reading “Understand what Azure ARM templates are”

Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program

If you have recently installed Azure PowerShell module on one of the machines and then trying to login using Select-AzureRMProfile, you are likely to receive below error:

Save-AzureRMProfile : The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try againAt line:3 char:2+  Save-AzureRMProfile -Path “C:\$SubscriptionName.json”+  ~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (Save-AzureRMProfile:String) [], CommandNotFoundException    + FullyQualifiedErrorId : CommandNotFoundException

I checked the list of cmdlets and it was gone. Continue reading “Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program”

Update connection string for entity framework in Azure Web App settings

One of the coolest things about Windows Azure Websites is the integration with source control, and the automated deployment hooks Azure offers. However, there are a number of small gotcha’s related to deployment, chief among these is the protection of confidential configuration items such as database connection strings. One of these gotchas is for connection string for entity framework, for which there is no native provider in Azure web app settings.

When you use Entity Framework to either build a database based upon the model you create in the VS Entity Designer, or use Entity framework to reverse-engineer a conceptual model from an existing database, it creates a bunch of meta-data mappings used to manage the interaction of your application with the database. Continue reading “Update connection string for entity framework in Azure Web App settings”

Connect to Azure Web App via FTP to upload/download files

Azure web apps is one of popular offerings of Azure Platform as a Service (PaaS). It has now become part of Azure App Service and also known as Azure App Service Web Apps. Azure Web Apps enables you to build and host web applications in the programming language of your choice without managing infrastructure. It offers auto-scaling and high availability, supports both Windows and Linux, and enables automated deployments from GitHub, Visual Studio Team Services, or any Git repo.

Kudu is one of the advanced online tools for viewing files in the Azure Portal. However, Kudu does not let you view files or upload new files with some modified content. Generally, you would make changes inside your code and publish to Azure which all works seamlessly. However, some time it is just too much work to modify a couple of lines in the one of the files or if you want to make sure that content uploaded is proper or not, you cannot do it. For this, you need to use FTP to upload/download files. In this blog post, we’ll cover steps required to upload/download files from Azure Web Apps via FTP. Continue reading “Connect to Azure Web App via FTP to upload/download files”